/* ==========================================================================
   WebR Admin Panel
   ========================================================================== */

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

/* The hidden attribute must always win, even over author display rules
   (e.g. .a-form's display:flex was overriding it and exposing hidden forms). */
[hidden] { display: none !important; }

:root {
    --brand: #4A7CFF;
    --brand-soft: #7EA6FF;
    --bg: #05070E;
    --bg-soft: #0B0F1C;
    --panel: #10152A;
    --panel-2: #151A32;
    --border: rgba(255,255,255,.08);
    --border-strong: rgba(255,255,255,.16);
    --text: #E9EEFB;
    --muted: #98A0BF;
    --muted-2: #6B7492;
    --success: #4BD68A;
    --warn: #FFC24A;
    --danger: #FF6B7A;
    --sidebar-w: 260px;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
    color-scheme: dark;
}

html, body { height: 100%; }

body.admin-body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(900px 500px at 100% 0%, rgba(74,124,255,.10), transparent 60%),
        radial-gradient(700px 400px at 0% 50%, rgba(126,166,255,.07), transparent 60%);
    background-attachment: fixed;
}

img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand-soft); text-decoration: none; }
h1,h2,h3,h4 { margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--muted); margin: 0 0 1em; }
.muted { color: var(--muted); }
.muted.small { font-size: .8rem; }
code { background: rgba(255,255,255,.06); padding: .05em .4em; border-radius: 4px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; }

/* Buttons (shared with public) */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font-weight: 600; padding: .6rem 1rem; border-radius: 10px;
    border: 1px solid transparent; cursor: pointer; font: inherit;
    white-space: nowrap; text-decoration: none;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}
.a-panel-head .btn, .a-panel-head form { flex: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-soft)); color: #05070E;
    box-shadow: 0 8px 20px -10px rgba(74,124,255,.6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(74,124,255,.7); color: #05070E; }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand-soft); color: var(--brand-soft); }
.btn-danger { background: rgba(255,107,122,.14); border-color: rgba(255,107,122,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,122,.24); }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 10px; border: 1px solid; font-size: .92rem; margin-bottom: 1rem; }
.alert-success { background: rgba(75,214,138,.1); border-color: rgba(75,214,138,.35); color: #a5f0c4; }
.alert-error { background: rgba(255,107,122,.1); border-color: rgba(255,107,122,.35); color: #ffb0b8; }
.alert-warn { background: rgba(255,194,74,.1); border-color: rgba(255,194,74,.35); color: #ffe1a3; }

/* ============ Login ============ */
.admin-login {
    min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background: var(--bg);
    background-image:
        radial-gradient(900px 500px at 100% 0%, rgba(74,124,255,.18), transparent 60%),
        radial-gradient(700px 400px at 0% 100%, rgba(126,166,255,.14), transparent 60%);
    position: relative; overflow: hidden;
}
.login-orbit span { position: absolute; border-radius: 999px; filter: blur(80px); }
.login-orbit span:first-child { width: 500px; height: 500px; right: -100px; top: -140px; background: radial-gradient(circle, rgba(74,124,255,.5), transparent 65%); }
.login-orbit span:last-child { width: 380px; height: 380px; left: -100px; bottom: -100px; background: radial-gradient(circle, rgba(126,166,255,.3), transparent 65%); }

.login-wrap { max-width: 440px; width: 100%; text-align: center; position: relative; z-index: 1; }
.login-brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); font-size: 1.4rem; font-weight: 700; margin-bottom: 2rem; }
.login-brand img { border-radius: 999px; }
.login-brand em { color: var(--brand); font-style: normal; }
.login-card {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border);
    padding: 2.4rem;
    border-radius: 20px;
    text-align: left;
    box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
}
.login-card h1 { font-size: 1.4rem; margin: 0 0 .3rem; text-align: center; }
.login-card p { text-align: center; margin-bottom: 1.4rem; }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: .4rem; }
.login-form span { font-size: .82rem; color: var(--muted); font-weight: 500; }
.login-form input {
    background: rgba(255,255,255,.03); border: 1px solid var(--border-strong);
    color: var(--text); font: inherit; padding: .78rem .9rem; border-radius: 10px;
}
.login-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,124,255,.18); }
.login-form .btn { margin-top: .4rem; justify-content: center; }
.back-home { display: inline-block; margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }

/* ============ Admin shell ============ */
.a-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 1.4rem 1rem 1rem;
    overflow-y: auto;
    z-index: 40;
}
.a-brand { display: flex; align-items: center; gap: .7rem; color: var(--text); padding: 0 .4rem 1.3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; }
.a-brand img { border-radius: 999px; }
.a-brand-text { font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.a-brand-text em { color: var(--brand); font-style: normal; }
.a-brand-text small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); font-weight: 500; }

.a-nav { flex: 1; display: flex; flex-direction: column; gap: 1.2rem; }
.a-nav-group { display: flex; flex-direction: column; gap: .1rem; }
.a-nav-title { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); padding: 0 .8rem; margin-bottom: .3rem; font-weight: 600; }
.a-nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .8rem; border-radius: 8px;
    color: var(--muted); font-size: .92rem; font-weight: 500;
    transition: background .16s ease, color .16s ease;
}
.a-nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.a-nav-item.is-active { background: rgba(74,124,255,.14); color: var(--text); box-shadow: inset 0 0 0 1px rgba(74,124,255,.35); }
.a-nav-item svg { color: var(--brand-soft); flex-shrink: 0; }

.a-user { display: flex; align-items: center; gap: .6rem; padding: .8rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.a-user-info { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.a-user-info strong { display: block; font-size: .9rem; }
.a-user-info span { display: block; font-size: .78rem; color: var(--muted-2); }
.a-avatar {
    width: 36px; height: 36px; border-radius: 999px;
    display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    color: var(--bg); font-weight: 800; text-decoration: none;
}
.a-avatar img { width: 100%; height: 100%; object-fit: cover; }
.a-logout { padding: .5rem; border-radius: 8px; color: var(--muted); }
.a-logout:hover { background: rgba(255,255,255,.06); color: var(--danger); }

/* Dashboard welcome banner */
.a-welcome {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
    margin-bottom: 1.2rem; padding: 1.5rem 1.6rem;
    background:
        radial-gradient(60% 90% at 0% 0%, color-mix(in srgb, var(--brand) 16%, transparent) 0%, transparent 60%),
        radial-gradient(60% 90% at 100% 100%, color-mix(in srgb, var(--brand-soft) 10%, transparent) 0%, transparent 60%),
        linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px;
    position: relative; overflow: hidden;
}
.a-welcome::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
    pointer-events: none;
}
.a-welcome > * { position: relative; z-index: 1; }
.a-welcome-text { display: flex; flex-direction: column; min-width: 0; }
.a-welcome-greet {
    font-size: .74rem; color: var(--brand-soft); letter-spacing: .14em;
    text-transform: uppercase; font-weight: 600; margin-bottom: .35rem;
}
.a-welcome-name {
    font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800;
    letter-spacing: -.02em; line-height: 1; color: var(--text); margin-bottom: .45rem;
}
.a-welcome-sub { color: var(--muted); font-size: .92rem; }
.a-welcome-meta { text-align: right; min-width: 130px; }
.a-welcome-clock {
    display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em;
    color: var(--text); font-variant-numeric: tabular-nums;
}
.a-welcome-date { display: block; color: var(--muted); font-size: .82rem; margin-top: .15rem; }
@media (max-width: 640px) {
    .a-welcome { padding: 1.1rem 1.2rem; gap: .9rem; }
    .a-welcome-meta { text-align: left; min-width: 0; }
    .a-welcome-name { font-size: 1.4rem; }
    .a-welcome-clock { font-size: 1.4rem; }
}

/* Header account chip (top-right) → My Account */
.a-topuser {
    display: flex; align-items: center; gap: .5rem;
    padding: .22rem .7rem .22rem .28rem; border-radius: 999px;
    border: 1px solid var(--border-strong); background: rgba(255,255,255,.03);
    color: var(--text); text-decoration: none; flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease;
}
.a-topuser:hover { background: rgba(255,255,255,.08); border-color: var(--border-strong); }
.a-topuser-av {
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    color: var(--bg); font-weight: 800; font-size: .82rem;
}
.a-topuser-av img { width: 100%; height: 100%; object-fit: cover; }
.a-topuser-name { font-size: .85rem; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .a-topuser-name { display: none; } .a-topuser { padding: .22rem; border-color: transparent; background: none; } }

.a-main {
    margin-left: var(--sidebar-w);
    /* NOTE: top padding is 0 on purpose — the sticky .a-topbar sits flush at the
       top instead of being pulled up with a negative margin, which Safari clips
       when scrolling. Vertical rhythm comes from the topbar's own margin-bottom. */
    padding: 0 clamp(1rem, 2vw, 2rem) 3rem;
    min-height: 100vh;
    transition: margin-left .2s ease;
}
.a-flashes, .a-content { max-width: 1560px; margin-inline: auto; }
/* Sticky topbar: pinned to the viewport top on every page, full-bleed across
   the main column, translucent + blurred where supported. Below the sidebar
   (z 40) so the mobile off-canvas nav slides over it. */
.a-topbar {
    position: sticky; top: 0; z-index: 30;
    margin: 0 calc(clamp(1rem, 2vw, 2rem) * -1) 1.5rem;
    padding: .8rem clamp(1rem, 2vw, 2rem);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .a-topbar { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); }
}
.a-topbar-inner { display: flex; align-items: center; gap: 1rem; max-width: 1560px; margin-inline: auto; min-width: 0; }
.a-topbar-inner > div:nth-child(2) { flex: 1; min-width: 0; }
.a-crumb { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); font-weight: 600; }
.a-topbar h1 { margin: 0; font-size: 1.35rem; }
/* Admin-wide search box + results dropdown */
.a-search-wrap { position: relative; flex: 0 1 320px; min-width: 0; margin-left: auto; }
.a-topsearch {
    width: 100%; background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text);
    border-radius: 10px; padding: .5rem .8rem; font-size: .9rem; font-family: inherit;
}
.a-topsearch:focus { outline: none; border-color: var(--brand); }
.a-search-results {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 60;
    max-height: min(70vh, 480px); overflow-y: auto;
    background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); padding: .35rem;
}
.a-search-results[hidden] { display: none; }
.a-search-group { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); padding: .5rem .6rem .2rem; }
.a-search-item { display: block; padding: .5rem .6rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.a-search-item:hover, .a-search-item.is-active { background: var(--panel-2); }
.a-search-title { display: block; font-size: .88rem; font-weight: 500; }
.a-search-snip { display: block; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-search-item mark, .a-search-title mark { background: rgba(74,124,255,.32); color: inherit; border-radius: 3px; padding: 0 1px; }
.a-search-empty { padding: .8rem .7rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) { .a-search-wrap { flex-basis: 200px; } }
@media (max-width: 640px) {
    .a-search-wrap { order: 3; flex: 1 1 100%; margin: .5rem 0 0; }
    .a-topbar-inner { flex-wrap: wrap; }
}

.a-topbar-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.a-topbar-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
    .a-crumb { display: none; }
    .a-topbar h1 { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .a-topbar-btn-label { display: none; } /* icon-only actions; aria-labels keep them accessible */
    .a-topbar-actions .btn { padding: .5rem .6rem; }
}

.a-sidebar-toggle {
    display: none; background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); padding: .55rem; cursor: pointer;
}

/* Dimmed backdrop behind the off-canvas nav (created by admin.js). Sits below the
   sidebar (z 40) but above everything else so a tap anywhere closes the menu. */
.a-sidebar-backdrop {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(3, 5, 12, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease;
}
.a-sidebar-backdrop.is-visible { opacity: 1; visibility: visible; }
@media (min-width: 901px) { .a-sidebar-backdrop { display: none; } }
body.a-nav-open { overflow: hidden; }

/* Mobile sidebar */
@media (max-width: 900px) {
    .a-sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 60px -20px rgba(0,0,0,.6); width: min(84vw, var(--sidebar-w)); }
    .a-sidebar[data-open="1"] { transform: translateX(0); }
    .a-main { margin-left: 0; padding-top: calc(var(--topbar-h, 66px) + .9rem); }
    .a-sidebar-toggle { display: inline-flex; }
    /* Roomier tap targets in the off-canvas nav */
    .a-nav-item { padding: .7rem .8rem; font-size: .96rem; }
    /* Keep the topbar (hamburger + title) pinned on phones. iOS Safari mishandles
       position:sticky + backdrop-filter (the bar drifts away on scroll), so pin it
       with position:fixed and a solid background, offsetting the content above via
       --topbar-h (measured by JS on load + resize). */
    .a-topbar {
        position: fixed; top: 0; left: 0; right: 0; margin: 0;
        background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none;
    }
}

/* ---- General mobile polish (applies across every admin tab) ---- */
@media (max-width: 640px) {
    .a-panel { padding: 1.1rem; border-radius: 14px; margin-bottom: 1rem; }
    /* Panel headers with action buttons: let the buttons drop under the title
       instead of squashing it, and stretch full width so they stay tappable. */
    .a-panel-head { flex-wrap: wrap; align-items: flex-start; gap: .7rem; }
    .a-panel-head > h2 { flex: 1 1 100%; }
    /* Wide, un-wrappable content (code blocks, tables) scrolls instead of
       forcing the whole page sideways. */
    .a-content pre, .a-content table { overflow-x: auto; display: block; max-width: 100%; }
    .a-content table { white-space: nowrap; }
    /* Buttons get a comfortable minimum height for thumbs */
    .btn { min-height: 40px; }
    /* Stat cards: two-up is cramped on the narrowest phones — one column reads better */
    .a-stat-row { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .a-main { padding-left: .8rem; padding-right: .8rem; }
}

.a-flashes { margin-bottom: 1rem; }

/* ============ Panels ============ */
.a-panel {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
    margin-bottom: 1.2rem;
}
.a-panel-narrow { max-width: 720px; }
.a-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem;
}
.a-panel-head h2 { margin: 0; }
.a-link { color: var(--brand-soft); font-size: .88rem; font-weight: 500; }

/* Stat cards */
.a-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.a-stat-card {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem 1.3rem;
    display: flex; flex-direction: column; gap: .4rem;
    position: relative; overflow: hidden;
}
.a-stat-card::after {
    content: ''; position: absolute; top: -50%; right: -10%; width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(74,124,255,.12), transparent 60%);
    pointer-events: none;
}
.a-stat-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.a-stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.a-stat-trend { font-size: .82rem; color: var(--brand-soft); font-weight: 500; }
.a-stat-trend.up::before { content: '↑ '; color: var(--success); }
.a-stat-trend.down { color: var(--muted); }
.a-stat-trend.down::before { content: '↓ '; color: var(--warn); }

.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.2rem; }
.a-grid-2 > * { min-width: 0; } /* wide children (pre, inputs) must not stretch the column */
@media (max-width: 900px) { .a-grid-2 { grid-template-columns: 1fr; } }

/* Fixed-height chart wrapper — Chart.js with maintainAspectRatio:false needs a
   sized parent, otherwise it grows the panel on every resize tick. */
