/* =============================================================================
   Saypeace Society Platform — base stylesheet (vanilla CSS, design tokens)
   -----------------------------------------------------------------------------
   No build step. This file is linked directly with an asset() + ?v=filemtime
   cache-bust. Per-tenant branding (Phase 05) overrides --color-primary via a
   single injected <style> block, so keep everything below driven by the tokens.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
    /* Brand (swapped per tenant in Phase 05) */
    --color-primary: #16a34a;
    --color-primary-dark: #15803d;
    --color-primary-light: #dcfce7;
    --color-on-primary: #ffffff;

    /* Neutrals / surfaces */
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-bg: #ffffff;
    --color-surface: #f9fafb;
    --color-border: #e5e7eb;

    /* Feedback */
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-info: #2563eb;

    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height: 1.6;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;

    /* Radius / shadow / layout */
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --container-max: 1120px;
}

/* Central control-plane accent (superadmin layout sets <body class="theme-superadmin">) */
.theme-superadmin {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
}

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

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img,
picture,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 var(--space-4);
}

p {
    margin: 0 0 var(--space-4);
}

/* ---- Layout -------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.site-main {
    flex: 1 0 auto;
    padding-block: var(--space-8);
}

.stack > * + * {
    margin-top: var(--space-4);
}

/* ---- Navigation ---------------------------------------------------------- */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-3);
    flex-wrap: wrap;
}

.site-nav .brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--color-text-muted);
}

.site-nav a:hover {
    color: var(--color-primary-dark);
    text-decoration: none;
}

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    padding-block: var(--space-6);
    font-size: 0.9rem;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font: inherit;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary-light);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---- Cards --------------------------------------------------------------- */
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

/* ---- Forms --------------------------------------------------------------- */
label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

input,
select,
textarea {
    width: 100%;
    padding: var(--space-3);
    font: inherit;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

.field + .field {
    margin-top: var(--space-4);
}

.form-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: var(--space-1);
}

/* ---- Alerts -------------------------------------------------------------- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.alert-success { border-color: var(--color-success); background: var(--color-primary-light); }
.alert-danger  { border-color: var(--color-danger);  color: var(--color-danger); }
.alert-warning { border-color: var(--color-warning); color: var(--color-warning); }

/* ---- Hero (placeholder / marketing) -------------------------------------- */
.hero {
    text-align: center;
    padding-block: var(--space-12);
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.hero .lede {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    max-width: 46ch;
    margin-inline: auto;
}

/* ---- Utilities ----------------------------------------------------------- */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- Control plane (superadmin) ----------------------------------------- */
.inline-form { display: inline; margin: 0; }

/* A <button> that reads like a nav link (used for logout inside a POST form). */
.linkish {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--color-text-muted);
    cursor: pointer;
}
.linkish:hover { color: var(--color-primary-dark); text-decoration: underline; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.btn-sm { padding: var(--space-2) var(--space-3); font-size: 0.85rem; }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; }

/* Stat cards on the dashboard. */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
}
.stat { text-align: left; }
.stat .num { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--color-text-muted); font-size: 0.9rem; }

/* Data tables. */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
.table tbody tr:hover { background: var(--color-surface); }

/* Status pills. */
.pill { display: inline-block; padding: var(--space-1) var(--space-2); border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pill-on  { background: var(--color-primary-light); color: var(--color-primary-dark); }
.pill-off { background: #f3f4f6; color: var(--color-text-muted); }

/* Two-column form grid. */
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }

/* Module checklist. */
.module-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2); }
.module-list label { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; margin: 0; }
.module-list input { width: auto; }

