/* BookThatGig — Dark neon theme
   ------------------------------------------------------------------ */
:root {
    --bg:          #0d0d0d;
    --bg-2:        #141414;
    --card:        #181818;
    --card-2:      #1f1f1f;
    --border:      #2a2a2a;
    --text:        #ffffff;
    --text-dim:    #b8b8b8;
    --neon-cyan:   #00e5ff;
    --neon-magenta:#ff2bd6;
    --neon-green:  #aaff00;
    --neon-amber:  #ffb300;
    --danger:      #ff4d5e;
    /* Semantic theme vars — overridden at runtime by /assets/theme.css */
    --link:        #00e5ff;
    --nav-bg:      #0d0d0d;
    --nav-text:    #b8b8b8;
    --btn-bg:      #00e5ff;
    --btn-text:    #062023;
    --badge:       #00e5ff;
    --radius:      16px;
    --radius-sm:   10px;
    --maxw:        1120px;
    --shadow-glow: 0 0 0 1px var(--border), 0 8px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.5px; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); }
p  { color: var(--text-dim); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Brand wordmark */
.brand { font-weight: 900; font-size: 1.4rem; letter-spacing: -1px; }
.brand .b { color: var(--neon-cyan); }
.brand .t { color: var(--neon-magenta); }
.brand .g { color: var(--neon-green); }

/* Navbar */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700; font-size: .98rem;
    cursor: pointer; border: 1px solid transparent;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 0 18px rgba(0,229,255,.35); }
.btn-primary:hover { box-shadow: 0 0 28px rgba(0,229,255,.55); }
.btn-magenta { background: var(--neon-magenta); color: #2a0322; box-shadow: 0 0 18px rgba(255,43,214,.35); }
.btn-success { background: #00e5b4; color: #02251e; box-shadow: 0 0 18px rgba(0,229,180,.35); }
.btn-success:hover { box-shadow: 0 0 28px rgba(0,229,180,.55); }
.btn-green { background: var(--neon-green); color: #1c2600; box-shadow: 0 0 18px rgba(170,255,0,.3); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.btn-danger { background: var(--danger); color: #2a0306; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; padding: 15px 30px; font-size: 1.05rem; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-glow);
}

/* Hero */
.hero { position: relative; padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 80px); text-align: center; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(60% 50% at 20% 0%, rgba(0,229,255,.12), transparent 70%),
        radial-gradient(55% 50% at 85% 10%, rgba(255,43,214,.12), transparent 70%);
}
.hero h1 .accent { color: var(--neon-cyan); }
.hero h1 .accent2 { color: var(--neon-magenta); }
.hero .lead { font-size: clamp(1.05rem, 2.5vw, 1.3rem); max-width: 680px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Feature sections */
.section { padding: clamp(40px, 7vw, 84px) 0; }
.feature {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.feature:nth-child(even) .feature-media { order: 2; }
.feature + .feature { margin-top: clamp(36px, 6vw, 72px); }
.feature-eyebrow { color: var(--neon-green); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: .8rem; }
.feature-media {
    border-radius: var(--radius); aspect-ratio: 16 / 9; min-height: 230px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--card-2), var(--bg-2));
    display: grid; place-items: center; position: relative; overflow: hidden;
}
.feature-media .glyph { font-size: 4rem; filter: drop-shadow(0 0 18px rgba(0,229,255,.4)); }
.feature-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.find-out {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
    color: var(--neon-magenta); font-weight: 700;
}
.find-out:hover { color: var(--neon-cyan); text-decoration: none; }
.find-out::after { content: "→"; transition: transform .15s ease; }
.find-out:hover::after { transform: translateX(4px); }

/* Section divider label */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head p { font-size: 1.05rem; }

/* Forms */
.form-wrap { max-width: 720px; margin: 40px auto; }
.form-narrow { max-width: 440px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field.col-2 { grid-column: span 2; }
label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .92rem; }
.req { color: var(--neon-magenta); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], select, textarea {
    width: 100%; padding: 12px 14px; min-height: 46px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 1rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0,229,255,.15);
}
textarea { resize: vertical; min-height: 100px; }
.hint { font-size: .82rem; color: var(--text-dim); margin-top: 6px; }
.char-count { font-size: .8rem; color: var(--text-dim); text-align: right; margin-top: 4px; }