.a-chart { position: relative; height: 280px; }

/* Lists */
.a-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.a-list li { padding: .8rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; }
.a-list li:last-child { border-bottom: 0; }
.a-list li > div:first-child { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.a-list li strong { color: var(--text); }
.a-list li .muted { font-size: .82rem; }
.a-list li time { font-size: .75rem; color: var(--muted-2); }
.a-list li p.trim { margin: 0; font-size: .88rem; }

.a-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.a-actions-grid-wide { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 500px) { .a-actions-grid { grid-template-columns: 1fr; } }

/* Activity feed */
.a-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.a-activity li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.a-activity li:last-child { border-bottom: 0; }
.a-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; position: relative; top: -1px; }
.a-activity li span { font-size: .9rem; color: var(--text); }
.a-activity li small { display: block; font-size: .75rem; color: var(--muted-2); margin-top: .1rem; }

/* Search boxes on list pages */
.a-search {
    background: rgba(255,255,255,.03); border: 1px solid var(--border-strong);
    color: var(--text); font: inherit; font-size: .88rem;
    padding: .45rem .75rem; border-radius: 9px; min-width: 200px;
}
.a-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,124,255,.18); }

/* Sidebar unread badge */
.a-nav-badge {
    margin-left: auto; font-style: normal; font-family: var(--mono);
    font-size: .68rem; font-weight: 600; color: #05070E;
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    border-radius: 999px; padding: .1rem .42rem; line-height: 1.4;
}

/* Maintenance banner */
.a-maint-banner {
    background: rgba(255,194,74,.12); border: 1px solid rgba(255,194,74,.4);
    color: #ffe1a3; border-radius: 10px; padding: .65rem 1rem;
    font-size: .88rem; margin-bottom: 1rem;
    max-width: 1560px; margin-inline: auto;
}
.a-maint-banner a { color: #ffe1a3; font-weight: 600; text-decoration: underline; }

/* Admin users page */
.a-user-list { display: flex; flex-direction: column; gap: .5rem; }
.a-user-row {
    display: flex; align-items: center; gap: .8rem;
    background: rgba(255,255,255,.02); border: 1px solid var(--border);
    border-radius: 12px; padding: .7rem .9rem;
}
.a-user-row-info { flex: 1; min-width: 0; }
.a-user-row-info strong { display: block; font-size: .92rem; }
.a-you {
    font-family: var(--mono); font-size: .62rem; font-weight: 600; text-transform: uppercase;
    color: var(--brand-soft); background: rgba(74,124,255,.14);
    padding: .12rem .4rem; border-radius: 5px; margin-left: .35rem; letter-spacing: .08em;
}
.a-reset-form { background: rgba(74,124,255,.05); border: 1px solid rgba(74,124,255,.25); border-radius: 12px; padding: .9rem 1rem; }
.a-invite-code {
    font-family: var(--mono); font-size: .95rem; font-weight: 600;
    letter-spacing: .18em; color: var(--brand-soft);
    background: rgba(74,124,255,.12); border: 1px solid rgba(74,124,255,.3);
    padding: .35rem .55rem .35rem .7rem; border-radius: 9px; flex-shrink: 0;
}
/* Invite rows: identity on the top line, actions wrap on their own line */
.a-invite-row { flex-direction: column; align-items: stretch; gap: .7rem; }
.a-invite-top { display: flex; align-items: center; gap: .8rem; min-width: 0; flex-wrap: wrap; }
.a-invite-top > .a-avatar { flex-shrink: 0; }
.a-invite-top .a-status-pill { flex-shrink: 0; }
/* long demo URLs must wrap instead of overflowing under the credential chip */
.a-invite-top .a-user-row-info { flex: 1 1 200px; }
.a-invite-top .a-user-row-info .muted,
.a-invite-top .a-user-row-info a { overflow-wrap: anywhere; word-break: break-word; }
.a-invite-actions { display: flex; align-items: center; gap: .5rem .6rem; flex-wrap: wrap; }
.a-invite-actions form { display: flex; align-items: center; gap: .4rem; }
.a-invite-email { flex: 1 1 230px; min-width: 0; }
.a-invite-email .a-search { flex: 1 1 140px; min-width: 0; max-width: 280px; }
.a-invite-email .btn { flex-shrink: 0; }
.a-invite-revoke { margin-left: auto; }

/* Client demos */
.a-demo-cred { letter-spacing: .04em; font-size: .78rem; }
.a-file-inline { max-width: 210px; font-size: .78rem; color: var(--muted); min-width: 0; }
.a-demo-edit { margin-top: .2rem; border-top: 1px dashed var(--border); padding-top: .55rem; }
.a-demo-edit > summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--brand-soft); list-style: none; }
.a-demo-edit > summary::-webkit-details-marker { display: none; }
.a-demo-edit[open] > summary { margin-bottom: .6rem; }
.a-demo-edit .a-form { gap: .6rem; }

/* Clients: chrome-free render when the detail view loads inside the modal iframe */
.admin-body.is-modal .a-sidebar,
.admin-body.is-modal .a-sidebar-backdrop,
.admin-body.is-modal .a-topbar,
.admin-body.is-modal .a-maint-banner,
.admin-body.is-modal .hub-back { display: none !important; }
.admin-body.is-modal .a-main { margin-left: 0; padding: 0; min-height: 0; }
.admin-body.is-modal .a-content { padding: 1.1rem 1.2rem 1.6rem; }
.admin-body.is-modal .a-flashes { margin: 0 0 1rem; }

/* Clients modal shell (holds the detail view in an iframe) */
.hub-modal[hidden] { display: none; }
.hub-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.hub-modal-backdrop { position: absolute; inset: 0; background: rgba(3,5,10,.66); backdrop-filter: blur(2px); }
.hub-modal-card {
    position: relative; width: min(940px, 100%); height: min(88vh, 940px);
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.55);
    overflow: hidden; display: flex; flex-direction: column;
}
.hub-modal-x {
    position: absolute; top: .6rem; right: .6rem; z-index: 2;
    width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid var(--border-strong); background: rgba(255,255,255,.06);
    color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1;
    display: grid; place-items: center;
}
.hub-modal-x:hover { background: rgba(255,255,255,.14); }
.hub-modal-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.hub-modal-open { overflow: hidden; }
@media (max-width: 640px) {
    .hub-modal { padding: 0; }
    .hub-modal-card { width: 100%; height: 100%; border-radius: 0; border: 0; }
}
/* On phones the credential chip drops onto its own full-width line so it can
   never sit on top of the demo link. */
@media (max-width: 640px) {
    .a-invite-top .a-demo-cred { flex-basis: 100%; order: 3; text-align: center; }
    .a-invite-actions,
    .a-invite-actions form,
    .a-invite-email { flex-basis: 100%; }
    .a-invite-email .a-search { max-width: none; }
    .a-invite-revoke { margin-left: 0; }
}

/* In-panel confirm dialog (replaces native confirm()) */
.a-confirm-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: rgba(5,7,14,.72); backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .18s ease;
}
.a-confirm-overlay.is-open { opacity: 1; }
.a-confirm-box {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border-strong); border-radius: 16px;
    padding: 1.4rem 1.5rem; width: min(430px, 100%);
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
    transform: translateY(10px) scale(.98); transition: transform .18s ease;
}
.a-confirm-overlay.is-open .a-confirm-box { transform: none; }
.a-confirm-box h3 { margin: 0 0 .45rem; font-size: 1.02rem; }
.a-confirm-box p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; white-space: pre-line; }
.a-confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
@media (prefers-reduced-motion: reduce) {
    .a-confirm-overlay, .a-confirm-box { transition: none; }
}
/* Prompt dialog (themed replacement for native prompt()) */
.a-prompt-label { display: block; font-size: .85rem; color: var(--muted); margin: .1rem 0 .4rem; }
.a-prompt-input { width: 100%; background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); border-radius: 10px; padding: .65rem .8rem; font: inherit; }
.a-prompt-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,147,132,.18); }
.a-prompt-box h3 { margin-bottom: .7rem; }

.a-action {
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    border-radius: 12px; padding: .9rem 1rem; color: var(--text); font-weight: 500;
    display: flex; align-items: center; gap: .8rem;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.a-action:hover { border-color: rgba(74,124,255,.4); background: rgba(74,124,255,.06); transform: translateY(-1px); }
.a-action span { font-size: 1.4rem; }

/* ============ Forms ============ */
.a-form { display: flex; flex-direction: column; gap: 1rem; }
.a-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .a-form-row { grid-template-columns: 1fr; } }
.a-form label { display: grid; gap: .35rem; }
.a-form label span, .a-field-label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.a-form input, .a-form textarea, .a-form select {
    background: rgba(255,255,255,.03); border: 1px solid var(--border-strong);
    color: var(--text); font: inherit; padding: .7rem .85rem; border-radius: 10px;
    width: 100%;
    transition: border-color .18s ease, background .18s ease;
}
.a-form input:focus, .a-form textarea:focus, .a-form select:focus {
    outline: none; border-color: var(--brand); background: rgba(74,124,255,.05);
    box-shadow: 0 0 0 3px rgba(74,124,255,.18);
}
.a-form input:disabled { opacity: .55; }
.a-form input[type="file"]::file-selector-button {
    background: rgba(255,255,255,.06); border: 1px solid var(--border-strong);
    color: var(--text); font: inherit; font-size: .85rem;
    padding: .4rem .8rem; border-radius: 8px; margin-right: .8rem; cursor: pointer;
}
.a-form textarea { resize: vertical; min-height: 100px; font-family: inherit; }
/* Sticky save bar: pins to the bottom of the viewport while a form is taller
   than the screen (Save stays reachable as you scroll), then settles at the end
   of the form when you reach it. NO solid fill — a solid --bg band read as a
   dark "box" over the lighter panels. Instead it's transparent with a soft
   backdrop-blur so scrolling content stays legible under the floating buttons
   without ever showing a coloured rectangle. */