/* One-time credential reveal after provisioning. */
.temp-cred {
    border: 1px solid var(--color-warning);
    background: #fffbeb;
    border-radius: var(--radius);
    padding: var(--space-4);
}
.temp-cred code {
    display: inline-block;
    background: var(--color-text);
    color: #fff;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.dl-inline { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
.dl-inline dt { font-weight: 600; color: var(--color-text-muted); }
.dl-inline dd { margin: 0; }

/* Status pill variants (website-request lifecycle). */
.pill-warn   { background: #fef3c7; color: #92400e; }
.pill-info   { background: var(--color-primary-light); color: var(--color-primary-dark); }
.pill-danger { background: #fee2e2; color: #991b1b; }

/* ---- Marketing site (central plane) -------------------------------------- */
.feature-grid,
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-block: var(--space-8);
}

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    background: var(--color-surface);
}

/* Numbered "how it works" steps. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.steps li { display: flex; align-items: flex-start; gap: var(--space-4); }
.step-num {
    flex-shrink: 0;
    width: 2.25rem; height: 2.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: var(--color-primary); color: var(--color-on-primary);
    font-weight: 700;
}
.steps h3, .steps p { margin: 0; }

/* Pricing cards. */
.price-card { display: flex; flex-direction: column; gap: var(--space-3); }
.price-card .price { font-size: 1.75rem; font-weight: 700; margin: 0; color: var(--color-text); }
.price-card .btn { margin-top: auto; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.check-list li { padding-left: 1.4rem; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--color-primary); font-weight: 700; }

/* Auth cards (login / register / reset). */
.auth-card { max-width: 26rem; margin-inline: auto; }
.checkbox-inline { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; margin: 0; }
.checkbox-inline input { width: auto; }

/* Contact two-column. */
.two-col { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }

/* Request-queue filter bar. */
.filter-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.filter-bar select { width: auto; }

/* ---- Responsive ---------------------------------------------------------- */
@media (min-width: 640px) {
    .site-nav {
        flex-wrap: nowrap;
    }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .col-span-2 { grid-column: 1 / -1; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    .pricing-grid { grid-template-columns: repeat(3, 1fr); }
    .two-col { grid-template-columns: 1fr 1fr; }
}

/* =============================================================================
   Tenant public site (Phase 05) — the "learned society" identity
   -----------------------------------------------------------------------------
   Scoped under body[data-layout="tenant-public"] so nothing here leaks into the
   central/marketing or admin planes. Everything derives from --color-primary /
   --color-secondary, which the layout overrides per tenant, so one society's
   green and another's burgundy both reskin the whole site with zero extra CSS.
   Serif display headings (institutional gravitas) over the system-sans body.
   ========================================================================== */
body[data-layout="tenant-public"] {
    --tp-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --tp-ink: color-mix(in srgb, var(--color-primary) 12%, #101418);
    --tp-tint: color-mix(in srgb, var(--color-primary) 6%, #ffffff);
    --tp-tint-strong: color-mix(in srgb, var(--color-primary) 14%, #ffffff);
    --tp-line: color-mix(in srgb, var(--color-primary) 14%, #e6e8ea);
    --tp-footer-bg: color-mix(in srgb, var(--color-secondary) 92%, #000000);
    --tp-footer-ink: color-mix(in srgb, var(--color-secondary) 18%, #f6f7f8);

    color: var(--color-text);
    background: var(--color-bg);
}

/* Accessible skip link — visible only when focused. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary-dark);
    color: #ffffff;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
    left: 0;
    text-decoration: none;
}

/* ---- Header / nav --------------------------------------------------------- */
.tp-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, #ffffff 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tp-line);
}

.tp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 4.25rem;
    flex-wrap: wrap;
    padding-block: var(--space-2);
}

.tp-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--tp-ink);
    font-weight: 700;
    min-width: 0;
}
.tp-brand:hover { text-decoration: none; }

.tp-brand-logo {
    height: 2.5rem;
    width: auto;
    max-width: 3.5rem;
    object-fit: contain;
}

.tp-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-family: var(--tp-display);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.tp-brand-name {
    font-family: var(--tp-display);
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.tp-nav a {
    display: inline-block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.tp-nav a:hover {
    color: var(--tp-ink);
    background: var(--tp-tint);
    text-decoration: none;
}
.tp-nav a.is-active {
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    font-weight: 600;
}

/* Mobile nav toggle: only shown (and nav only collapsed) when JS is available,
   so the site stays fully navigable without JavaScript. */
.tp-nav-toggle { display: none; }

@media (max-width: 767px) {
    html.js .tp-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        background: none;
        border: 1px solid var(--tp-line);
        border-radius: var(--radius-sm);
        padding: var(--space-2) var(--space-3);
        font: inherit;
        font-size: 0.9rem;
        color: var(--tp-ink);
        cursor: pointer;
    }

    .tp-nav-toggle-bar,
    .tp-nav-toggle-bar::before,
    .tp-nav-toggle-bar::after {
        content: "";
        display: block;
        width: 1.1rem;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        position: relative;
    }
    .tp-nav-toggle-bar::before { position: absolute; top: -5px; }
    .tp-nav-toggle-bar::after { position: absolute; top: 5px; }

    html.js .tp-nav {
        display: none;
        width: 100%;
    }
    html.js .tp-nav.is-open { display: block; }

    .tp-nav ul {
        flex-direction: column;
        gap: 0;
        padding-block: var(--space-2);
        border-top: 1px solid var(--tp-line);
    }
    .tp-nav a { display: block; padding: var(--space-3); }
}

/* ---- Type & shared blocks -------------------------------------------------- */
.tp-main { flex: 1 0 auto; }

.tp-flash { margin-top: var(--space-4); }

.tp-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-2);
}

.tp-heading {
    font-family: var(--tp-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    color: var(--tp-ink);
    text-wrap: balance;
    margin-bottom: var(--space-3);
}

.tp-textlink {
    font-weight: 600;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

.tp-section { padding-block: var(--space-12); }
.tp-section-tint { background: var(--tp-tint); }

.tp-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}
.tp-section-head .tp-heading { margin-bottom: 0; }

.tp-empty {
    text-align: center;
    padding-block: var(--space-12);
}

/* ---- Hero ------------------------------------------------------------------ */
.tp-hero {
    background:
        radial-gradient(60rem 30rem at 110% -20%, var(--tp-tint-strong), transparent 60%),
        linear-gradient(180deg, var(--tp-tint), var(--color-bg));
    border-bottom: 1px solid var(--tp-line);
}

.tp-hero-inner {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

.tp-hero-copy { max-width: 38rem; }

.tp-hero-title {
    font-family: var(--tp-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.12;
    color: var(--tp-ink);
    text-wrap: balance;
    margin-bottom: var(--space-4);
}

.tp-hero-lede {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    max-width: 34rem;
    margin-bottom: var(--space-6);
}

.tp-hero-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.tp-hero-crest {
    margin-left: auto;
    flex-shrink: 0;
    width: clamp(9rem, 18vw, 14rem);
    aspect-ratio: 1;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: color-mix(in srgb, #ffffff 65%, transparent);
    border: 1px solid var(--tp-line);
    border-radius: 50%;
    box-shadow: var(--shadow);
}
.tp-hero-crest img { max-height: 100%; object-fit: contain; }

@media (min-width: 768px) {
    .tp-hero-crest { display: flex; }
}

/* ---- Home hero slider ------------------------------------------------------
   Slides are stacked and cross-faded (opacity), never reflowed, so the band height
   is stable and there is no layout shift between slides. Copy sits on a left-to-
   right scrim so any photo keeps the text readable. Without JS the first slide is
   the only .is-active one and the band degrades to a static image hero.
   -------------------------------------------------------------------------- */
.tp-slider {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--tp-ink);
    border-bottom: 1px solid var(--tp-line);
}

.tp-slider-track {
    position: relative;
    display: grid;
    min-height: clamp(20rem, 56vw, 34rem);
}

/* Every slide occupies the same grid cell; only the active one is visible. */
.tp-slide {
    grid-area: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms ease, visibility 0s linear 700ms;
}

.tp-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 700ms ease, visibility 0s;
}

.tp-slide-img {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scrim: dark enough on the copy side for AA contrast on any photograph. */
.tp-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        90deg,
        rgba(6, 20, 14, 0.82) 0%,
        rgba(6, 20, 14, 0.62) 42%,
        rgba(6, 20, 14, 0.15) 100%
    );
}

.tp-slide-inner { padding-block: clamp(3rem, 7vw, 5rem); }

.tp-slide-copy { max-width: 40rem; }

.tp-slide-title {
    font-family: var(--tp-display);
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    line-height: 1.14;
    color: #ffffff;
    text-wrap: balance;
    margin-bottom: var(--space-4);
}

.tp-slide-lede {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    max-width: 34rem;
    margin-bottom: var(--space-6);
}

/* ---- Slider controls ---- */
.tp-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    cursor: pointer;
    transition: background 160ms ease;
}

.tp-slider-arrow:hover,
.tp-slider-arrow:focus-visible { background: rgba(0, 0, 0, 0.6); }

.tp-slider-prev { left: var(--space-3); }
.tp-slider-next { right: var(--space-3); }

.tp-slider-dots {
    position: absolute;
    left: 50%;
    bottom: var(--space-4);
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: var(--space-2);
}

.tp-slider-dot {
    width: 0.7rem;
    height: 0.7rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.tp-slider-dot.is-active {
    background: #ffffff;
    transform: scale(1.25);
}

@media (max-width: 640px) {
    .tp-slider-arrow { display: none; }
    .tp-slide::before {
        background: linear-gradient(180deg, rgba(6, 20, 14, 0.45) 0%, rgba(6, 20, 14, 0.85) 100%);
    }
}

/* No cross-fade for readers who asked for less motion (the JS also stops autoplay). */
@media (prefers-reduced-motion: reduce) {
    .tp-slide { transition: none; }
    .tp-slide.is-active { transition: none; }
}

/* ---- Page hero (inner pages) ----------------------------------------------- */
.tp-page-hero {
    background: linear-gradient(180deg, var(--tp-tint), var(--color-bg));
    border-bottom: 1px solid var(--tp-line);
    padding-block: clamp(2.25rem, 5vw, 3.5rem);
}

.tp-page-title {
    font-family: var(--tp-display);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.15;
    color: var(--tp-ink);
    text-wrap: balance;
    margin: 0;
}

/* ---- About: section nav + prose -------------------------------------------- */
.tp-about-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-block: var(--space-8);
}

.tp-section-nav-label {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.tp-section-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-1);
}

.tp-section-nav a {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-left: 2px solid var(--tp-line);
    color: var(--color-text-muted);
    font-size: 0.95rem;
}
.tp-section-nav a:hover {
    color: var(--color-primary-dark);
    border-left-color: var(--color-primary);
    text-decoration: none;
}

.tp-prose-column { max-width: 70ch; }

.tp-prose-section {
    scroll-margin-top: 6rem;
    padding-block: var(--space-6);
}
.tp-prose-section + .tp-prose-section { border-top: 1px solid var(--tp-line); }

.tp-prose {
    line-height: 1.75;
    color: var(--color-text);
}

@media (min-width: 900px) {
    .tp-about-layout { grid-template-columns: 14rem minmax(0, 1fr); }
    .tp-section-nav {
        position: sticky;
        top: 5.5rem;
        align-self: start;
    }
}

/* ---- About teaser (home) ---------------------------------------------------- */
.tp-about-teaser {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: start;
}
.tp-about-teaser-body p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--color-text-muted);
}
@media (min-width: 768px) {
    .tp-about-teaser { grid-template-columns: 1fr 1.6fr; }
}