/* Checkbox / radio groups */
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border: 1px solid var(--border);
    border-radius: 999px; cursor: pointer; user-select: none;
    background: var(--bg-2); transition: all .15s ease; min-height: 42px;
}
.choice input { accent-color: var(--neon-cyan); flex: 0 0 auto; width: 16px; height: 16px; min-height: auto; margin: 0; }
.choice:has(input:checked) { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 14px rgba(0,229,255,.2); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toggle-row input { width: auto; min-height: auto; accent-color: var(--neon-magenta); transform: scale(1.3); }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 600; }
.alert-error { background: rgba(255,77,94,.12); border: 1px solid var(--danger); color: #ff9aa4; }
.alert-success { background: rgba(170,255,0,.1); border: 1px solid var(--neon-green); color: #d4ff80; }
.alert-info { background: rgba(0,229,255,.08); border: 1px solid var(--neon-cyan); color: #9fe9f5; }

/* Role chooser */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin: 0 auto; }
.role-card {
    text-align: center; padding: 40px 28px; cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.role-card .glyph { font-size: 3.2rem; margin-bottom: 12px; display: block; }
.role-card:hover { transform: translateY(-4px); border-color: var(--neon-cyan); box-shadow: 0 0 30px rgba(0,229,255,.25); text-decoration: none; }
.role-card h3 { color: var(--text); }

/* Profile picture preview */
.pic-preview {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--neon-cyan); margin-bottom: 12px; background: var(--bg-2);
}

/* App layout (authenticated) */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--nav-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.app-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.app-nav { display: flex; align-items: center; gap: 18px; }
.app-nav a { color: var(--nav-text); font-weight: 600; }
.app-nav a:hover, .app-nav a.active, .app-nav a.on { color: var(--link); text-decoration: none; }
.app-main { padding: 32px 0 64px; }

/* Coming soon panel */
.placeholder-panel { text-align: center; padding: 56px 28px; }
.placeholder-panel .glyph { font-size: 3rem; margin-bottom: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
    background: color-mix(in srgb, var(--badge) 16%, transparent); color: var(--badge); border: 1px solid color-mix(in srgb, var(--badge) 32%, transparent); }

.muted { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.divider { height: 1px; background: var(--border); margin: 28px 0; border: 0; }
.pricing-block { padding: 18px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-dim); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Mobile menu toggle */
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; }

/* Responsive — device-aware */
@media (max-width: 860px) {
    .feature { grid-template-columns: 1fr; gap: 20px; }
    .feature:nth-child(even) .feature-media { order: 0; }
    .role-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .field.col-2 { grid-column: span 1; }
    /* Nudge the sticky app header below the mobile browser chrome / notch so the
       logo and nav links aren't clipped. Falls back to a flat 10px where env() is
       unsupported. */
    .app-header { padding-top: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
    .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
        background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 16px 20px; gap: 10px;
        transform: translateY(-150%); transition: transform .25s ease; }
    .nav-links.open { transform: translateY(0); }
    .nav-links .btn { width: 100%; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .app-nav { gap: 12px; font-size: .9rem; flex-wrap: wrap; }
}
.device-touch .btn:active { transform: scale(.97); }

/* ---- Phase 2: listings, dashboards & billing ---- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; margin-bottom: 6px; }

.btn-sm { padding: 6px 14px; font-size: .85rem; }
.listing-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.listing-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.listing-card { display: flex; flex-direction: column; }
.listing-card-head { display: flex; gap: 12px; align-items: center; }

.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.match-card { display: flex; gap: 12px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.match-pic { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); }
.match-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-bio { color: var(--text-dim); font-size: .88rem; margin: 4px 0 0; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--neon-cyan); margin: 6px 0; }

/* Messaging & notifications (v1.2)
   ------------------------------------------------------------------ */
.nav-msg { position: relative; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--neon-magenta); color: #2a0322;
    border-radius: 999px; font-size: .72rem; font-weight: 800; line-height: 1;
}

/* Thread list */
.thread-list { display: flex; flex-direction: column; gap: 12px; }
.thread-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; color: var(--text);
    transition: border-color .15s ease, transform .12s ease;
}
.thread-item:hover { text-decoration: none; border-color: var(--neon-cyan); transform: translateY(-1px); }
.thread-item.is-unread { border-color: var(--neon-magenta); }
.thread-item .match-pic { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.thread-main { flex: 1 1 auto; min-width: 0; }
.thread-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.thread-when { font-size: .8rem; flex: 0 0 auto; }
.thread-sub { font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.thread-preview { margin: .35rem 0 0; color: var(--text-dim); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-unread {
    flex: 0 0 auto; min-width: 24px; height: 24px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--neon-magenta); color: #2a0322; font-weight: 800;
    border-radius: 999px; font-size: .8rem;
}
.badge-dim     { background: var(--card-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Conversation view */
.msg-head { display: flex; }
.msg-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.msg-thread {
    display: flex; flex-direction: column; gap: 10px;
    max-height: 60vh; overflow-y: auto; padding: 4px;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    padding-top: 16px; padding-bottom: 16px;
}
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.msg-bubble {
    max-width: 78%; padding: 10px 14px; border-radius: 14px;
    font-size: .95rem; line-height: 1.45; word-wrap: break-word;
}
.msg-row.theirs .msg-bubble { background: var(--card-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-row.mine .msg-bubble { background: var(--neon-cyan); color: #062023; border-bottom-right-radius: 4px; }
.msg-time { display: block; margin-top: 6px; font-size: .72rem; opacity: .7; }
.msg-closed-banner {
    background: var(--card-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px; color: var(--text-dim); text-align: center;
}
.msg-compose { display: flex; gap: 12px; align-items: flex-end; }
.msg-compose textarea {
    flex: 1 1 auto; resize: vertical; min-height: 52px;
    background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; font: inherit;
}
.msg-compose textarea:focus { outline: none; border-color: var(--neon-cyan); }
.listing-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) {
    .msg-compose { flex-direction: column; align-items: stretch; }
    .msg-bubble { max-width: 88%; }
}

/* ---- Phase 4: search, applications, availability (v1.3) ---- */
.search-panel[hidden] { display: none; }
.detail-wrap { max-width: 760px; margin: 0 auto; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 24px; }
.detail-facts .section-label { display: block; margin-bottom: 2px; }

.profile-hero { display: flex; gap: 16px; align-items: center; }
.profile-pic { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .82rem;
        background: var(--bg-2); border: 1px solid var(--border); color: var(--text-dim); }

/* Application status badges */
.status-pending  { background: var(--card-2); color: var(--text-dim); border: 1px solid var(--border); }
.status-viewed   { background: rgba(0,229,255,.15); color: var(--neon-cyan); border: 1px solid rgba(0,229,255,.4); }
.status-invited  { background: rgba(170,255,0,.16); color: var(--neon-green); border: 1px solid rgba(170,255,0,.4); }
.status-declined { background: rgba(255,77,94,.14); color: var(--danger); border: 1px solid rgba(255,77,94,.4); }
.status-hired    { background: rgba(0,229,180,.16); color: #00e5b4; border: 1px solid rgba(0,229,180,.4); }

/* Availability calendar — timeslot grid */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* Slot grid: 8 columns — label col + 7 day cols */
.cal-grid {
    display: grid;
    grid-template-columns: 72px repeat(7, 1fr);
    gap: 4px;
}
.cal-corner { /* top-left blank corner */ }
.cal-dow { text-align: center; font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; padding: 2px 0; }
.cal-slot-label { font-size: .68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em;
                  display: flex; align-items: center; padding-right: 4px; line-height: 1.2; }
.cal-cell { min-height: 30px; display: flex; align-items: center; justify-content: center;
            border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); font-size: .75rem; }
.cal-empty { background: transparent; border: 0; }
.cal-editable { cursor: pointer; transition: border-color .12s ease; }
.cal-editable:hover { border-color: var(--neon-cyan); }
.cal-available { background: rgba(170,255,0,.18); border-color: rgba(170,255,0,.5); color: var(--neon-green); }
.cal-tentative { background: rgba(255,179,0,.16); border-color: rgba(255,179,0,.5); color: var(--neon-amber); }
.cal-booked    { background: rgba(255,77,94,.16); border-color: rgba(255,77,94,.5); color: var(--danger); }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cal-legend .chip { font-size: .76rem; }

.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s ease; }

/* ---------- Phase 5: reviews, ratings, gallery, favorites ---------- */
.rating { display: inline-flex; align-items: center; gap: 8px; }
.stars { position: relative; display: inline-block; font-size: 1.05rem; line-height: 1; white-space: nowrap; }
.stars-base { color: var(--border); }
.stars-fill { position: absolute; top: 0; left: 0; width: 0; overflow: hidden; color: #ffd23f; }
.rating-label { font-size: .85rem; color: var(--text-dim); }

.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.review-item { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.review-author { font-weight: 700; color: var(--text); }
.review-date { font-size: .78rem; color: var(--text-dim); margin-top: 6px; }
.review-body { margin-top: 6px; color: var(--text); }

.review-ops { display: flex; flex-direction: column; gap: 12px; }
.review-op-card { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.review-form-wrap { margin-top: 8px; }
.review-form-wrap > summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer; }
.review-form-wrap > summary::-webkit-details-marker { display: none; }
.review-form { display: flex; flex-direction: column; gap: 8px; max-width: 440px; }
.review-form textarea { width: 100%; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-start; }
.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-input label { font-size: 1.7rem; line-height: 1; color: var(--border); cursor: pointer; padding: 0 2px; transition: color .12s ease; }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #ffd23f; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 8px; }
.gallery-item { position: relative; display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.gallery-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.gallery-manage .gallery-item { cursor: grab; }
.gallery-manage .gallery-item.dragging { opacity: .45; }
.gallery-item-del { position: absolute; top: 6px; right: 6px; margin: 0; }
.gallery-item-del button { padding: 2px 8px; line-height: 1.2; background: rgba(0,0,0,.55); }
.media-links { display: flex; flex-direction: column; gap: 8px; }
.media-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.media-link a { font-weight: 600; word-break: break-word; }
.media-link form { margin: 0; }
.link-add-grid { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 10px; align-items: end; }
@media (max-width: 560px) { .link-add-grid { grid-template-columns: 1fr; } }

/* ---- Favorites (save / shortlist) ---- */
.fav-form { display: inline; margin: 0; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; }
.fav-btn .fav-heart { font-size: 1.05em; line-height: 1; }
.fav-btn.is-saved { border-color: var(--neon-magenta); color: var(--neon-magenta); box-shadow: 0 0 12px rgba(255,43,214,.25); }
.fav-btn.is-saved .fav-heart { color: var(--neon-magenta); }

/* ---- Reports (flag a profile / listing) ---- */
.report-footer { text-align: right; }
.report-form-wrap { display: inline-block; margin-top: 8px; }
.report-form-wrap > summary { list-style: none; cursor: pointer; }
.report-form-wrap > summary::-webkit-details-marker { display: none; }
.report-link { font-size: .8rem; opacity: .6; }
.report-link:hover { opacity: 1; color: var(--neon-magenta); }
.report-form { max-width: 380px; margin-left: auto; text-align: left; }

/* ============================================================
   Admin panel (v1.5)
   ============================================================ */
.admin-header { background: var(--nav-bg); }
.admin-tag { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:6px; font-size:.62rem;
    font-weight:800; text-transform:uppercase; letter-spacing:1px; background:var(--neon-magenta); color:#2a0322; vertical-align:middle; }

.dash-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:4px; }

/* Stat cards */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:14px; }
.stat-card { display:flex; flex-direction:column; gap:4px; padding:18px; background:var(--card);
    border:1px solid var(--border); border-radius:var(--radius-sm); text-decoration:none;
    transition:transform .12s ease, border-color .2s ease; }
a.stat-card:hover { border-color:var(--link); text-decoration:none; transform:translateY(-1px); }
.stat-num { font-size:1.8rem; font-weight:800; color:var(--text); line-height:1; }
.stat-label { color:var(--text-dim); font-size:.85rem; }
.stat-card-flag { flex-direction:row; align-items:center; gap:14px; }
.stat-card-flag .stat-num { font-size:1.6rem; }
.stat-card-flag.is-active { border-color:var(--neon-magenta); box-shadow:0 0 18px rgba(255,43,214,.25); }

/* Tables */
.table-wrap { overflow-x:auto; }
.admin-table { width:100%; border-collapse:collapse; font-size:.92rem; }
.admin-table th, .admin-table td { padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.admin-table th { color:var(--text-dim); font-size:.76rem; text-transform:uppercase; letter-spacing:.5px; white-space:nowrap; }
.admin-table th a { color:var(--text-dim); }
.admin-table th a:hover { color:var(--link); text-decoration:none; }
.admin-table tbody tr:hover { background:var(--bg-2); }
.ta-right { text-align:right; }

/* Search / filter bars */
.admin-search { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:0; }
.admin-search input, .admin-search select { min-height:40px; padding:8px 10px; background:var(--bg-2);
    border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); }

.btn-sm { min-height:36px; padding:7px 14px; font-size:.85rem; }

/* Reports */
.report-card { display:flex; gap:16px; justify-content:space-between; align-items:flex-start; }
.report-card.is-reviewed { opacity:.68; }
.report-main { display:flex; flex-direction:column; gap:6px; }
.report-reason { color:var(--text); }
.report-note { font-size:.9rem; }
.report-side { display:flex; flex-direction:column; align-items:flex-end; gap:6px; text-align:right; }

/* Segmented control */
.seg { display:inline-flex; gap:6px; }

/* Pagination */
.pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.pagination-info { font-size:.85rem; }
.pagination-controls { display:flex; align-items:center; gap:10px; }
.pagination-page { font-size:.85rem; white-space:nowrap; }
.btn.is-disabled { opacity:.4; pointer-events:none; cursor:default; }

/* Layout helpers */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.card-title { margin:0 0 14px; font-size:1.1rem; }

/* References editor */
.ref-list { display:flex; flex-direction:column; gap:8px; }
.ref-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px;
    border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-2); flex-wrap:wrap; }
.ref-row.is-hidden { opacity:.55; }
.ref-edit { display:flex; gap:8px; align-items:center; margin:0; flex:1 1 auto; flex-wrap:wrap; }
.ref-edit input[type=text] { flex:1 1 140px; }
.ref-row input, .ref-add input { min-height:38px; padding:7px 10px; background:var(--card);
    border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); }
.ref-row-side { display:flex; align-items:center; gap:8px; }
.ref-add { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.ref-add input[type=text] { flex:1 1 160px; }

/* Stacked form labels (SMTP, theme preset) — admin only */
body.admin .card label { display:block; margin-bottom:12px; font-weight:600; color:var(--text); }
body.admin .card label input:not([type=radio]):not([type=checkbox]), body.admin .card label select { display:block; width:100%; margin-top:6px;
    min-height:42px; padding:9px 11px; background:var(--bg-2); border:1px solid var(--border);
    border-radius:var(--radius-sm); color:var(--text); font-weight:400; }
body.admin .card label.check { display:flex; align-items:center; gap:8px; font-weight:400; }
body.admin .card label.check input { width:auto; min-height:auto; margin:0; }
body.admin .card label.choice { display:inline-flex; align-items:center; gap:8px; margin-bottom:0; }
body.admin .card hr { border:0; border-top:1px solid var(--border); margin:16px 0; }

/* Theme editor */
.theme-vars { display:flex; flex-direction:column; gap:10px; }
.theme-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
body.admin .theme-row label { margin:0; }
.theme-inputs { display:flex; align-items:center; gap:8px; }
.theme-inputs input[type=color] { width:42px; height:38px; padding:2px; border:1px solid var(--border);
    border-radius:8px; background:var(--bg-2); cursor:pointer; }
.theme-inputs input[type=text] { width:104px; min-height:38px; padding:7px 9px; background:var(--bg-2);
    border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-family:monospace; }

/* Theme live preview */
.theme-preview { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; background:var(--bg); }
.tp-nav { display:flex; align-items:center; gap:14px; padding:12px 16px; background:var(--nav-bg); border-bottom:1px solid var(--border); }
.tp-brand { font-weight:800; color:var(--neon-magenta); }
.tp-navlink { color:var(--nav-text); font-weight:600; font-size:.9rem; }
.tp-badge { margin-left:auto; background:var(--badge); color:#03191c; border-radius:999px; padding:2px 9px; font-size:.75rem; font-weight:800; }
.tp-card { margin:16px; padding:16px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); }
.tp-heading { margin:0 0 8px; color:var(--text); }
.tp-text { color:var(--text); opacity:.85; margin:0 0 10px; font-size:.92rem; }
.tp-link { color:var(--link); font-weight:600; }
.tp-actions { display:flex; align-items:center; gap:10px; margin-top:10px; }
.tp-btn { background:var(--btn-bg); color:var(--btn-text); border-radius:var(--radius-sm); padding:9px 16px; font-weight:700; font-size:.9rem; }
.tp-chip { border:1px solid var(--border); color:var(--text-dim); border-radius:999px; padding:4px 12px; font-size:.82rem; }

@media (max-width:760px) {
    .grid-2 { grid-template-columns:1fr; }
    .theme-layout { grid-template-columns:1fr; }
}

/* ── Flash message marquee ───────────────────────────────────────────────────
   Fixed announcement bar pinned just under the (sticky) site/app header. JS
   (initFlashMarquee in app.js) sets the bar's `top` to the live header height,
   scrolls the text right→left at a readable pace and repeats ~2s after it clears
   the left edge. The spacer reserves the bar height in normal flow so page
   content is never hidden behind the fixed bar. */
:root { --flash-h: 42px; }
.flash-bar {
    position: fixed; left: 0; right: 0; top: 64px; height: var(--flash-h);
    z-index: 40; overflow: hidden;
    background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.flash-bar-inner {
    position: absolute; top: 0; left: 0; height: 100%;
    display: inline-flex; align-items: center;
    white-space: nowrap; will-change: transform;
    transform: translateX(100vw); /* parked off-screen right until JS starts it */
}
.flash-text {
    color: #0d0d0d; font-weight: 800; font-size: .95rem; letter-spacing: .3px;
    text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.flash-spacer { height: var(--flash-h); }

/* Static fallback (no Web Animations API, applied by JS via .is-static) — show
   the message centered and clipped instead of scrolling, so it is never parked
   off-screen and left invisible. */
.flash-bar.is-static .flash-bar-inner {
    position: static; transform: none !important;
    justify-content: center; width: 100%; padding: 0 14px;
}
.flash-bar.is-static .flash-text { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
    /* No scrolling for reduced-motion users: show the message statically,
       centered, and clipped with an ellipsis if it is too long. */
    .flash-bar-inner {
        position: static; transform: none !important;
        justify-content: center; width: 100%; padding: 0 14px;
    }
    .flash-text { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