.a-form-actions {
    position: sticky; bottom: 0; z-index: 6;
    display: flex; gap: .6rem; justify-content: flex-end; align-items: center; flex-wrap: wrap;
    margin-top: .8rem; padding: .7rem 0;
    border-top: 1px solid var(--border);
    background: transparent;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .a-form-actions { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.a-form-actions.left { justify-content: flex-start; }
/* Native dropdown lists: the open <option> list ignores the styled control, so
   give options an explicit dark background + light text. Without this some
   OS/browser combos paint light-on-light (or dark-on-dark) unreadable menus. */
select { color-scheme: dark; }
select option, select optgroup {
    background-color: var(--panel);
    color: var(--text);
}
select option:disabled { color: var(--muted-2); }

/* Client Access: WebR support public key block */
.a-support-key {
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    border-radius: 10px; padding: .8rem .9rem; margin: 0;
    font-family: var(--mono); font-size: .72rem; line-height: 1.5;
    color: var(--muted); white-space: pre-wrap; word-break: break-all;
    overflow-wrap: anywhere; /* break-all alone doesn't shrink min-content width */
}

/* .a-form label sets display:grid — the extra selector keeps checkboxes inline */
.a-checkbox, .a-form label.a-checkbox { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; cursor: pointer; }
.a-checkbox input { width: auto; margin: 0; accent-color: var(--brand); }

/* ============ Content Editor ============ */
.a-editor-tabs {
    display: flex; flex-wrap: wrap; gap: .25rem;
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 14px;
    padding: .45rem; margin-bottom: 1.2rem;
    position: sticky; top: var(--topbar-h, 0px); z-index: 6;
    box-shadow: 0 10px 30px -18px rgba(0,0,0,.8);
}
.a-editor-tabs a {
    padding: .5rem .95rem; border-radius: 9px; color: var(--muted);
    font-size: .9rem; font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.a-editor-tabs a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.a-editor-tabs a.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    color: #05070E; font-weight: 600;
    box-shadow: 0 6px 16px -8px rgba(74,124,255,.8);
}

.a-editor-panel {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px;
    padding: 0 1.5rem 1.5rem;
}
.a-section-header {
    position: sticky; top: calc(var(--topbar-h, 0px) + var(--tabs-h, 0px)); z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    background: rgba(16,21,42,.92); backdrop-filter: blur(10px);
    margin: 0 -1.5rem 1.2rem; padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
}
.a-section-header h2 { margin: 0; }
.a-section-header p { margin: 0; color: var(--muted); font-size: .85rem; }

/* ============ Mobile admin ergonomics ============ */
@media (max-width: 700px) {
    /* Only the topbar stays pinned on phones. The editor's tab bar + section
       header STOP being sticky so three bars don't stack and bury the fields
       you're trying to edit — they scroll away like normal content. */
    .a-editor-tabs {
        position: static;
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; margin-bottom: .8rem;
    }
    .a-editor-tabs::-webkit-scrollbar { display: none; }
    .a-editor-tabs a { white-space: nowrap; }
    .a-section-header {
        position: static;
        margin: 0 -1.1rem 1rem; padding: .85rem 1.1rem;
        background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .a-section-header h2 { font-size: 1.15rem; }
    .a-editor-panel { padding: 0 1.1rem 1.1rem; }
    .a-panel { padding: 1.1rem; }
    /* Bottom save bar: full-width thumb-reachable button(s) */
    .a-form-actions { justify-content: center; }
    .a-form-actions .btn { flex: 1 1 auto; }
    /* Section titles a touch smaller so more content is visible */
    .a-panel-head h2, .a-collection h2 { font-size: 1.2rem; }

    /* PIN the primary Save bar to the very bottom of the SCREEN on phones. sticky
       bottom:0 is clamped to its form/panel (so it rides up once you scroll past
       the form) and iOS momentum-scroll drifts it — fixed + solid + full-bleed
       keeps it glued to the bottom. Scoped to single-primary-form pages so the
       multi-form pages (invoices, account) never show two overlapping bars. */
    body[data-page="content"] .a-form-actions,
    body[data-page="settings"] .a-form-actions,
    body[data-page="services"] .a-form-actions,
    body[data-page="portfolio"] .a-form-actions,
    body[data-page="blog"] .a-form-actions,
    body[data-page="expenses"] .a-form-actions {
        position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 35;
        padding: .6rem clamp(.8rem, 3vw, 1.4rem);
        background: var(--bg); border-top: 1px solid var(--border);
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    body[data-page="content"] .a-form-actions .btn,
    body[data-page="settings"] .a-form-actions .btn,
    body[data-page="services"] .a-form-actions .btn,
    body[data-page="portfolio"] .a-form-actions .btn,
    body[data-page="blog"] .a-form-actions .btn,
    body[data-page="expenses"] .a-form-actions .btn { flex: 1 1 auto; max-width: 520px; }
    /* clearance so the last field isn't hidden behind the pinned bar */
    body[data-page="content"] .a-main,
    body[data-page="settings"] .a-main,
    body[data-page="services"] .a-main,
    body[data-page="portfolio"] .a-main,
    body[data-page="blog"] .a-main,
    body[data-page="expenses"] .a-main { padding-bottom: 5rem; }
}

/* Jump bar: one numbered chip per group, in page order */
.a-jump { display: flex; flex-wrap: wrap; gap: .35rem; width: 100%; padding-top: .7rem; border-top: 1px solid var(--border); }
.a-jump a {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 500; color: var(--muted);
    padding: .3rem .65rem .3rem .45rem; border-radius: 999px;
    border: 1px solid var(--border);
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.a-jump a b { font-family: var(--mono); font-weight: 600; font-size: .68rem; color: var(--brand-soft); background: rgba(74,124,255,.12); border-radius: 999px; width: 18px; height: 18px; display: grid; place-items: center; }
.a-jump a:hover { color: var(--text); border-color: var(--border-strong); }
.a-jump a.is-active { background: rgba(74,124,255,.14); border-color: rgba(74,124,255,.4); color: var(--text); }
.a-jump a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.a-fieldset { padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.a-fieldset:last-child { border-bottom: 0; }
.a-fieldset > .a-fieldset-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 600; margin-bottom: .8rem; }

/* Collapsible editor groups — numbered in the page's own top-to-bottom order */
.a-group {
    border: 1px solid var(--border); border-radius: 14px;
    background: rgba(255,255,255,.015);
    padding: 0 1.1rem; margin-bottom: 1rem;
    scroll-margin-top: 150px;
    transition: border-color .2s ease;
}
.a-group[open] { padding-bottom: 1.15rem; border-color: rgba(74,124,255,.22); }
.a-group > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: .75rem;
    margin: 0 -1.1rem; padding: .9rem 1.1rem;
}
.a-group > summary::-webkit-details-marker { display: none; }
.a-group > summary::after {
    content: '▾'; color: var(--muted-2); font-size: .85rem;
    transition: transform .18s ease;
}
.a-group:not([open]) > summary::after { transform: rotate(-90deg); }
.a-group[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 1.15rem; }
.a-group > summary:hover .a-group-name { color: var(--brand-soft); }
.a-group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 12px; }
.a-group-num {
    font-family: var(--mono); font-size: .7rem; font-weight: 600;
    color: var(--brand-soft); background: rgba(74,124,255,.12);
    border: 1px solid rgba(74,124,255,.28);
    padding: .18rem .42rem; border-radius: 6px; line-height: 1;
}
.a-group-name { font-size: .98rem; font-weight: 650; color: var(--text); letter-spacing: -.01em; transition: color .15s ease; }
.a-group-meta { margin-left: auto; font-size: .75rem; color: var(--muted-2); white-space: nowrap; }

.a-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem 1rem; }
.a-fields label.is-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .a-fields { grid-template-columns: 1fr; } }

.a-subhead { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 600; margin: 1.2rem 0 .2rem; }
.a-dirty-note { color: var(--warn); font-size: .8rem; margin-right: auto; }

/* Per-group live preview: a tiny browser window, unmistakably "the website" */
.a-group-cols { display: flex; flex-direction: column; gap: 1.1rem; }
.a-group-fields { min-width: 0; }
.a-group-preview { min-width: 0; }
.a-chrome {
    display: flex; align-items: center; gap: .6rem;
    background: #080B16; border: 1px solid var(--border); border-bottom: 0;
    border-radius: 10px 10px 0 0; padding: .5rem .75rem;
}
.a-chrome-dots { display: inline-flex; gap: 5px; flex-shrink: 0; }
.a-chrome-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.a-chrome-url {
    font-family: var(--mono); font-size: .72rem; font-weight: 500;
    color: var(--muted-2); letter-spacing: .02em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.a-mini-stage {
    position: relative; border: 1px solid var(--border); border-radius: 0 0 10px 10px;
    background: var(--bg); overflow: hidden; overflow-y: auto;
    max-height: min(62vh, 540px); min-height: 120px;
}
.a-mini-frame { border: 0; display: block; background: var(--bg); transform-origin: top left; }

/* First chrome dot blinks while a preview refresh is in flight */
@media (prefers-reduced-motion: no-preference) {
    .a-editor.is-updating .a-chrome-dots i:first-child { background: var(--brand); animation: webr-blink 1s ease infinite; }
    @keyframes webr-blink { 50% { opacity: .3; } }
}

/* Flash a field after jumping to it from a preview click */
.a-form label.is-flash input,
.a-form label.is-flash textarea,
.a-form label.is-flash select { border-color: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
    @keyframes webr-field-flash {
        0%, 100% { box-shadow: 0 0 0 0 rgba(74,124,255,0); }
        30% { box-shadow: 0 0 0 4px rgba(74,124,255,.45); }
    }
    .a-form label.is-flash input,
    .a-form label.is-flash textarea,
    .a-form label.is-flash select { animation: webr-field-flash 1.2s ease; }
}

/* Unsaved state: amber note in the header + a dot on every Save button */
.a-form button[type="submit"].is-dirty::after {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--warn); display: inline-block; margin-left: .1rem;
}
.a-editor.is-previews-hidden .a-group-preview,
.a-editor.is-previews-hidden .a-editor-full-preview { display: none; }

/* Full page preview at the bottom */
.a-editor-full-preview {
    margin-top: 1.2rem;
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column;
}
.a-editor-preview-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border);
}
.a-editor-preview-head h2 { margin: 0 0 .15rem; }
.a-editor-preview-head p { margin: 0; font-size: .85rem; }
.a-preview-live-pill {
    display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0;
    font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--brand-soft); background: rgba(74,124,255,.12);
    border: 1px solid rgba(74,124,255,.3); border-radius: 999px; padding: .3rem .7rem;
}
.a-preview-live-pill::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand); box-shadow: 0 0 0 0 rgba(74,124,255,.6);
}
@media (prefers-reduced-motion: no-preference) {
    .a-preview-live-pill::before { animation: dot-pulse-soft 2s ease-out infinite; }
    @keyframes dot-pulse-soft { 0%{box-shadow:0 0 0 0 rgba(74,124,255,.55);} 70%{box-shadow:0 0 0 8px rgba(74,124,255,0);} 100%{box-shadow:0 0 0 0 rgba(74,124,255,0);} }
}
.a-editor-preview-bar {
    display: flex; align-items: center; gap: .7rem;
    padding: .65rem .9rem; border-bottom: 1px solid var(--border);
    background: #080B16;
}
.a-editor-preview-bar .a-link { font-size: .78rem; white-space: nowrap; }
.a-preview-status { font-size: .75rem; color: var(--brand-soft); }
.a-editor-preview-bar .a-preview-devices { margin-left: auto; }
.a-editor-preview-bar .a-preview-devices button { padding: .3rem .6rem; font-size: .75rem; }
.a-editor-preview-stage { position: relative; height: 78vh; min-height: 420px; overflow: hidden; background: var(--bg); }
.a-editor-preview-stage iframe { border: 0; display: block; background: var(--bg); transform-origin: top left; }

@media (max-width: 1000px) {
    .a-editor-preview-stage { height: 70vh; min-height: 320px; }
}