/* ---- Cards (news & events) --------------------------------------------------- */
.tp-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}
@media (min-width: 640px) { .tp-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tp-card-grid { grid-template-columns: repeat(3, 1fr); } }

.tp-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--tp-line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.tp-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
    .tp-card, .tp-card:hover { transition: none; transform: none; }
}

.tp-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--tp-tint-strong);
}
.tp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tp-card-media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--tp-display);
    font-size: 2.5rem;
    color: color-mix(in srgb, var(--color-primary) 45%, #ffffff);
}

.tp-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-6);
}

.tp-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.tp-pill {
    display: inline-block;
    padding: 0.15rem var(--space-2);
    border-radius: 999px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tp-card-title {
    font-family: var(--tp-display);
    font-size: 1.15rem;
    line-height: 1.35;
    margin: 0;
}
.tp-card-title a { color: var(--tp-ink); }
.tp-card-title a:hover { color: var(--color-primary-dark); text-decoration: none; }

.tp-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- Category filter chips ---------------------------------------------------- */
.tp-filter {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-8);
}

.tp-chip {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--tp-line);
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.tp-chip:hover {
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
    text-decoration: none;
}
.tp-chip.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 600;
}

/* ---- EXCO grid ----------------------------------------------------------------- */
.tp-exco-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}
@media (min-width: 768px) { .tp-exco-grid { grid-template-columns: repeat(4, 1fr); } }

.tp-exco { text-align: center; }

.tp-exco-photo {
    width: min(9.5rem, 60%);
    aspect-ratio: 1;
    margin-inline: auto;
    margin-bottom: var(--space-3);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary-light);
    background: var(--tp-tint-strong);
}
.tp-exco-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tp-exco-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--tp-display);
    font-size: 2rem;
    color: var(--color-primary-dark);
}

.tp-exco-name {
    font-family: var(--tp-display);
    font-size: 1.05rem;
    margin: 0 0 var(--space-1);
    color: var(--tp-ink);
}
.tp-exco-position {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0;
}
.tp-exco-term {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: var(--space-1) 0 0;
}

.tp-past-council {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--tp-line);
}

/* ---- Article (news detail) ------------------------------------------------------ */
.tp-article { padding-block: var(--space-8); }

.tp-article-head {
    max-width: 46rem;
    margin-bottom: var(--space-6);
}
.tp-article-head .tp-card-meta { margin-bottom: var(--space-3); }
.tp-article-head .tp-page-title { margin-bottom: var(--space-4); }

.tp-event-facts {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
    margin: 0;
    padding: var(--space-4);
    background: var(--tp-tint);
    border: 1px solid var(--tp-line);
    border-radius: var(--radius);
}
.tp-event-facts dt {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
}
.tp-event-facts dd {
    margin: var(--space-1) 0 0;
    font-weight: 600;
    color: var(--tp-ink);
}