/* Repeater: numbered cards in display order */
.a-repeater { display: flex; flex-direction: column; gap: .8rem; margin-top: .6rem; }
.a-repeater:empty::before {
    content: 'Nothing here yet — add the first one below.';
    color: var(--muted-2); font-size: .85rem; padding: .4rem 0;
}
.a-repeater-item {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(74,124,255,.35);
    border-radius: 12px; padding: .8rem 1rem 1rem;
    display: grid; gap: .8rem;
    transition: border-color .15s ease;
}
.a-repeater-item:hover { border-color: var(--border-strong); border-left-color: rgba(74,124,255,.6); }
.a-repeater-head { display: flex; align-items: center; gap: .5rem; }
.a-drag { cursor: grab; color: var(--muted-2); font-size: .95rem; padding: 0 .15rem; user-select: none; }
.a-drag:hover { color: var(--text); }
.a-repeater-item.is-dragging { opacity: .45; border-style: dashed; border-color: var(--brand); }
.a-repeater-tools { display: flex; align-items: center; gap: .05rem; margin-left: auto; }
.a-repeater-tools button {
    background: transparent; border: 0; color: var(--muted-2); cursor: pointer;
    padding: .25rem .45rem; border-radius: 6px; font-size: .8rem; font-family: inherit;
    opacity: .5; transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.a-repeater-item:hover .a-repeater-tools button, .a-repeater-tools button:focus-visible { opacity: 1; }
.a-repeater-tools button:hover { background: rgba(255,255,255,.07); color: var(--text); }
.a-repeater-tools .a-repeater-del:hover { background: rgba(255,107,122,.14); color: var(--danger); }
.a-repeater-idx {
    font-family: var(--mono); font-size: .78rem; font-weight: 600;
    color: var(--brand-soft); background: rgba(74,124,255,.12);
    width: 24px; height: 24px; border-radius: 7px;
    display: grid; place-items: center;
}
.a-repeater-del {
    background: transparent; border: 0; color: var(--muted-2); cursor: pointer;
    padding: .3rem .55rem; border-radius: 6px; font-size: .78rem; font-family: inherit;
    opacity: .55; transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.a-repeater-item:hover .a-repeater-del, .a-repeater-del:focus-visible { opacity: 1; }
.a-repeater-del:hover { background: rgba(255,107,122,.14); color: var(--danger); }
.a-add-btn {
    display: block; width: 100%; text-align: center;
    background: transparent; border: 1px dashed var(--border-strong);
    color: var(--muted); padding: .65rem 1rem; border-radius: 10px; cursor: pointer; font: inherit;
    font-size: .88rem; font-weight: 500; margin-top: .8rem;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.a-add-btn:hover { border-color: var(--brand); color: var(--brand-soft); background: rgba(74,124,255,.05); }
.a-add-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ Media ============ */
.a-media-drop {
    display: block;
    border: 2px dashed var(--border-strong); border-radius: 16px;
    padding: 2rem; text-align: center; color: var(--muted);
    background: rgba(255,255,255,.02);
    transition: border-color .18s ease, background .18s ease;
    cursor: pointer;
}
.a-media-drop.is-drag { border-color: var(--brand); background: rgba(74,124,255,.05); color: var(--text); }
.a-media-drop input { display: none; }
.a-media-grid { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.a-media-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; position: relative; }
.a-media-card .thumb { aspect-ratio: 1/1; background: #000; display: grid; place-items: center; overflow: hidden; border-radius: 12px 12px 0 0; }
.a-media-card img { width: 100%; height: 100%; object-fit: cover; }
.a-media-card .meta { padding: .6rem .7rem; }
.a-media-card .meta strong { display: block; font-size: .78rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-media-card .meta span { font-size: .7rem; color: var(--muted-2); }
.a-usage-badge {
    position: absolute; top: .5rem; left: .5rem;
    font-family: var(--mono); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: #05070E; background: linear-gradient(135deg, var(--success), #8af0bb);
    padding: .18rem .45rem; border-radius: 6px;
}
.a-media-card .thumb { position: relative; }
.a-usage-list { display: flex; flex-direction: column; gap: .25rem; padding: 0 .7rem .65rem; }
.a-usage-chip {
    display: flex; align-items: center; justify-content: space-between; gap: .4rem;
    font-size: .7rem; font-weight: 500; color: var(--muted);
    background: rgba(74,124,255,.07); border: 1px solid rgba(74,124,255,.2);
    border-radius: 7px; padding: .28rem .5rem;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
    overflow: hidden;
}
.a-usage-chip:hover { color: var(--brand-soft); border-color: rgba(74,124,255,.55); background: rgba(74,124,255,.12); }
.a-usage-chip b { font-weight: 600; flex-shrink: 0; }
.a-usage-none { font-size: .7rem; color: var(--muted-2); font-style: italic; padding: .1rem 0; }
/* One small "⋯" button on the thumbnail; clicking it (or the image) opens a
   tidy dropdown of actions, so buttons no longer overlap on small cards. */
.a-media-card .thumb { cursor: pointer; }
.a-media-actions { position: absolute; top: .5rem; right: .5rem; z-index: 5; }
.a-media-menu-btn {
    background: rgba(0,0,0,.62); backdrop-filter: blur(6px); color: #fff;
    border: 0; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
    font-size: 1rem; line-height: 1; font-family: inherit; opacity: 0; transition: opacity .18s ease;
    display: grid; place-items: center;
}
.a-media-card:hover .a-media-menu-btn, .a-media-menu-btn[aria-expanded="true"] { opacity: 1; }
.a-media-menu-btn:hover, .a-media-menu-btn[aria-expanded="true"] { background: var(--brand); }
.a-media-menu {
    position: absolute; top: calc(100% + 4px); right: 0; min-width: 168px; z-index: 20;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: .3rem; display: flex; flex-direction: column; gap: 1px;
}
.a-media-menu[hidden] { display: none; }
.a-media-menu > a, .a-media-menu button {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    color: var(--text); font-family: inherit; font-size: .8rem; cursor: pointer;
    padding: .5rem .6rem; border-radius: 6px; text-decoration: none;
}
.a-media-menu > a:hover, .a-media-menu button:hover { background: var(--panel-2); }
.a-media-menu form { margin: 0; }
.a-media-menu button.is-danger { color: #ff8592; }
.a-media-menu button.is-danger:hover { background: rgba(255,107,122,.15); }

/* Email design — code editor */
.a-email-adv > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }
.a-email-ph { display: block; margin: .4rem 0; }
.a-email-ph code { display: inline-block; margin: 0 .2rem .2rem 0; }
textarea.a-code {
    width: 100%; font-family: var(--mono); font-size: .82rem; line-height: 1.5;
    background: #0b0f1c; color: #cdd6f4; border: 1px solid var(--border-strong);
    border-radius: 10px; padding: .7rem .8rem; white-space: pre; overflow: auto; tab-size: 2;
}
code { background: rgba(255,255,255,.06); padding: .05rem .3rem; border-radius: 4px; font-size: .85em; }

/* Expenses tab */
.a-exp-totals { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.a-exp-tot { flex: 1; min-width: 120px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; }
.a-exp-tot span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.a-exp-tot b { font-size: 1.4rem; }
.a-exp-receipt-cur { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.a-exp-receipt-cur img { max-height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.a-exp-list { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.a-exp-row { display: flex; align-items: center; gap: .8rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .7rem; }
.a-exp-rc { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; background: #000; border-radius: 8px; overflow: hidden; }
.a-exp-rc img { width: 100%; height: 100%; object-fit: cover; }
.a-exp-rc a { display: grid; place-items: center; width: 100%; height: 100%; text-decoration: none; font-size: 1.2rem; }
.a-exp-norc { color: var(--muted-2); }
.a-exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-exp-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-exp-amt { font-weight: 700; font-family: var(--mono); white-space: nowrap; }
.a-exp-actions { display: flex; gap: .3rem; flex-shrink: 0; }
@media (max-width: 640px) {
    .a-exp-row { flex-wrap: wrap; }
    .a-exp-main { flex-basis: calc(100% - 60px); }
    .a-exp-amt, .a-exp-actions { margin-left: 52px; }
}
/* Media Library — receipts folder view */
.a-mediafolder { margin-top: 1.4rem; }
.a-mediafolder > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }
.a-mediafolder-year { margin: .6rem 0; }
.a-mediafolder-year h4 { margin: .4rem 0; font-size: .8rem; color: var(--muted); }
.a-mediafolder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.a-mediafolder-grid a { display: block; aspect-ratio: 1; background: #000; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.a-mediafolder-grid img { width: 100%; height: 100%; object-fit: cover; }
.a-mediafolder-grid .doc { display: grid; place-items: center; color: var(--muted); font-size: .7rem; height: 100%; }

/* Client Guides tab */
.a-cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; margin-top: 1rem; }
.a-cg-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.a-cg-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.a-cg-card p { margin: 0 0 .7rem; }
.a-cg-card .a-row { gap: .4rem; }
.a-cg-checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* Portfolio "Retake screenshot" control (live-shot cache buster) */
.a-shot-refresh { display: block; }
.a-shot-refresh .js-retake-shot:disabled { opacity: .8; cursor: default; }

/* Focused collection tabs (Services / Portfolio) — a simpler, single-list editor */
.a-collection .a-collection-count {
    display: inline-block; min-width: 1.4em; text-align: center;
    font-size: .7rem; font-family: var(--mono); vertical-align: middle;
    background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
    border-radius: 999px; padding: .05rem .5rem; margin-left: .35rem;
}
.a-collection-toolbar {
    display: flex; align-items: center; justify-content: flex-end; gap: .6rem;
    margin-bottom: .8rem;
}
.a-collection-form .a-subhead { font-size: 1rem; }
.a-collection-form .a-repeater-item { background: var(--panel); }

/* ============ Preview ============ */
.a-preview-bar {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    padding: .6rem .8rem; margin-bottom: 1rem;
}
.a-preview-bar > label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; }
.a-preview-bar select, .a-preview-bar input {
    background: rgba(255,255,255,.04); border: 1px solid var(--border-strong);
    color: var(--text); font: inherit; padding: .4rem .6rem; border-radius: 8px;
}
.a-preview-devices { display: flex; gap: .3rem; margin-left: auto; }
.a-preview-devices button {
    background: transparent; border: 1px solid var(--border-strong); color: var(--muted);
    padding: .4rem .8rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .82rem;
}
.a-preview-devices button.is-active { border-color: var(--brand); color: var(--text); background: rgba(74,124,255,.14); }

.a-preview-stage {
    background: linear-gradient(180deg, var(--panel-2), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px;
    padding: 1.5rem; display: grid; place-items: center;
    min-height: 60vh; overflow: auto;
}
.a-device-frame {
    background: #000; border-radius: 22px; border: 8px solid #1c223d;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,.6);
    display: grid; place-items: stretch;
    overflow: hidden;
    transition: width .25s ease, height .25s ease, transform .25s ease;
}
.a-device-frame iframe {
    width: 100%; height: 100%; border: 0; background: var(--bg);
    display: block;
}

/* ============ Recorder ============ */
.a-recorder-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; }
@media (max-width: 1100px) { .a-recorder-grid { grid-template-columns: 1fr; } }
.a-recorder-stage {
    background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
    aspect-ratio: 16/9;
    display: grid; place-items: center;
    position: relative;
}
.a-recorder-stage video, .a-recorder-stage canvas { width: 100%; height: 100%; object-fit: contain; background: #000; }
.a-recorder-status {
    position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.65); backdrop-filter: blur(6px); color: var(--text);
    padding: .4rem .9rem; border-radius: 999px; font-size: .8rem; white-space: nowrap;
}
.a-tour-list li label.a-checkbox { font-size: .88rem; }
.a-recorder-stage .placeholder { color: var(--muted); text-align: center; padding: 2rem; }
.a-recorder-dot {
    position: absolute; top: 1rem; left: 1rem; display: none; align-items: center; gap: .5rem;
    background: rgba(0,0,0,.6); backdrop-filter: blur(6px); padding: .35rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.a-recorder-dot.is-live { display: inline-flex; }
.a-recorder-dot::before { content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 0 rgba(255,107,122,.7); animation: dot-pulse 1.4s ease-out infinite; }
@keyframes dot-pulse { 0%{box-shadow:0 0 0 0 rgba(255,107,122,.7);} 70%{box-shadow:0 0 0 12px rgba(255,107,122,0);} 100%{box-shadow:0 0 0 0 rgba(255,107,122,0);} }
.a-timer { position: absolute; top: 1rem; right: 1rem; font-family: 'JetBrains Mono', ui-monospace, monospace; background: rgba(0,0,0,.6); padding: .3rem .7rem; border-radius: 999px; font-size: .82rem; }
.a-recorder-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.a-tour-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 320px; overflow-y: auto; }
.a-tour-list li { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.a-tour-list button { margin-left: auto; background: transparent; border: 0; color: var(--muted-2); cursor: pointer; font-size: .8rem; }
.a-tour-list button:hover { color: var(--danger); }

/* ============ Preview iframe helper ============ */
.a-scale-wrap { transform-origin: top center; }

/* Utility */
.a-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.a-spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.a-help { color: var(--muted-2); font-size: .78rem; margin: .2rem 0 0; }
.a-color { display: flex; align-items: center; gap: .5rem; }
.a-color input[type="color"] { width: 44px; height: 36px; border-radius: 8px; padding: 0; background: transparent; border: 1px solid var(--border-strong); }
.a-color input[type="text"] { flex: 1; }

/* Visual icon picker */
.a-iconpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .4rem; }
.a-iconpick-opt {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; padding: .5rem; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--muted-2);
    transition: background .12s, border-color .12s, color .12s, transform .06s;
}
.a-iconpick-opt:hover { background: rgba(74,124,255,.1); color: var(--text); border-color: var(--border-strong); }
.a-iconpick-opt:active { transform: scale(.94); }
.a-iconpick-opt svg { width: 22px; height: 22px; }
.a-iconpick-opt.is-active { background: rgba(74,124,255,.18); border-color: var(--brand); color: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ============ Blog ============ */
.a-status-pill { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; padding: .18rem .45rem; border-radius: 5px; font-weight: 600; flex-shrink: 0; }
.a-status-pub { background: rgba(75,214,138,.16); color: #a5f0c4; }
.a-status-draft { background: rgba(255,194,74,.16); color: #ffe1a3; }

/* Post list */
.a-post-list { display: flex; flex-direction: column; gap: .6rem; }
.a-post-card {
    display: flex; align-items: center; gap: 1rem;
    background: rgba(255,255,255,.02); border: 1px solid var(--border);
    border-radius: 12px; padding: .9rem 1.1rem; color: var(--text);
    transition: border-color .16s ease, background .16s ease;
}
.a-post-card:hover { border-color: rgba(74,124,255,.45); background: rgba(74,124,255,.04); }
.a-post-card-cover { width: 72px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.a-post-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.a-post-card-main { flex: 1; min-width: 0; }
.a-post-card-main strong { display: block; font-size: .98rem; }
.a-post-card-main em { display: block; font-style: normal; color: var(--muted); font-size: .84rem; margin: .15rem 0 .2rem; }
.a-post-card-main small { color: var(--muted-2); font-size: .74rem; }

/* Post editor shell */
.a-post-editor {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--border); border-radius: 16px;
    padding: 1.4rem 1.6rem 1.6rem;
    max-width: 1180px; margin-inline: auto;
}
.a-post-topbar { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }
.a-post-footer-actions { justify-content: flex-end; margin-top: .8rem; }

.a-restore-bar {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    background: rgba(255,194,74,.1); border: 1px solid rgba(255,194,74,.35);
    color: #ffe1a3; border-radius: 10px; padding: .55rem .9rem;
    font-size: .85rem; margin-bottom: 1rem;
}

/* Big borderless title + slug line */
.a-form input.a-post-title {
    background: transparent; border: 0; box-shadow: none; border-radius: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em;
    padding: .1rem 0; width: 100%;
}
.a-form input.a-post-title:focus { outline: none; border: 0; box-shadow: none; background: transparent; }
.a-form input.a-post-title::placeholder { color: var(--muted-2); }
.a-slug-row {
    display: flex; align-items: center;
    font-family: var(--mono); font-size: .78rem; color: var(--muted-2);
    margin: 0 0 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem;
}
.a-form .a-slug-row input {
    background: transparent; border: 0; box-shadow: none; border-radius: 4px;
    font: inherit; color: var(--brand-soft); padding: .1rem .25rem; width: 100%;
}
.a-form .a-slug-row input:focus { outline: none; background: rgba(74,124,255,.08); box-shadow: none; }

/* Toolbar + modes + counters */
.a-write-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: .6rem; }
.a-md-toolbar { display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; }
.a-md-toolbar button {
    background: transparent; border: 1px solid transparent; color: var(--muted);
    padding: .32rem .55rem; border-radius: 7px; cursor: pointer;
    font-family: var(--mono); font-size: .78rem; font-weight: 600;
    transition: background .12s ease, color .12s ease;
}
.a-md-toolbar button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.a-md-sep { width: 1px; height: 16px; background: var(--border-strong); margin: 0 .35rem; }
.a-write-count { font-family: var(--mono); font-size: .7rem; color: var(--muted-2); white-space: nowrap; }

/* The document — the editor looks like the post itself */
.a-doc {
    max-width: 800px; margin: 0 auto 1.2rem;
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008));
    border: 1px solid var(--border-strong); border-radius: 18px;
    padding: 2rem clamp(1.2rem, 4.5vw, 3.2rem) 2.2rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.a-doc-cover { margin: 0 0 1.5rem; }
.a-doc-cover img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); display: block; }
.a-form input.a-doc-title {
    background: transparent; border: 0; box-shadow: none; border-radius: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 800; letter-spacing: -.02em;
    padding: .1rem 0; width: 100%; color: var(--text);
}
.a-form input.a-doc-title:focus { outline: none; box-shadow: inset 0 -2px 0 rgba(74,124,255,.45); background: transparent; }
.a-form input.a-doc-title::placeholder { color: var(--muted-2); opacity: .8; }
.a-doc-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
    color: var(--muted-2); font-size: .82rem;
    margin: .35rem 0 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.a-doc-meta .a-slug-row { margin: 0 0 0 auto; border: 0; padding: 0; }
.a-doc-meta .a-slug-row input { width: 16ch; }
.a-form .a-doc-meta input.a-doc-author,
.a-form .a-doc-meta input.a-doc-date {
    background: transparent; border: 0; box-shadow: none; border-radius: 6px;
    font: inherit; color: var(--muted); padding: .15rem .3rem; width: auto;
    border-bottom: 1px dashed transparent; cursor: pointer;
    color-scheme: dark;
}
.a-form .a-doc-meta input.a-doc-author { width: 15ch; }
.a-form .a-doc-meta input.a-doc-date { width: 12ch; }
.a-form .a-doc-meta input.a-doc-author:hover,
.a-form .a-doc-meta input.a-doc-date:hover { border-bottom-color: var(--border-strong); color: var(--text); }
.a-form .a-doc-meta input.a-doc-author:focus,
.a-form .a-doc-meta input.a-doc-date:focus {
    outline: none; background: rgba(74,124,255,.08); color: var(--text); cursor: text;
    box-shadow: none;
}

/* Sections: click to edit, hover for tools */
.a-doc-blocks { display: flex; flex-direction: column; gap: .3rem; }
.a-block { position: relative; border-radius: 10px; padding: .4rem .8rem; margin: 0 -.8rem; transition: background .12s ease; }
.a-block:hover { background: rgba(74,124,255,.05); }
.a-block.is-editing { background: rgba(74,124,255,.07); outline: 1px solid rgba(74,124,255,.35); }
.a-block-view { cursor: pointer; min-height: 1.3em; }
.a-block-view > :last-child { margin-bottom: 0 !important; }
.a-block-placeholder { color: var(--muted-2); font-style: italic; margin: 0; }
.a-block-tools {
    display: flex; gap: .1rem; margin-top: .4rem; width: fit-content;
    background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: 8px; padding: .12rem;
}
.a-block-tools button {
    background: transparent; border: 0; color: var(--muted); cursor: pointer;
    font-size: .78rem; line-height: 1; padding: .32rem .42rem; border-radius: 6px;
}
.a-block-tools button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.a-block-tools .a-blk-del:hover { color: #ff8d8d; }
.a-blk-drag { cursor: grab; }
.a-block.is-dragging { opacity: .45; outline: 1px dashed rgba(74,124,255,.5); }
.a-form .a-block-edit {
    width: 100%; background: rgba(8,11,22,.65); border: 1px solid rgba(74,124,255,.3); border-radius: 8px;
    color: var(--text); font-family: var(--mono); font-size: .88rem; line-height: 1.7;
    padding: .6rem .8rem; resize: none; outline: 0; overflow: hidden; min-height: 2.6em;
}

/* Add-a-section */
.a-doc-add { margin-top: 1.5rem; }
.a-add-btn {
    width: 100%; background: transparent; border: 1px dashed var(--border-strong); border-radius: 10px;
    color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; padding: .75rem; cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.a-add-btn:hover { border-color: rgba(74,124,255,.55); color: var(--text); background: rgba(74,124,255,.05); }
.a-block-menu { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; justify-content: center; }
.a-block-menu button {
    background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 8px;
    color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; padding: .45rem .75rem; cursor: pointer;
}
.a-block-menu button:hover { background: rgba(74,124,255,.15); color: var(--text); border-color: rgba(74,124,255,.4); }

.a-md-preview-body { font-size: .92rem; line-height: 1.7; color: var(--muted); }
.a-md-preview-body h2, .a-md-preview-body h3, .a-md-preview-body h4 { color: var(--text); margin: 1.1em 0 .4em; }
.a-md-preview-body strong { color: var(--text); }
.a-md-preview-body a { color: var(--brand-soft); text-decoration: underline; }
.a-md-preview-body ul, .a-md-preview-body ol { padding-left: 1.4rem; margin: 0 0 1em; }
.a-md-preview-body li { margin-bottom: .3rem; }
.a-md-preview-body code { background: rgba(255,255,255,.07); padding: .1em .35em; border-radius: 5px; font-family: var(--mono); font-size: .85em; }
.a-md-preview-body blockquote {
    border-left: 3px solid var(--brand); background: rgba(74,124,255,.06);
    margin: 0 0 1em; padding: .5rem 1rem; border-radius: 0 8px 8px 0;
}
.a-md-preview-body blockquote p { margin: 0; color: var(--text); }
.a-md-preview-body hr { border: 0; border-top: 1px solid var(--border-strong); margin: 1.4rem 0; }
.a-md-preview-body pre {
    background: #080B16; border: 1px solid var(--border); border-radius: 10px;
    padding: .9rem 1rem; overflow-x: auto; margin: 0 0 1em;
}
.a-md-preview-body pre code { background: none; padding: 0; display: block; line-height: 1.6; }
.a-md-preview-body img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: .4rem 0 1em; }

/* Markdown cheatsheet under the writing area */
.a-md-cheatsheet { margin: -.4rem 0 1.2rem; }
.a-md-cheatsheet summary { cursor: pointer; color: var(--muted-2); font-size: .78rem; user-select: none; }
.a-md-cheatsheet summary:hover { color: var(--muted); }
.a-cheat-grid { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .6rem; }
.a-cheat-grid code {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    padding: .28rem .55rem; border-radius: 7px;
    font-family: var(--mono); font-size: .72rem; color: var(--muted);
}

/* Tag chips */
.a-chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    padding: .4rem .5rem; margin-top: .35rem;
    background: rgba(255,255,255,.03); border: 1px solid var(--border-strong);
    border-radius: 10px; cursor: text;
}
.a-chips:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,124,255,.18); }
.a-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: rgba(74,124,255,.14); color: var(--brand-soft);
    border: 1px solid rgba(74,124,255,.3);
    padding: .18rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 500;
}
.a-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0 .1rem; font-size: 1em; line-height: 1; }
.a-chip button:hover { color: var(--danger); }
.a-form .a-chips input { background: transparent; border: 0; box-shadow: none; padding: .15rem .2rem; flex: 1; min-width: 140px; width: auto; }
.a-form .a-chips input:focus { outline: none; box-shadow: none; background: transparent; }

/* Cover picker */
.a-cover-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .35rem; }
.a-cover-thumb {
    width: 84px; height: 54px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--border); background: rgba(255,255,255,.03);
    display: grid; place-items: center; color: var(--muted-2); font-size: .68rem;
}
.a-cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-cover-grid {
    margin-top: .7rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem;
    max-height: 240px; overflow-y: auto; padding: .6rem;
    border: 1px solid var(--border); border-radius: 10px; background: rgba(0,0,0,.25);
}
.a-cover-grid button { border: 1px solid var(--border); background: #000; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 16/10; padding: 0; }
.a-cover-grid button:hover { border-color: var(--brand); }
.a-cover-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Publish switch */
.a-switch, .a-form label.a-switch { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; cursor: pointer; }
.a-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a-switch-track {
    width: 38px; height: 22px; border-radius: 999px; flex-shrink: 0;
    background: rgba(255,255,255,.08); border: 1px solid var(--border-strong);
    position: relative; transition: background .18s ease, border-color .18s ease;
}
.a-switch-track::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--muted); transition: transform .18s ease, background .18s ease;
}
.a-switch input:checked + .a-switch-track { background: rgba(74,124,255,.55); border-color: var(--brand); }
.a-switch input:checked + .a-switch-track::after { transform: translateX(16px); background: #fff; }
.a-switch input:focus-visible + .a-switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ Site Settings ============ */
.s-group-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.4rem; }
@media (max-width: 1000px) { .s-group-cols { grid-template-columns: 1fr; } }
.s-preview { min-width: 0; }