.tp-article-cover {
    margin: 0 0 var(--space-6);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--tp-line);
}

.tp-article-back { margin-top: var(--space-8); }

/* ---- Contact -------------------------------------------------------------------- */
.tp-contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: start;
}
@media (min-width: 900px) { .tp-contact-layout { grid-template-columns: 1fr 1.4fr; } }

.tp-contact-list {
    display: grid;
    gap: var(--space-4);
    margin: 0;
}
.tp-contact-list dt {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
}
.tp-contact-list dd {
    margin: var(--space-1) 0 0;
    font-size: 1.05rem;
}

.tp-contact-form .field { margin-top: var(--space-4); }
.tp-contact-form .btn { margin-top: var(--space-6); }

.tp-optional {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ---- CTA band -------------------------------------------------------------------- */
.tp-cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
    padding: var(--space-8);
    background: var(--tp-tint);
    border: 1px solid var(--tp-line);
    border-radius: var(--radius);
}
.tp-cta-band .tp-heading { margin-bottom: var(--space-2); }
.tp-cta-band p { margin: 0; max-width: 34rem; }

/* ---- Pagination ------------------------------------------------------------------ */
.tp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

.tp-page-btn {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--tp-line);
    border-radius: var(--radius-sm);
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}
.tp-page-btn:hover { background: var(--tp-tint); text-decoration: none; }
.tp-page-btn.is-disabled {
    color: var(--color-text-muted);
    opacity: 0.5;
    pointer-events: none;
}

.tp-page-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ---- Footer ------------------------------------------------------------------------ */
.tp-footer {
    flex-shrink: 0;
    margin-top: var(--space-12);
    background: var(--tp-footer-bg);
    color: var(--tp-footer-ink);
    font-size: 0.95rem;
}

.tp-footer a { color: inherit; }
.tp-footer a:hover { color: #ffffff; }

.tp-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-block: var(--space-12) var(--space-8);
}
@media (min-width: 768px) { .tp-footer-grid { grid-template-columns: 2fr 1fr 1.4fr; } }

.tp-footer-name {
    font-family: var(--tp-display);
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: var(--space-2);
}
.tp-footer-tagline {
    margin: 0;
    opacity: 0.85;
    max-width: 30rem;
}