.s-mock { border-radius: 10px; overflow: hidden; } /* decorative — clip, never stretch the page */
@media (max-width: 480px) { .s-mock-nav { display: none; } }
.s-mock-body {
    border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px;
    background: #070A14; padding: 1rem 1.1rem;
}
.s-mock-tab { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.s-mock-tab img { border-radius: 4px; flex-shrink: 0; }
.s-mock-tab b { font-family: var(--mono); font-weight: 500; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.s-mock-header { display: flex; align-items: center; gap: .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.s-mock-brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .88rem; color: var(--text); }
.s-mock-brand img { border-radius: 999px; flex-shrink: 0; }
.s-mock-nav { display: inline-flex; gap: .7rem; margin-left: auto; }
.s-mock-nav i { font-style: normal; font-size: .7rem; color: var(--muted-2); }
.s-mock-btn {
    font-size: .66rem; font-weight: 600; color: #05070E; white-space: nowrap;
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    padding: .3rem .6rem; border-radius: 7px;
}
.s-mock-herotext { padding-top: .9rem; }
.s-mock-herotext small { font-family: var(--mono); font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-soft); }
.s-mock-herotext p { margin: .3rem 0 0; color: var(--text); font-weight: 600; font-size: .95rem; }

/* Theme colors mock — driven by --mp/--mps/--mb/--mbs set from the inputs */
.s-mock-theme { background: var(--mb, #05070E); }
.s-mock-theme small { font-family: var(--mono); font-size: .58rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--mps, #7EA6FF); }
.s-mock-theme h3 { margin: .35rem 0 .7rem; font-size: 1.15rem; color: #fff; }
.s-mock-theme h3 em { font-style: normal; background: linear-gradient(135deg, var(--mp), var(--mps)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.s-mock-cta { display: flex; gap: .5rem; }
.s-theme-btn { font-size: .68rem; font-weight: 600; color: #05070E; background: linear-gradient(135deg, var(--mp), var(--mps)); padding: .35rem .65rem; border-radius: 7px; }
.s-theme-ghost { font-size: .68rem; font-weight: 600; color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.22); padding: .35rem .65rem; border-radius: 7px; }
.s-theme-panel { background: var(--mbs, #0B0F1C); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: .7rem .85rem; margin-top: .9rem; display: flex; flex-direction: column; gap: .1rem; }
.s-theme-panel b { font-size: .78rem; color: #fff; }
.s-theme-panel span { font-size: .7rem; color: rgba(255,255,255,.55); }

/* Footer + socials mocks */
.s-mock-foot-cols { display: flex; gap: 2rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.s-mock-foot-cols > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.s-mock-foot-cols b { font-size: .72rem; color: var(--text); margin-bottom: .15rem; }
.s-mock-foot-cols span { font-size: .72rem; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-mock-foot-bottom { padding-top: .7rem; font-size: .7rem; color: var(--muted-2); }
.s-mock-socials { display: flex; flex-wrap: wrap; gap: .4rem; }
.s-mock-socials span {
    font-size: .72rem; font-weight: 500; color: var(--muted);
    border: 1px solid var(--border-strong); border-radius: 999px; padding: .25rem .65rem;
}

/* Social link rows */
.s-social-rows { display: flex; flex-direction: column; gap: .5rem; }
.s-social-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto; gap: .5rem; align-items: center; }
.s-social-del {
    background: transparent; border: 1px solid var(--border); border-radius: 8px;
    color: var(--muted-2); cursor: pointer; padding: .5rem .6rem; font: inherit; font-size: .78rem; line-height: 1;
}
.s-social-del:hover { border-color: rgba(255,107,122,.5); color: var(--danger); background: rgba(255,107,122,.08); }

/* SEO mocks */
.s-mock-google { display: flex; flex-direction: column; gap: .15rem; }
.s-g-site { display: flex; align-items: center; gap: .55rem; margin-bottom: .25rem; }
.s-g-site img { border-radius: 50%; background: #fff; padding: 2px; }
.s-g-site b { display: block; font-size: .78rem; color: var(--text); font-weight: 500; }
.s-g-site span { display: block; font-size: .68rem; color: var(--muted-2); }
.s-g-title { font-size: 1.02rem; color: #99c3ff; font-weight: 400; }
.s-g-desc { margin: .15rem 0 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }

.s-mock-share { padding: 0; overflow: hidden; }
.s-share-img { aspect-ratio: 1200/630; background: rgba(255,255,255,.03); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.s-share-img span { color: var(--muted-2); font-size: .75rem; }
.s-share-img img { width: 100%; height: 100%; object-fit: cover; }
.s-share-meta { padding: .7rem .9rem .8rem; display: flex; flex-direction: column; gap: .1rem; }
.s-share-meta span { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); }
.s-share-meta b { font-size: .85rem; color: var(--text); }
.s-share-meta p { margin: 0; font-size: .75rem; color: var(--muted); }

/* Email setup steps + auto-reply mock */
.s-step {
    background: rgba(255,255,255,.02); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: .8rem;
}
.s-step:last-of-type { margin-bottom: 0; }
.s-step-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.s-step-head b { font-size: .92rem; color: var(--text); }
.s-mock-mail { transition: opacity .2s ease; }
.s-mail-meta { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .7rem; }
.s-mail-meta span { font-size: .7rem; color: var(--muted-2); }
.s-mail-meta b { color: var(--muted); font-weight: 500; }
.s-mail-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.s-mail-head { padding: .8rem; text-align: center; }
.s-mail-head b { color: #05070E; font-size: .9rem; }
.s-mail-body { padding: .8rem .9rem; background: rgba(255,255,255,.02); }
.s-mail-body p { margin: 0 0 .5rem; font-size: .78rem; color: var(--muted); line-height: 1.6; }
.s-mail-foot { padding: .55rem; text-align: center; font-size: .64rem; color: var(--muted-2); background: rgba(0,0,0,.3); }

/* Loading screen mock + full-screen demo/overlay */
.s-loader-opts { display: flex; flex-direction: column; gap: .4rem; }
.s-mock-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; min-height: 150px; transition: opacity .2s ease; }
.s-mock-loader small { color: var(--muted); font-size: .75rem; }
.s-loader-ring, .webr-loader-ring { position: relative; display: grid; place-items: center; }
.s-loader-ring { width: 58px; height: 58px; }
/* mock ring scales with the chosen size so the preview matches the real thing */
.s-mock-loader[data-size="small"] .s-loader-ring { width: 44px; height: 44px; }
.s-mock-loader[data-size="large"] .s-loader-ring { width: 78px; height: 78px; }
.s-loader-ring img, .webr-loader-ring img { border-radius: 999px; }
.s-loader-ring::before, .webr-loader-ring::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid rgba(74,124,255,.16); border-top-color: var(--brand);
    animation: webr-spin 1s linear infinite;
}
@keyframes webr-spin { to { transform: rotate(360deg); } }
.webr-loader {
    position: fixed; inset: 0; z-index: 999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
    background: var(--bg); transition: opacity .45s ease;
}
.webr-loader-ring { width: 140px; height: 140px; }
.webr-loader-ring::before { border-width: 4px; }
.webr-loader small { color: var(--muted); font-size: .95rem; }
.webr-loader.is-done { opacity: 0; pointer-events: none; }
/* full-screen demo size variants (match the public loader) */
.webr-loader[data-size="small"] { gap: 1rem; }
.webr-loader[data-size="small"] .webr-loader-ring { width: 92px; height: 92px; }
.webr-loader[data-size="small"] .webr-loader-ring::before { border-width: 3px; }
.webr-loader[data-size="large"] { gap: 1.7rem; }
.webr-loader[data-size="large"] .webr-loader-ring { width: 200px; height: 200px; }
.webr-loader[data-size="large"] .webr-loader-ring::before { border-width: 5px; }

/* Backups */
.s-backup-list { display: flex; flex-direction: column; gap: .5rem; }
.s-backup { border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.s-backup[open] { border-color: rgba(74,124,255,.3); }
.s-backup > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    padding: .75rem 1rem;
}
.s-backup > summary::-webkit-details-marker { display: none; }
.s-backup > summary b { font-size: .9rem; }
.s-backup > summary code { font-size: .7rem; color: var(--muted-2); background: rgba(255,255,255,.04); }
.s-backup-view { margin-left: auto; font-size: .78rem; color: var(--brand-soft); font-weight: 500; }
.s-backup[open] .s-backup-view { color: var(--muted-2); }
.s-backup-body { padding: 0 1rem 1rem; border-top: 1px solid var(--border); }
.s-backup-auto { font-size: .66rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--brand-soft); background: rgba(74,124,255,.14); border-radius: 999px; padding: .1rem .45rem; }
.s-autobackup { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: .2rem 0 .4rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.s-autobackup-days { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted-2); }
.s-autobackup-days input { width: 4.2rem; }
.s-backup-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: .9rem 0 1rem; padding: 0; }
.s-backup-facts div { display: flex; flex-direction: column; }
.s-backup-facts dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); font-weight: 600; }
.s-backup-facts dd { margin: 0; font-size: .85rem; color: var(--text); }

/* Blueprint */
.a-bp-modcats { display: grid; gap: 1rem; }
.a-bp-modcat { border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem 1rem; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.a-bp-modcat-title {
    margin: 0 0 .6rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-soft); font-weight: 700;
}
.a-bp-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem .9rem; margin-top: .4rem; }
.a-bp-meta { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: .8rem; font-size: .8rem; color: var(--muted-2); }
.a-bp-meta b { color: var(--brand-soft); font-family: var(--mono); font-weight: 600; }
.a-bp-text {
    width: 100%; resize: vertical; min-height: 420px;
    background: #080B16; border: 1px solid var(--border-strong); border-radius: 12px;
    color: var(--muted); font-family: var(--mono); font-size: .78rem; line-height: 1.65;
    padding: 1rem 1.2rem;
}
.a-bp-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,124,255,.18); }
.a-bp-questions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.a-bp-qgroup {
    background: rgba(255,255,255,.02); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 1.2rem;
}
.a-bp-qgroup h3 {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--brand-soft); font-weight: 600; margin: 0 0 .6rem;
}
.a-bp-qgroup ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.a-bp-qgroup li { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.a-bp-qgroup li::marker { color: var(--muted-2); font-size: .78rem; }
.a-bp-emails { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; }
.a-bp-email { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; min-width: 0; }
.a-bp-email .a-bp-text { min-height: 0; }
.a-bp-email h3 { font-size: .95rem; }

/* Submission-style card (still used by Testimonials) */
.a-sub-item { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.a-sub-item.is-unread { border-color: rgba(74,124,255,.4); background: rgba(74,124,255,.05); }
.a-sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.a-sub-head strong { color: var(--text); }
.a-sub-actions { display: flex; gap: .4rem; }
.a-sub-body { white-space: pre-wrap; color: var(--muted); font-size: .92rem; }

/* Dashed empty state (used by Invoices + the mail client) */
.a-empty-box { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 2rem 1.5rem; text-align: center; }
.a-empty-box h3 { margin: 0 0 .4rem; }
.a-empty-box p { margin: 0; line-height: 1.7; }

/* ============ Unified mail client (Inbox · Contact · Sent · Trash) ============ */
.a-mail {
    display: grid;
    grid-template-columns: 190px minmax(240px, 320px) minmax(0, 1fr);
    gap: 0; min-height: 560px;
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    background: var(--panel, rgba(255,255,255,.02));
}
/* ---- folder rail ---- */
.a-mail-rail { display: flex; flex-direction: column; gap: .25rem; padding: 1rem .75rem; border-right: 1px solid var(--border); background: rgba(255,255,255,.015); }
.a-mail-compose-btn { width: 100%; justify-content: center; margin-bottom: .6rem; }
.a-mail-folder { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
.a-mail-folder:hover { background: rgba(255,255,255,.05); color: var(--text); }
.a-mail-folder.is-active { background: rgba(74,124,255,.14); color: var(--text); }
.a-mail-folder.is-active .a-mail-folder-ic { color: var(--brand); }
.a-mail-folder-ic { display: inline-flex; flex-shrink: 0; }
.a-mail-folder-label { flex: 1; min-width: 0; }
.a-mail-folder-count { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.08); border-radius: 999px; padding: .05rem .45rem; min-width: 1.4em; text-align: center; }
.a-mail-folder-count.is-unread { color: #fff; background: var(--brand); }
.a-mail-rail-link { margin-top: .5rem; padding: .4rem .7rem; font-size: .82rem; color: var(--brand-soft); text-decoration: none; }
.a-mail-rail-link:hover { text-decoration: underline; }
/* ---- message list ---- */
.a-mail-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; max-height: 78vh; }
.a-mail-list-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-soft, #0e1119); z-index: 1; }
.a-mail-refresh { text-decoration: none; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.a-mail-refresh:hover { color: var(--brand); }
.a-mail-row { display: flex; flex-direction: column; gap: .2rem; width: 100%; text-align: left; padding: .7rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--muted); }
.a-mail-row:hover { background: rgba(255,255,255,.03); }
.a-mail-row.is-active { background: rgba(74,124,255,.1); box-shadow: inset 3px 0 0 var(--brand); }
.a-mail-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.a-mail-row-from { font-weight: 600; font-size: .9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-mail-row-top time { flex-shrink: 0; font-size: .74rem; color: var(--muted); }
.a-mail-row-subject { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-mail-row.is-unread .a-mail-row-from { color: var(--text); }
.a-mail-row.is-unread { background: rgba(74,124,255,.05); }
.a-mail-row.is-unread .a-mail-row-from::before { content: '●'; color: var(--brand); font-size: .6rem; vertical-align: middle; margin-right: .4rem; }
.a-mail-row-tag { font-size: .68rem; font-weight: 600; color: var(--success); }
.a-mail-empty { padding: 2rem 1.2rem; text-align: center; }
/* ---- reading pane ---- */
.a-mail-read { position: relative; padding: 1.4rem 1.6rem; overflow-y: auto; max-height: 78vh; }
.a-mail-back { display: none; }
.a-mail-placeholder { display: grid; place-items: center; min-height: 340px; }
.a-mail-placeholder-inner { text-align: center; color: var(--muted); }
.a-mail-placeholder-ic { font-size: 2.4rem; display: block; opacity: .4; margin-bottom: .6rem; }
.a-mail-msg-head { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.1rem; }
.a-mail-msg-subject { margin: 0 0 .7rem; font-size: 1.25rem; }
.a-mail-msg-meta { display: flex; align-items: center; gap: .7rem; }
.a-mail-avatar { flex-shrink: 0; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-soft)); }
.a-mail-msg-meta-txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.a-mail-msg-meta-txt strong { color: var(--text); }
.a-mail-msg-meta time { flex-shrink: 0; }
.a-mail-msg-head .a-status-pill { margin-top: .7rem; display: inline-block; }
.a-mail-body { margin-bottom: 1.2rem; }
.a-mail-body-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); line-height: 1.7; font-size: .95rem; }
.a-mail-history { margin: 0 0 1.2rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.a-mail-history > summary { padding: .6rem .9rem; cursor: pointer; font-size: .82rem; color: var(--brand-soft); }
.a-mail-history-item { padding: .7rem .9rem; border-top: 1px solid var(--border); }
.a-mail-history-item .a-mail-body-text { color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.a-mail-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.a-mail-del { color: #ff6b6b; border-color: rgba(255,107,107,.3); }
.a-mail-del:hover { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.5); }
/* ---- reply / compose form ---- */
.a-mail-form { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .7rem; }
#msg-compose .a-mail-form { border-top: 0; margin-top: 0; padding-top: 0; }
.a-mail-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
.a-mail-form input, .a-mail-form textarea { width: 100%; }
.a-mail-form textarea { resize: vertical; }
.a-mail-form-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
/* ---- responsive: collapse rail, then stack list/reading ---- */
@media (max-width: 1100px) {
    .a-mail { grid-template-columns: 60px minmax(220px, 300px) minmax(0, 1fr); }
    .a-mail-folder-label, .a-mail-rail-link { display: none; }
    .a-mail-folder { justify-content: center; padding: .55rem; }
    .a-mail-folder-count { position: absolute; margin-top: -1.1rem; margin-left: 1rem; }
    .a-mail-compose-btn { font-size: 0; padding: .5rem; }
    .a-mail-compose-btn::before { content: '✎'; font-size: 1rem; }
}
@media (max-width: 720px) {
    .a-mail { grid-template-columns: 1fr; min-height: 0; }
    .a-mail-rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
    .a-mail-compose-btn { width: auto; margin-bottom: 0; }
    .a-mail-list { border-right: 0; max-height: none; }
    .a-mail-read { max-height: none; }
    .a-mail-back { display: none; margin-bottom: 1rem; background: none; border: 0; color: var(--brand-soft); cursor: pointer; font-size: .9rem; }
    /* one pane at a time: show list, hide reading — until a row is tapped */
    .a-mail:not(.is-reading) .a-mail-read { display: none; }
    .a-mail.is-reading .a-mail-list { display: none; }
    .a-mail.is-reading .a-mail-back { display: block; }
    .a-mail.is-reading .a-mail-placeholder { display: none; }
}

/* ============ Settings: email guide link + avatar preview ============ */
.s-guide-link { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .8rem 1rem; margin: 0 0 1rem; border-radius: 12px; text-decoration: none; border: 1px solid rgba(74,124,255,.3); background: rgba(74,124,255,.08); color: var(--text); }
.s-guide-link:hover { background: rgba(74,124,255,.14); }
.s-guide-link .s-guide-ico { font-size: 1.3rem; }
.s-guide-link span:nth-child(2) { flex: 1; min-width: 12rem; font-size: .88rem; }
.s-guide-go { color: var(--brand-soft); font-weight: 600; white-space: nowrap; }
.s-avatar-preview { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.s-avatar-preview > span:first-child { color: var(--muted-2); font-size: .82rem; }
.s-avatar-preview img { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong); object-fit: cover; }
.s-avatar-preview code { word-break: break-all; }

/* ============ Setup Guide page ============ */
.a-guide-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.a-guide-toc a { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.02); color: var(--muted); text-decoration: none; font-size: .84rem; }
.a-guide-toc a:hover { color: var(--text); border-color: var(--border-strong); }
.a-guide-sec { padding: 1.2rem 0; border-top: 1px solid var(--border); scroll-margin-top: 1rem; }
.a-guide-sec:first-of-type { border-top: 0; }
.a-guide-sec h3 { margin: 0 0 .6rem; font-size: 1.1rem; }
.a-guide-sec h4 { margin: 1rem 0 .3rem; font-size: .95rem; color: var(--brand-soft); }
.a-guide-sec p { color: var(--muted); line-height: 1.65; margin: .5rem 0; }
.a-guide-sec ol, .a-guide-sec ul { color: var(--muted); line-height: 1.6; padding-left: 1.3rem; }
.a-guide-sec li { margin: .3rem 0; }
.a-guide-sec code { background: rgba(255,255,255,.05); border-radius: 5px; padding: .1rem .35rem; font-size: .84rem; word-break: break-word; }
.a-guide-tip { border-left: 3px solid var(--brand); padding: .5rem .9rem !important; background: rgba(74,124,255,.06); border-radius: 0 8px 8px 0; }
.a-guide-dns { width: 100%; border-collapse: collapse; margin: .6rem 0; font-size: .84rem; }
.a-guide-dns th, .a-guide-dns td { text-align: left; padding: .5rem .6rem; border: 1px solid var(--border); vertical-align: top; }
.a-guide-dns th { color: var(--text); background: rgba(255,255,255,.03); }
.a-guide-dns td { color: var(--muted); }
.a-guide-avatar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; margin: .6rem 0; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.a-guide-avatar img { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong); }
.a-guide-avatar code { word-break: break-all; }

/* ============ Photo field + image cropper ============ */
.a-photo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.a-photo-preview { width: 84px; height: 84px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--muted-2, #7a8199); font-size: .68rem; }
.a-photo-preview.shape-circle { border-radius: 50%; }
.a-photo-preview.shape-rounded { border-radius: 16px; }
.a-photo-preview.shape-square, .a-photo-preview.shape-free { border-radius: 8px; }
.a-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.a-photo-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.crop-ov { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(4,7,14,.72); backdrop-filter: blur(3px); padding: 1rem; }
.crop-dialog { background: var(--panel, #0b0f1c); border: 1px solid var(--border-strong); border-radius: 16px; padding: 1.1rem; max-width: 100%; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.crop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.crop-head b { font-size: 1rem; }
.crop-x { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.crop-x:hover { background: rgba(255,255,255,.06); color: var(--text); }
.crop-shapes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.crop-shapes button { font-size: .78rem; padding: .35rem .7rem; border-radius: 8px; cursor: pointer; background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--muted); }
.crop-shapes button:hover { color: var(--text); border-color: var(--border-strong); }
.crop-shapes button.is-active { background: rgba(74,124,255,.18); border-color: var(--brand); color: var(--brand-soft); }
.crop-stage-wrap { display: grid; place-items: center; background: repeating-conic-gradient(#12151f 0% 25%, #0d1017 0% 50%) 50% / 20px 20px; border-radius: 10px; padding: 10px; }
.crop-stage { position: relative; background-repeat: no-repeat; touch-action: none; user-select: none; }
.crop-box { position: absolute; box-sizing: border-box; border: 2px solid var(--brand-soft, #7ea6ff); box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; touch-action: none; }
.crop-box.shape-circle { border-radius: 50%; }
.crop-box.shape-rounded { border-radius: 16px; }
.crop-h { position: absolute; width: 14px; height: 14px; background: var(--brand-soft, #7ea6ff); border: 2px solid #05070e; border-radius: 50%; }
.crop-h.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-h.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-hint { text-align: center; color: var(--muted-2, #7a8199); font-size: .72rem; margin: .6rem 0 .3rem; }
.crop-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }

/* ============ Media field + library picker ============ */
.media-field { display: flex; flex-direction: column; gap: .35rem; }
.media-field .js-media-pick { align-self: flex-start; }
.media-ov { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(4,7,14,.72); backdrop-filter: blur(3px); padding: 1rem; }
.media-dialog { background: var(--panel, #0b0f1c); border: 1px solid var(--border-strong); border-radius: 16px; width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.media-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.media-head b { font-size: 1rem; }
.media-search { flex: 1; min-width: 6rem; }
.media-x { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: .2rem .45rem; border-radius: 6px; }
.media-x:hover { background: rgba(255,255,255,.06); color: var(--text); }
.media-grid { padding: 1rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; }
.media-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 1.5rem 0; }
.media-item { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 0; background: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; text-align: left; }
.media-item:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.media-item img, .media-item video { width: 100%; height: 92px; object-fit: cover; background: #0d1017; display: block; }
.media-name { font-size: .62rem; color: var(--muted); padding: 0 .4rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-badge { position: absolute; top: .35rem; right: .35rem; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; font-size: .6rem; padding: .05rem .3rem; }

/* ============ Invoices ============ */
.btn-xs { padding: .28rem .55rem; font-size: .72rem; border-radius: 7px; }
.s-inv-pill { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: .12rem .5rem; border-radius: 999px; }
.s-inv-draft { background: rgba(255,255,255,.08); color: var(--muted-2, #8a93a6); }
.s-inv-sent { background: rgba(74,124,255,.16); color: var(--brand-soft); }
.s-inv-overdue { background: rgba(255,107,107,.16); color: #ff9b9b; }
.s-inv-paid { background: rgba(75,214,138,.16); color: #a5f0c4; }

/* list */
.a-inv-list { display: flex; flex-direction: column; }
.a-inv-list-row { display: grid; grid-template-columns: 108px 1.3fr 96px 96px 100px 84px auto; gap: .6rem; align-items: center; padding: .7rem .4rem; border-bottom: 1px solid var(--border); }
.a-inv-list-head { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2, #8a93a6); border-bottom: 1px solid var(--border-strong); }
.a-inv-num a { font-weight: 700; color: var(--text); }
.a-inv-num a:hover { color: var(--brand-soft); }
.a-inv-total { font-weight: 700; }
.a-inv-actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.a-inv-actions form { display: inline; }
.a-inv-del-btn { color: #ff8a8a; }
@media (max-width: 820px) {
    .a-inv-list-head { display: none; }
    .a-inv-list-row { grid-template-columns: 1fr 1fr; gap: .35rem .6rem; border: 1px solid var(--border); border-radius: 10px; padding: .8rem; margin-bottom: .6rem; }
    .a-inv-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* editor line items */
.a-inv-items { display: flex; flex-direction: column; gap: .4rem; margin: .3rem 0 .6rem; }
.a-inv-row { display: grid; grid-template-columns: 1fr 78px 110px 110px 30px; gap: .5rem; align-items: center; }
.a-inv-row-head { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2, #8a93a6); }
.a-inv-row-head span:nth-child(2), .a-inv-row-head span:nth-child(3), .a-inv-row-head span:nth-child(4) { text-align: right; }
.inv-item .inv-qty, .inv-item .inv-rate { text-align: right; }
.inv-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.a-inv-del { background: none; border: 0; color: var(--muted-2, #8a93a6); cursor: pointer; font-size: .9rem; border-radius: 6px; padding: .2rem; }
.a-inv-del:hover { color: #ff8a8a; background: rgba(255,107,107,.1); }
@media (max-width: 640px) {
    .a-inv-row { grid-template-columns: 1fr 60px 90px 90px 26px; gap: .35rem; }
    .a-inv-row-head span:first-child { grid-column: 1; }
}

.a-inv-foot { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.a-inv-adjust { display: flex; gap: .8rem; flex-wrap: wrap; }
.a-inv-adjust label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
.a-inv-adjust input { width: 8rem; }
.a-inv-totals { min-width: 240px; margin-left: auto; }
.a-inv-totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .28rem 0; font-size: .9rem; color: var(--muted); }
.a-inv-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.a-inv-grand { border-top: 1px solid var(--border-strong); margin-top: .3rem; padding-top: .5rem !important; font-size: 1.05rem !important; color: var(--text) !important; font-weight: 700; }
.a-inv-grand b { color: var(--brand-soft) !important; }
.a-inv-danger { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* invoice editor + live preview split */
.a-inv-editor-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .a-inv-editor-grid { grid-template-columns: 1fr; } }
.a-inv-preview-col { position: sticky; top: calc(var(--topbar-h, 64px) + 1rem); }
.a-inv-preview-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.a-inv-preview-head span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2, #8a93a6); }
.a-inv-preview-head a { font-size: .78rem; color: var(--brand-soft); text-decoration: none; }
#invoice-preview-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--border-strong); border-radius: 12px; background: #eef1f6; display: block; }
@media (max-width: 1100px) { #invoice-preview-frame { height: 620px; } }

/* media inline rename */
.a-media-rename { display: flex; align-items: center; gap: .3rem; padding: .5rem .6rem .6rem; flex-wrap: wrap; }
.a-media-rename input[name="new_name"] { flex: 1; min-width: 5rem; font-size: .78rem; padding: .35rem .45rem; }
.a-media-ext { font-size: .76rem; color: var(--muted-2, #8a93a6); }

/* invoice "how to" help panel */
.a-inv-howto { margin: 0 0 1.1rem; border: 1px solid rgba(74,124,255,.3); border-radius: 12px; background: rgba(74,124,255,.06); overflow: hidden; }
.a-inv-howto > summary { list-style: none; cursor: pointer; padding: .7rem 1rem; font-weight: 600; font-size: .9rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.a-inv-howto > summary::-webkit-details-marker { display: none; }
.a-inv-howto > summary::after { content: '▾'; margin-left: auto; color: var(--brand-soft); transition: transform .2s ease; }
.a-inv-howto[open] > summary::after { transform: rotate(180deg); }
.a-inv-howto-ico { font-size: 1rem; }
.a-inv-howto ol { margin: 0; padding: .2rem 1.2rem 0 2.4rem; }
.a-inv-howto li { color: var(--muted); line-height: 1.6; margin: .4rem 0; font-size: .87rem; }
.a-inv-howto li b { color: var(--text); font-weight: 600; }
.a-inv-howto > p { padding: .4rem 1rem 1rem; margin: 0; }
.a-inv-howto a { color: var(--brand-soft); }

/* invoice logo picker row */
.s-inv-logo-row { display: flex; align-items: flex-start; gap: .8rem; }
.s-inv-logo-row .media-field { flex: 1; min-width: 0; }
.s-inv-logo-prev { width: 52px; height: 52px; object-fit: contain; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px; flex-shrink: 0; }

/* brand-text show/hide toggle in the Navigation editor */
.a-brandtext-toggle { display: flex; align-items: center; gap: .5rem; margin: -.1rem 0 1rem; font-size: .88rem; color: var(--muted); cursor: pointer; }
.a-brandtext-toggle input { width: auto; }

/* ===== Blueprint: multi-intake + card checklist + discovery wizard ===== */
.bp-intake-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.bp-intake-tab {
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    padding: .5rem .9rem; border-radius: 999px; color: var(--muted);
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    transition: all .15s ease; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bp-intake-tab:hover { color: var(--text); border-color: var(--border-strong); }
.bp-intake-tab.is-active { color: #05231a; background: linear-gradient(135deg, var(--brand), var(--brand-soft)); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(14,147,132,.6); }
.bp-intake-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .4rem; border-top: 1px solid var(--border); }
.bp-name-field { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 220px; }
.bp-name-field span { font-size: .78rem; color: var(--muted); font-weight: 500; }
.bp-name-field input { background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); color: var(--text); font: inherit; font-size: 1rem; font-weight: 600; padding: .55rem .8rem; border-radius: 10px; }
.bp-name-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,147,132,.18); }
.bp-tab-badge { font-style: normal; margin-left: .35rem; }

/* Pipeline / status tracker */
.bp-pipeline { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.bp-stage { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 20px; padding: .3rem .7rem; }
.bp-stage b { font-style: normal; font-weight: 400; }
.bp-stage em { font-style: normal; font-weight: 700; color: var(--text); background: rgba(255,255,255,.06); border-radius: 10px; padding: 0 .4rem; font-size: .74rem; }
.bp-stage.is-active { color: #05231a; background: linear-gradient(135deg, var(--brand), var(--brand-soft)); border-color: transparent; }
.bp-stage.is-active em { color: #05231a; background: rgba(255,255,255,.35); }
.bp-status-field { display: flex; flex-direction: column; gap: .3rem; }
.bp-status-field span { font-size: .78rem; color: var(--muted); font-weight: 500; }
.bp-status-field select { background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); color: var(--text); font: inherit; padding: .55rem .7rem; border-radius: 10px; }

/* Client share link */
.bp-share { margin-top: 1rem; padding: 1rem; border: 1px solid var(--brand); border-radius: 12px; background: rgba(14,147,132,.06); }
.bp-share-head { font-size: .88rem; color: var(--text); margin-bottom: .7rem; }
.bp-share .a-row { flex-wrap: wrap; }
.bp-share input { min-width: 240px; flex: 1; }

/* Industry presets */
.bp-presets { margin-top: 1rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bp-presets summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; font-size: .9rem; color: var(--text); background: rgba(255,255,255,.02); user-select: none; }
.bp-presets[open] summary { border-bottom: 1px solid var(--border); }
.bp-preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; padding: 1rem; }
.bp-preset { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .8rem .9rem; border: 1px solid var(--border-strong); border-radius: 11px; background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.bp-preset:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(14,147,132,.6); }
.bp-preset-ic { font-size: 1.5rem; }
.bp-preset-label { font-weight: 700; font-size: .92rem; }
.bp-preset-blurb { font-size: .78rem; color: var(--muted); line-height: 1.4; }

/* Module cards */
.bp-modgrid { display: grid; gap: 1.1rem; }
.bp-modcat-title { display: flex; align-items: center; gap: .4rem; margin: 0 0 .6rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-soft); font-weight: 700; }
.bp-modcat-ic { font-size: .95rem; }
.bp-modcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.bp-modcard {
    position: relative; display: flex; align-items: center; gap: .6rem; cursor: pointer;
    padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(255,255,255,.02); transition: all .15s ease; user-select: none;
}
.bp-modcard:hover { border-color: var(--border-strong); background: rgba(255,255,255,.04); }
.bp-modcard input { position: absolute; opacity: 0; pointer-events: none; }
.bp-modcard-ic { font-size: 1.3rem; line-height: 1; filter: grayscale(.5); opacity: .7; transition: all .15s ease; }
.bp-modcard-label { font-size: .86rem; font-weight: 500; color: var(--muted); line-height: 1.25; }
.bp-modcard-tick { margin-left: auto; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: .7rem; color: transparent; flex-shrink: 0; transition: all .15s ease; }
.bp-modcard:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.bp-modcard:has(input:checked) .bp-modcard-ic { filter: none; opacity: 1; }
.bp-modcard:has(input:checked) .bp-modcard-label { color: var(--text); }
.bp-modcard:has(input:checked) .bp-modcard-tick { background: var(--brand); border-color: var(--brand); color: #05231a; }
.bp-modcard input:focus-visible + .bp-modcard-ic { outline: 2px solid var(--brand-soft); outline-offset: 3px; border-radius: 4px; }

/* Discovery wizard */
.bp-wizards { display: grid; gap: 1rem; }
.bp-wizard { border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.2rem; background: linear-gradient(180deg, var(--panel), var(--bg-soft)); }
.bp-wiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.bp-wiz-cat { font-weight: 700; font-size: .95rem; color: var(--text); }
.bp-wiz-progress { font-family: var(--mono, monospace); font-size: .8rem; color: var(--muted-2); }
.bp-wiz-cur { color: var(--brand-soft); font-weight: 700; }
.bp-wiz-slide { display: none; }
.bp-wiz-slide.is-active { display: block; animation: bpFade .2s ease; }
@keyframes bpFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bp-wiz-q { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: .6rem; line-height: 1.4; }
.bp-wiz-a { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); color: var(--text); font: inherit; font-size: .95rem; padding: .7rem .85rem; border-radius: 10px; resize: vertical; min-height: 80px; }
.bp-wiz-a:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,147,132,.18); }
.bp-wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .8rem; }
.bp-wiz-dots { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.bp-wiz-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); cursor: pointer; transition: all .15s ease; }
.bp-wiz-dot:hover { background: var(--muted); }
.bp-wiz-dot.is-active { background: var(--brand); transform: scale(1.25); }

/* ===== Client Hub ===== */
/* ---- Client hub: overview stats ---- */
.hub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.1rem; }
.hub-stat { position: relative; overflow: hidden; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); display: flex; flex-direction: column; gap: .1rem; }
.hub-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.hub-stat.is-live::before { background: #4bd68a; }
.hub-stat.is-build::before { background: #f0b64b; }
.hub-stat.is-wait::before { background: #e0645a; }
.hub-stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1; color: var(--text); }
.hub-stat-lbl { font-size: .78rem; color: var(--muted); }

/* ---- Client hub: toolbar + stage filters ---- */
.hub-toolbar { margin-bottom: .8rem; }
.hub-toolbar .a-search { width: 100%; }
.hub-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.hub-filter-pill { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .82rem; color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 20px; padding: .32rem .8rem; cursor: pointer; transition: all .15s; }
.hub-filter-pill:hover { color: var(--text); border-color: var(--border-strong); }
.hub-filter-pill em { font-style: normal; font-weight: 700; font-size: .72rem; background: rgba(255,255,255,.07); border-radius: 10px; padding: 0 .38rem; color: var(--text); }
.hub-filter-pill.is-active { color: #05231a; background: linear-gradient(135deg, var(--brand), var(--brand-soft)); border-color: transparent; font-weight: 600; }
.hub-filter-pill.is-active em { color: #05231a; background: rgba(255,255,255,.4); }

/* ---- Client hub: client cards grid ---- */
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .8rem; }
.hub-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .7rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s, background .15s, box-shadow .15s; }
.hub-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.hub-card.hub-stage-lead::before { background: #7c8b98; }
.hub-card.hub-stage-intake::before { background: #6aa8e0; }
.hub-card.hub-stage-building::before { background: #f0b64b; }
.hub-card.hub-stage-review::before { background: #b98ce0; }
.hub-card.hub-stage-live::before { background: #4bd68a; }
.hub-card:hover { border-color: var(--brand); transform: translateY(-2px); background: rgba(255,255,255,.04); box-shadow: 0 12px 28px -18px rgba(0,0,0,.8); }
.hub-card-top { display: flex; align-items: center; gap: .7rem; }
.hub-card-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-soft)); color: #05231a; font-weight: 800; display: grid; place-items: center; flex: none; }
.hub-avatar-lg { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 12px; }
.hub-card-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-card-id strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-card-stage { font-size: .74rem; color: var(--muted); white-space: nowrap; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 20px; padding: .2rem .6rem; align-self: flex-start; }
.hub-card-tags { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1px; }
.hub-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; padding: .18rem .55rem; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); }
.hub-tag.is-good { background: rgba(75,214,138,.14); border-color: transparent; color: #a5f0c4; }
.hub-tag.is-live { background: rgba(106,168,224,.14); border-color: transparent; color: #b6d7f5; }
.hub-tag.is-key { background: rgba(240,182,75,.14); border-color: transparent; color: #f3d79a; }
.hub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .2rem; }
.hub-next { font-size: .78rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-next-go { color: var(--brand-soft); }
.hub-next-wait { color: #f3d79a; }
.hub-next-done { color: var(--muted-2); }
.hub-card-ago { font-size: .72rem; color: var(--muted-2); white-space: nowrap; flex: none; }
/* Masonry-style columns so uneven panels flow tightly (no big vertical gaps). */
.hub-detail { column-width: 340px; column-gap: 1.1rem; }
.hub-detail .a-panel { margin: 0 0 1.1rem; break-inside: avoid; -webkit-column-break-inside: avoid; }
.hub-detail .a-panel h3 { font-size: 1rem; }
.hub-detail .a-panel-head { margin-bottom: .8rem; }

/* role/source pills + stage select (used by the hub) */
.a-role-pill { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .16rem .55rem; border-radius: 20px; vertical-align: middle; }
.a-role-admin { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand-soft); }
.a-role-editor { background: rgba(255,194,74,.16); color: var(--warn, #ffc24a); }
.a-role-select { background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); border-radius: 9px; padding: .4rem .6rem; font: inherit; font-size: .85rem; }

/* Client detail hero */
.hub-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--panel)), var(--bg-soft)); border: 1px solid var(--border-strong); border-radius: 18px; padding: 1.2rem 1.4rem 1.1rem; margin-bottom: 1.2rem; }
.hub-hero-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.hub-hero-main { display: flex; align-items: center; gap: 1.1rem; }
.hub-avatar-xl { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; }
.hub-hero-info { min-width: 0; }
.hub-hero-info h2 { margin: 0 0 .45rem; font-size: 1.5rem; }
.hub-hero-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.hub-stage-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .16rem .6rem; border-radius: 20px; background: rgba(255,255,255,.08); color: var(--text); }
.hub-stage-badge.is-good { background: rgba(75,214,138,.16); color: #a5f0c4; }
.hub-hero-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .86rem; }
.hub-hero-meta a { color: var(--brand-soft); text-decoration: none; }
.hub-hero-meta a:hover { text-decoration: underline; }
/* progress rail */
.hub-progress { display: flex; gap: .3rem; margin-top: 1.1rem; }
.hub-progress-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; position: relative; }
.hub-progress-step span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid var(--border); font-size: .9rem; filter: grayscale(1) opacity(.5); transition: all .2s; }
.hub-progress-step small { font-size: .66rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; }
.hub-progress-step.is-on span { background: linear-gradient(135deg, var(--brand), var(--brand-soft)); border-color: transparent; filter: none; box-shadow: 0 4px 12px -4px rgba(14,147,132,.6); }
.hub-progress-step.is-on small { color: var(--text); }
.hub-progress-step::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: -1; }
.hub-progress-step:first-child::before { display: none; }
.hub-progress-step.is-on::before { background: linear-gradient(90deg, var(--brand-soft), var(--brand)); }
/* checklist */
.hub-todos { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.hub-todo { display: flex; align-items: center; gap: .6rem; }
.hub-todo-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: transparent; color: var(--brand-soft); font-size: .8rem; font-weight: 800; cursor: pointer; flex: none; display: grid; place-items: center; }
.hub-todo.is-done .hub-todo-check { background: var(--brand); border-color: transparent; color: #05231a; }
.hub-todo-text { flex: 1; min-width: 0; font-size: .9rem; }
.hub-todo.is-done .hub-todo-text { text-decoration: line-through; color: var(--muted-2); }
.hub-todo-del button { background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: .85rem; padding: .2rem; opacity: .5; }
.hub-todo:hover .hub-todo-del button { opacity: 1; }
.hub-todo-del button:hover { color: var(--danger); }
.hub-todo-toggle, .hub-todo-del { display: inline-flex; }
.hub-todo-add { display: flex; gap: .5rem; }
.hub-todo-add input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); border-radius: 9px; padding: .5rem .7rem; font: inherit; font-size: .88rem; }
.hub-todo-add input:focus { outline: none; border-color: var(--brand); }
@media (max-width: 560px) { .hub-hero-main { align-items: flex-start; } .hub-progress-step small { display: none; } }
.hub-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.hub-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; background: color-mix(in srgb, var(--brand) 12%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); color: var(--text); border-radius: 20px; padding: .28rem .7rem; cursor: default; }
button.hub-chip { cursor: pointer; }
button.hub-chip:hover { border-color: var(--brand); }

/* ---- Client hub: detail quick actions + next-step + progress ---- */
.hub-quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hub-qbtn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--border-strong); border-radius: 10px; padding: .5rem .85rem; text-decoration: none; cursor: pointer; transition: all .15s; }
.hub-qbtn b { font-weight: 400; }
.hub-qbtn:hover { background: rgba(255,255,255,.1); border-color: var(--brand); transform: translateY(-1px); }
.hub-qbtn.is-primary { background: linear-gradient(135deg, var(--brand), var(--brand-soft)); color: #05231a; border-color: transparent; }
.hub-qbtn.is-primary:hover { filter: brightness(1.05); }

.hub-nextbar { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.1rem; border-radius: 14px; margin-bottom: 1.2rem; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.hub-nextbar-go { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.hub-nextbar-wait { border-color: rgba(240,182,75,.4); background: rgba(240,182,75,.08); }
.hub-nextbar-done { opacity: .85; }
.hub-nextbar-ic { font-size: 1.5rem; flex: none; line-height: 1; }
.hub-nextbar-text { display: flex; flex-direction: column; line-height: 1.3; }
.hub-nextbar-text b { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); }
.hub-nextbar-text span { font-size: .95rem; color: var(--text); font-weight: 600; }

.hub-todo-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; margin-bottom: .8rem; }
.hub-todo-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand-soft), var(--brand)); transition: width .3s; }

@media (max-width: 620px) {
    .hub-stats { grid-template-columns: repeat(2, 1fr); }
    .hub-cards { grid-template-columns: 1fr; }
    .hub-quick { gap: .4rem; }
    .hub-qbtn { flex: 1; justify-content: center; font-size: .8rem; padding: .5rem .5rem; }
}

/* ============ File-picker previews (any <input type=file>) ============ */
.a-file-preview { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.a-file-preview-item {
    display: flex; align-items: center; gap: .6rem; max-width: 100%;
    padding: .4rem .6rem; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px;
}
.a-file-preview-item img {
    width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; flex-shrink: 0;
    background: rgba(0,0,0,.25); box-shadow: 0 6px 18px -10px rgba(0,0,0,.7);
}
.a-file-preview-ic { font-size: 1.6rem; width: 42px; text-align: center; flex-shrink: 0; }
.a-file-preview-name { font-size: .82rem; color: var(--muted); word-break: break-all; line-height: 1.4; }
.a-file-preview-more { align-self: center; font-size: .82rem; color: var(--muted-2); }

/* ============================================================================
   Ported from the WebR starter kit: shared list/empty/health/activity/version
   styles used by Site Health, Activity Log, Version History, SEO and App&Install.
   ========================================================================== */
.a-empty { text-align: center; padding: 2.6rem 1.4rem; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: rgba(255,255,255,.02); }
.a-empty-ic { font-size: 2.3rem; display: block; margin-bottom: .6rem; opacity: .85; }
.a-empty h3 { margin: 0 0 .35rem; color: var(--text); font-size: 1.08rem; }
.a-empty p { margin: 0 auto; max-width: 400px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.a-empty .btn, .a-empty code { margin-top: 1rem; }
.a-empty code { display: inline-block; }

/* Module-style list rows (Version History and friends) */
.a-mod-list { display: flex; flex-direction: column; gap: .55rem; }
.a-mod-row {
    display: flex; align-items: center; gap: .9rem;
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008));
    border: 1px solid var(--border); border-radius: 12px; padding: .75rem .95rem;
    transition: border-color .15s ease, transform .15s ease;
}
.a-mod-row:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.a-mod-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.a-mod-main strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.a-mod-main .muted { overflow: hidden; text-overflow: ellipsis; }
.a-mod-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.a-mod-actions form { margin: 0; }
@media (max-width: 640px) {
    .a-mod-row { flex-wrap: wrap; }
    .a-mod-actions { margin-left: 0; width: 100%; padding-top: .5rem; border-top: 1px solid var(--border); }
    .a-mod-actions .btn { flex: 1 1 auto; text-align: center; justify-content: center; }
}
.ver-kind { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .1rem .45rem; border-radius: 5px; vertical-align: middle; margin-right: .3rem; }
.ver-kind-content { background: rgba(14,147,132,.16); color: var(--brand-soft); }
.ver-kind-blog { background: rgba(122,110,255,.16); color: #a89dff; }

/* Activity Log */
.act-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act-item { display: flex; gap: .8rem; padding: .75rem .3rem; border-bottom: 1px solid var(--border); }
.act-item:last-child { border-bottom: 0; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: .35rem; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.act-item.is-support .act-dot { background: #e0a938; box-shadow: 0 0 0 4px rgba(224,169,56,.18); }
.act-main { flex: 1; min-width: 0; }
.act-msg { font-size: .9rem; line-height: 1.4; }
.act-item.is-support .act-msg b { color: #e0a938; }

/* Site Health */
.hz-overall { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 1.2rem; }
.hz-overall > div { display: flex; flex-direction: column; }
.hz-overall-badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; flex: none; }
.hz-overall.hz-ok { border-color: rgba(75,214,138,.35); background: rgba(75,214,138,.07); }
.hz-overall.hz-ok .hz-overall-badge { background: rgba(75,214,138,.2); color: var(--success); }
.hz-overall.hz-warn { border-color: rgba(255,194,74,.35); background: rgba(255,194,74,.07); }
.hz-overall.hz-warn .hz-overall-badge { background: rgba(255,194,74,.2); color: var(--warn); }
.hz-overall.hz-bad { border-color: rgba(255,107,122,.35); background: rgba(255,107,122,.07); }
.hz-overall.hz-bad .hz-overall-badge { background: rgba(255,107,122,.2); color: var(--danger); }
.hz-list { display: flex; flex-direction: column; gap: .5rem; }
.hz-item { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.02); }
.hz-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; flex: none; margin-top: 1px; }
.hz-item.hz-ok .hz-dot { background: rgba(75,214,138,.15); color: var(--success); }
.hz-item.hz-warn .hz-dot { background: rgba(255,194,74,.15); color: var(--warn); }
.hz-item.hz-bad .hz-dot { background: rgba(255,107,122,.15); color: var(--danger); }
.hz-item.hz-info .hz-dot { background: rgba(74,163,255,.15); color: #7fb4ff; }
.hz-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.hz-body strong { font-size: .92rem; }
.hz-body span { font-size: .85rem; color: var(--muted); line-height: 1.45; }

/* ---- Form sections + live preview stage (SEO & App&Install) ---- */
.a-form-sec { border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; margin-top: 1rem; background: rgba(255,255,255,.015); }
.a-form-sec-title { margin: 0 0 .9rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-soft); font-weight: 700; }
.a-field-block { display: block; margin-top: .9rem; }
.a-field-block > span { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; margin-bottom: .45rem; }
.a-live { margin-bottom: 1.2rem; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.a-live-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; padding: .55rem .9rem; background: rgba(0,0,0,.22); border-bottom: 1px solid var(--border); }
.a-live-stage { position: relative; background: #faf9f6; overflow: hidden; }
.a-live-stage-pad {
    min-height: 240px; display: grid; place-items: center; padding: 1.6rem;
    background:
        radial-gradient(circle, rgba(20,30,55,.05) 1px, transparent 1.6px) 0 0 / 15px 15px,
        radial-gradient(120% 120% at 25% 15%, #f1f4f9 0%, #dde3ee 70%, #d3dae7 100%);
}

/* SEO: Google result + social share previews */
.seo-serp { background: #fff; border: 1px solid rgba(23,32,29,.1); border-radius: 12px; padding: 1rem 1.2rem; width: min(560px, 100%); text-align: left; box-shadow: 0 22px 48px -20px rgba(6,10,22,.55), 0 3px 10px -4px rgba(6,10,22,.3); }
.seo-serp-site { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; }
.seo-serp-fav { width: 26px; height: 26px; border-radius: 50%; background: #e8eaed; display: grid; place-items: center; overflow: hidden; flex: none; }
.seo-serp-fav img { width: 100%; height: 100%; object-fit: contain; }
.seo-serp-site-meta { min-width: 0; }
.seo-serp-site-name { font-size: .8rem; color: #202124; line-height: 1.2; font-family: Arial, sans-serif; }
.seo-serp-url { color: #4d5156; font-size: .78rem; margin: 0 0 .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; font-family: Arial, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-serp-desc { color: #4d5156; font-size: .84rem; line-height: 1.45; margin-top: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seo-social { background: #fff; border: 1px solid rgba(23,32,29,.12); border-radius: 12px; overflow: hidden; width: min(500px, 100%); text-align: left; box-shadow: 0 22px 48px -20px rgba(6,10,22,.55), 0 3px 10px -4px rgba(6,10,22,.3); }
.seo-social-img { height: 180px; background: linear-gradient(135deg,#eef1ef,#e3e7e4); display: grid; place-items: center; color: #aab2ab; font-size: .85rem; }
.seo-social-img img { width: 100%; height: 100%; object-fit: cover; }
.seo-social-body { padding: .7rem 1rem 1rem; border-top: 1px solid rgba(23,32,29,.08); }
.seo-social-host { font-size: .68rem; letter-spacing: .04em; color: #8a93a1; text-transform: uppercase; }
.seo-social-title { font-size: 1rem; font-weight: 700; color: #1a2028; margin: .15rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-social-desc { font-size: .82rem; color: #5b6675; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seo-count { font-size: .74rem; color: var(--muted-2); margin-top: .3rem; font-weight: 600; }
.seo-count b { color: var(--muted); font-weight: 700; }
.seo-count.is-good b { color: var(--success); }
.seo-count.is-over b { color: var(--warn); }
.seo-kw-hint.is-good { color: var(--success); }
.seo-kw-hint.is-over { color: var(--warn); }

/* SEO tab bar */
.seo-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.seo-tab {
    background: rgba(255,255,255,.04); border: 1px solid var(--border-strong);
    color: var(--muted); border-radius: 999px; padding: .45rem .95rem;
    font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.seo-tab:hover { color: var(--text); }
.seo-tab.is-active { background: rgba(74,124,255,.16); color: var(--text); border-color: rgba(74,124,255,.45); box-shadow: inset 0 0 0 1px rgba(74,124,255,.25); }
.seo-pane { display: none; }
.seo-pane.is-active { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* App & Install: phone home-screen preview */
.pwa-phone { width: 200px; padding: .8rem .8rem 1.4rem; border-radius: 26px; background: linear-gradient(160deg,#1b2233,#0e1420); box-shadow: 0 24px 50px -20px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.06); }
.pwa-phone-notch { width: 46px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 0 auto .9rem; }
.pwa-prev { display: grid; justify-items: center; gap: .5rem; }
.pwa-phone .pwa-prev { padding-top: .3rem; }
.pwa-prev-icon { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(0,0,0,.5); overflow: hidden; }
.pwa-prev-icon img { width: 78%; height: 78%; object-fit: contain; }
.pwa-prev-name { font-size: .82rem; color: #eef2f8; max-width: 90px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* App & Install: per-app editor cards */
.pwa-app { border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; background: rgba(255,255,255,.015); }
.pwa-app-head { display: flex; align-items: center; gap: .5rem .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.pwa-app-head .pwa-app-label { font-weight: 700; font-size: 1rem; flex: 1 1 auto; min-width: 0; }
.pwa-app-head .a-status-pill { flex-shrink: 0; }
.pwa-app-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 720px) { .pwa-app-grid { grid-template-columns: 1fr; } }
/* On phones the app name takes its own line so the status pill + action buttons
   wrap onto the next line instead of squishing together. */
@media (max-width: 640px) {
    .pwa-app-head .pwa-app-label { flex-basis: 100%; }
    .pwa-app-head .btn { flex: 0 1 auto; }
    .pwa-app-head .pwa-app-del { margin-left: auto; }
}

/* ============================================================================
   Installed-app (standalone PWA) mode — everything here only applies when the
   admin is launched from the home screen (html.is-standalone), so the normal
   in-browser admin is completely unchanged.
   ========================================================================== */

/* Branded cold-start splash */
.a-splash { display: none; }
.is-standalone .a-splash {
    display: flex; position: fixed; inset: 0; z-index: 9999;
    align-items: center; justify-content: center;
    background:
        radial-gradient(130% 80% at 50% -20%, rgba(255,255,255,.16), transparent 55%),
        radial-gradient(120% 70% at 50% 120%, rgba(0,0,0,.28), transparent 55%),
        var(--splash-bg, var(--brand));
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: opacity .4s ease;
}
.is-standalone.splash-done .a-splash { display: none; } /* only on cold start, not every nav */
.a-splash.is-hiding { opacity: 0; pointer-events: none; }
.a-splash-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.a-splash-icon {
    width: 96px; height: 96px; border-radius: 24px; overflow: hidden;
    background: rgba(255,255,255,.16); display: grid; place-items: center;
    animation: a-splash-pop .55s cubic-bezier(.22,1,.36,1) both, a-splash-glow 2.4s ease-in-out .5s infinite;
}
.a-splash-icon img { width: 100%; height: 100%; object-fit: cover; }
.a-splash-name {
    color: #fff; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em;
    text-shadow: 0 1px 3px rgba(0,0,0,.28); animation: a-splash-fade .6s .18s ease both;
}
.a-splash-bar {
    width: 140px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.22);
    overflow: hidden; animation: a-splash-fade .6s .3s ease both;
}
.a-splash-bar > span {
    display: block; height: 100%; width: 40%; border-radius: inherit; background: #fff;
    box-shadow: 0 0 14px rgba(255,255,255,.85); animation: a-splash-load 1.15s ease-in-out infinite;
}
@keyframes a-splash-pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes a-splash-glow {
    0%, 100% { box-shadow: 0 18px 44px -14px rgba(0,0,0,.5), 0 0 0 0 rgba(255,255,255,0); }
    50%      { box-shadow: 0 18px 44px -14px rgba(0,0,0,.5), 0 0 42px 3px rgba(255,255,255,.28); }
}
@keyframes a-splash-fade { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes a-splash-load { 0% { transform: translateX(-130%); } 100% { transform: translateX(360%); } }
@media (prefers-reduced-motion: reduce) { .a-splash-icon, .a-splash-name, .a-splash-bar, .a-splash-bar > span { animation: none; } }

/* Bottom tab bar (installed app, phone widths) */
.a-appbar { display: none; }
@media (max-width: 900px) {
    .is-standalone .a-appbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: var(--panel);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .is-standalone .a-main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    /* the top hamburger is redundant with the bottom Menu button in app mode */
    .is-standalone .a-sidebar-toggle { display: none; }
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .is-standalone .a-appbar { background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(14px); }
}
.a-appbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .16rem;
    padding: .5rem 0 .4rem; min-height: 56px;
    color: var(--muted-2); font-size: .62rem; font-weight: 600; letter-spacing: .02em;
    background: none; border: 0; cursor: pointer; text-decoration: none;
}
.a-appbar-item svg { width: 22px; height: 22px; }
.a-appbar-item.is-active { color: var(--brand-soft); }
.a-appbar-item:active { background: rgba(255,255,255,.06); }
.a-appbar-ic { position: relative; display: grid; place-items: center; }
.a-appbar-dot { position: absolute; top: -2px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--panel); }

/* Standalone polish: notch-safe topbar, no rubber-band, no tap flash */
.is-standalone .a-topbar { padding-top: calc(.8rem + env(safe-area-inset-top)); }
.is-standalone { overscroll-behavior: none; }
.is-standalone * { -webkit-tap-highlight-color: transparent; }

/* Blueprint → customize the starter kit (tab on/off checkboxes) */
.a-kitcust-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; flex-wrap: wrap; }
.a-kitcust-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.a-kitcust-group { border: 1px solid var(--border); border-radius: 12px; padding: .55rem .9rem .75rem; margin: 0; min-width: 0; }
.a-kitcust-group legend { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); font-weight: 700; padding: 0 .35rem; }
.a-kitcust-item { display: flex; align-items: center; gap: .5rem; padding: .28rem .25rem; font-size: .9rem; cursor: pointer; border-radius: 7px; }
.a-kitcust-item:hover { background: rgba(255,255,255,.03); }
.a-kitcust-item input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.a-kitcust-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