.tp-footer-heading {
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.7;
    margin-bottom: var(--space-3);
}

.tp-footer-links ul,
.tp-footer-contact ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
}

.tp-footer-address { white-space: pre-line; }

.tp-social {
    list-style: none;
    display: flex;
    gap: var(--space-4);
    margin: var(--space-4) 0 0;
    padding: 0;
}
.tp-social a { font-weight: 600; }

.tp-footer-legal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding-block: var(--space-4);
    border-top: 1px solid color-mix(in srgb, #ffffff 14%, transparent);
    font-size: 0.85rem;
    opacity: 0.8;
}
.tp-footer-legal p { margin: 0; }

/* =============================================================================
   Tenant CMS (Phase 06) — admin-only affordances.
   ========================================================================== */
.drag-handle { cursor: grab; color: var(--color-text-muted); user-select: none; width: 1.5rem; text-align: center; }

/* Row thumbnail for image-bearing CMS lists (hero slides). */
.adm-thumb {
    width: 7rem;
    height: 4rem;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    display: block;
}
table[data-sortable] tbody tr { cursor: default; }
table[data-sortable] tbody tr.is-dragging { opacity: 0.5; background: var(--color-primary-light); }
.card.is-unread { border-left: 3px solid var(--color-primary); }
fieldset { border: 1px solid var(--color-border, #e2e8f0); border-radius: var(--radius, 8px); padding: var(--space-4); }
fieldset legend { padding: 0 var(--space-2); }

/* =============================================================================
   Membership module (Phase 07) — public plans, directory, member area helpers.
   ========================================================================== */

/* Small shared helpers */
.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin: var(--space-1) 0 0; }
.form-thumb { display: block; width: 6rem; height: 6rem; object-fit: cover; border-radius: var(--radius); margin-bottom: var(--space-2); border: 1px solid var(--color-border); }
.pill-success { background: var(--color-primary-light); color: var(--color-primary-dark); }
.pill-muted { background: #f3f4f6; color: var(--color-text-muted); }

/* Definition-list detail layout (member/admin detail cards) */
.detail-list { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin: var(--space-4) 0 0; }
@media (min-width: 640px) { .detail-list { grid-template-columns: repeat(2, 1fr); } }
.detail-list > div { display: flex; flex-direction: column; gap: 2px; }
.detail-list dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.detail-list dd { margin: 0; font-weight: 500; }

/* Public membership plans */
.tp-page-lead { margin: var(--space-3) 0 0; max-width: 42rem; color: var(--color-text-muted); }
.tp-section-narrow { max-width: 48rem; margin-inline: auto; }
.tp-cta { margin-top: var(--space-8); text-align: center; }

.tp-plan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}
@media (min-width: 640px) { .tp-plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tp-plan-grid { grid-template-columns: repeat(3, 1fr); } }

.tp-plan {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.tp-plan-name { font-family: var(--tp-display); font-size: 1.25rem; margin: 0; color: var(--tp-ink); }
.tp-plan-fee { margin: 0; }
.tp-plan-amount { font-size: 1.5rem; font-weight: 700; color: var(--color-primary-dark); }
.tp-plan-period { color: var(--color-text-muted); font-size: 0.85rem; margin-left: var(--space-1); }
.tp-plan-desc { margin: 0; color: var(--color-text-muted); }
.tp-plan-benefits { font-size: 0.9rem; line-height: 1.6; }
.tp-plan .btn { margin-top: auto; }

/* Directory search bar */
.tp-search { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-8); }
.tp-search input[type="search"] { flex: 1 1 16rem; }
.tp-search select { flex: 0 1 12rem; }

/* Directory member cards */
.tp-member { text-align: center; }
.tp-member-photo {
    width: min(8rem, 55%);
    aspect-ratio: 1;
    margin-inline: auto;
    margin-bottom: var(--space-3);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary-light);
    background: var(--tp-tint-strong);
}
.tp-member-photo img { width: 100%; height: 100%; object-fit: cover; }
.tp-member-initials {
    display: flex; align-items: center; justify-content: center; height: 100%;
    font-family: var(--tp-display); font-size: 1.75rem; color: var(--color-primary-dark);
}
.tp-member-name { font-family: var(--tp-display); font-size: 1.05rem; margin: 0 0 var(--space-1); color: var(--tp-ink); }
.tp-member-role { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }
.tp-member-cat { font-size: 0.8rem; font-weight: 600; color: var(--color-primary-dark); margin: var(--space-1) 0 0; }

/* =============================================================================
   Admin CMS shell — dark fixed sidebar + sticky topbar (tenant admin and
   superadmin planes). Vanilla reproduction of the conference-dashboard shell:
   no Bootstrap/FontAwesome (CSP is self-only); icons are the inline SVG sprite
   in layouts/partials/svg-icons.blade.php. The active-link accent follows
   --color-primary, so tenant branding and the superadmin blue both apply.
   ========================================================================== */
:root {
    --adm-sidebar-w: 250px;
    --adm-sidebar-bg: #111827;
    --adm-sidebar-line: rgba(255, 255, 255, 0.07);
    --adm-sidebar-ink: rgba(255, 255, 255, 0.66);
    --adm-topbar-h: 56px;
}

/* The shell replaces the body's stacked flex layout with sidebar + main. */
body.adm-body {
    display: block;
    background: var(--color-surface);
}

.adm-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- Sidebar --------------------------------------------------------------- */
.adm-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: var(--adm-sidebar-w);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--adm-sidebar-bg);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.adm-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: var(--adm-topbar-h);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--adm-sidebar-line);
    flex-shrink: 0;
}

.adm-brand-link {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.adm-brand-link:hover { text-decoration: none; }

.adm-brand-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-brand-sub {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button — only shown inside the off-canvas sidebar on mobile. */
.adm-close {
    display: none;
    background: none;
    border: 0;
    padding: var(--space-2);
    color: var(--adm-sidebar-ink);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.adm-close:hover { color: #ffffff; background: var(--adm-sidebar-line); }

.adm-nav {
    flex: 1;
    overflow-y: auto;
    padding-block: var(--space-2) var(--space-6);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.adm-section {
    padding: var(--space-4) var(--space-4) var(--space-1);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
}

.adm-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-4);
    min-height: 2.5rem;
    color: var(--adm-sidebar-ink);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.12s ease, background-color 0.12s ease;
    /* Also used on the logout <button> inside a POST form. */
    background: none;
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.adm-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
}
.adm-link.is-active {
    color: #ffffff;
    background: var(--color-primary);
}
.adm-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}
.adm-link-logout { color: rgba(255, 130, 130, 0.85); }
.adm-link-logout:hover { color: #ffb4b4; background: rgba(255, 100, 100, 0.09); }

/* Pending-count badge inside a sidebar link. */
.adm-count {
    margin-left: auto;
    padding: 0 var(--space-2);
    border-radius: 999px;
    background: var(--color-warning);
    color: #111827;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.5;
}

.adm-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--adm-sidebar-line);
    padding-block: var(--space-2);
}
.adm-sidebar-footer .inline-form { display: block; }

/* ---- Overlay (mobile off-canvas) ------------------------------------------- */
.adm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
}
.adm-overlay[hidden] { display: none; }

/* ---- Main column ------------------------------------------------------------ */
.adm-main {
    margin-left: var(--adm-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.adm-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--adm-topbar-h);
    padding-inline: var(--space-6);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.adm-hamburger {
    display: none;
    background: none;
    border: 0;
    padding: var(--space-2);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.adm-hamburger:hover { background: var(--color-surface); color: var(--color-text); }

.adm-topbar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.adm-page-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-chip {
    flex-shrink: 0;
    padding: 0.1rem var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.adm-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.adm-viewsite {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}
.adm-viewsite:hover {
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
    text-decoration: none;
}
.adm-viewsite .adm-ico { width: 15px; height: 15px; }

/* ---- Avatar + dropdown ------------------------------------------------------ */
.adm-user { position: relative; }

.adm-avatar-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: none;
    border: 0;
    padding: var(--space-1);
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}
.adm-avatar-btn:hover,
.adm-avatar-btn[aria-expanded="true"] { background: var(--color-surface); }

.adm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.adm-user-name {
    max-width: 10rem;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-caret {
    width: 13px;
    height: 13px;
    color: var(--color-text-muted);
    transition: transform 0.18s ease;
}
.adm-avatar-btn[aria-expanded="true"] .adm-caret { transform: rotate(180deg); }

.adm-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    min-width: 14rem;
    padding-block: var(--space-2);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.adm-dropdown[hidden] { display: none; }
.adm-dropdown .inline-form { display: block; }

.adm-dropdown-head {
    padding: var(--space-2) var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-2);
}
.adm-dropdown-name { font-weight: 600; font-size: 0.88rem; }
.adm-dropdown-mail {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-4);
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.85rem;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}
.adm-dropdown-item:hover {
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-text);
}
.adm-dropdown-item .adm-ico { width: 15px; height: 15px; color: var(--color-text-muted); }
.adm-dropdown-logout { color: var(--color-danger); }
.adm-dropdown-logout .adm-ico { color: var(--color-danger); }
.adm-dropdown-logout:hover { background: #fef2f2; color: #b91c1c; }

/* ---- Content + footer -------------------------------------------------------- */
.adm-content {
    flex: 1;
    min-width: 0;
    padding: var(--space-6);
}

.adm-page-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

/* ---- Admin shell: mobile ------------------------------------------------------ */
@media (max-width: 768px) {
    /* Off-canvas only when JS is available; a no-JS visitor gets the sidebar
       stacked above the content instead of an unreachable drawer. */
    html.js .adm-sidebar { transform: translateX(-100%); }
    html.js .adm-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }
    html:not(.js) .adm-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .adm-main { margin-left: 0; }
    .adm-hamburger { display: inline-flex; }
    html.js .adm-close { display: inline-flex; }
    .adm-chip { display: none; }
    .adm-user-name, .adm-caret { display: none; }
    .adm-viewsite span { display: none; }
    .adm-content { padding: var(--space-4); }
    .adm-topbar { padding-inline: var(--space-4); }
    .adm-page-footer { padding-inline: var(--space-4); }
}

@media (max-width: 480px) {
    .adm-content { padding: var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
    .adm-sidebar, .adm-caret { transition: none; }
}

/* =============================================================================
   Generic mobile collapse for .site-nav headers (member area + central
   marketing). Mirrors the tp-nav toggle: collapsed only when html.js is
   present, so no-JS visitors always see the full menu.
   ========================================================================== */
.sn-toggle { display: none; }

@media (max-width: 767px) {
    html.js .sn-toggle {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        background: none;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        padding: var(--space-2) var(--space-3);
        font: inherit;
        font-size: 0.9rem;
        color: var(--color-text);
        cursor: pointer;
    }

    .sn-toggle-bar,
    .sn-toggle-bar::before,
    .sn-toggle-bar::after {
        content: "";
        display: block;
        width: 1.1rem;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        position: relative;
    }
    .sn-toggle-bar::before { position: absolute; top: -5px; }
    .sn-toggle-bar::after { position: absolute; top: 5px; }

    html.js .site-nav > ul { display: none; }
    html.js .site-nav > ul.is-open { display: flex; }

    .site-nav > ul {
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: var(--space-2);
        border-top: 1px solid var(--color-border);
    }
    /* Comfortable ≥44px touch targets on the collapsed menu. */
    .site-nav > ul a,
    .site-nav > ul .linkish {
        display: block;
        width: 100%;
        padding: var(--space-3);
        text-align: left;
    }
    .site-nav > ul .btn { display: inline-flex; margin: var(--space-2) var(--space-3); }
}

/* =============================================================================
   Responsive polish (mobile-first pass)
   ========================================================================== */
/* Detail lists collapse to a single column on small screens. */
@media (max-width: 480px) {
    .dl-inline { grid-template-columns: 1fr; gap: 0 0; }
    .dl-inline dt { margin-top: var(--space-3); }
    .dl-inline dt:first-child { margin-top: 0; }
}

/* Keep long unbroken strings (emails, URLs, references) from overflowing cards. */
.card, .table td { overflow-wrap: break-word; }
