/* ===========================================================================
   Bizwave — brand stylesheet
   ---------------------------------------------------------------------------
   Loaded after Bootstrap, so this file only adds the brand layer: design
   tokens, the public site, and the admin shell. Bootstrap keeps doing the
   grid, forms and utilities.

   Brand orange (#ff8500) is taken straight from the logo.
   =========================================================================== */

:root {
    /* Brand */
    --brand: #ff8500;
    --brand-600: #e67700;
    --brand-700: #c26200;
    --brand-050: #fff4e6;
    --brand-100: #ffe4c4;

    /* Ink */
    --ink: #16181d;
    --ink-soft: #40454f;
    --ink-muted: #6b7280;
    --line: #e6e8ec;
    --surface: #ffffff;
    --surface-alt: #f7f8fa;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 18, 22, .06), 0 1px 3px rgba(16, 18, 22, .04);
    --shadow: 0 4px 16px rgba(16, 18, 22, .07);
    --shadow-lg: 0 18px 48px rgba(16, 18, 22, .13);

    --sidebar-w: 244px;
    --topbar-h: 60px;

    --font-sans: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--surface-alt);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-600); }

/* ---------------------------------------------------------------------------
   Bootstrap overrides
   --------------------------------------------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--brand-100);
    --bs-btn-disabled-border-color: var(--brand-100);
    font-weight: 600;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-700);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-600);
    --bs-btn-active-border-color: var(--brand-600);
    font-weight: 600;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(255, 133, 0, .18);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.text-brand { color: var(--brand) !important; }
.bg-brand { background-color: var(--brand) !important; }
.bg-brand-050 { background-color: var(--brand-050) !important; }

/* ---------------------------------------------------------------------------
   Brand mark
   --------------------------------------------------------------------------- */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-mark img,
.brand-mark svg,
.brand-mark .brand-logo {
    width: auto;
    height: 40px;
    max-width: 100%;
    display: block;
}

/* The `hidden` attribute must beat Bootstrap's display utilities.
   `.d-grid`, `.d-flex` and friends are `!important`, so an element carrying one
   stays visible even when hidden is set — which is how the profile editor ended
   up showing the initial-letter circle underneath an uploaded photo. The UA
   stylesheet's `[hidden] { display: none }` is not `!important`, so it simply
   loses; this restores the attribute's meaning for the whole app. */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
   Public site
   --------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.section { padding: 4.25rem 0; }

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, .72);
    padding: 3rem 0 1.75rem;
}

.site-footer a { color: rgba(255, 255, 255, .88); }
.site-footer a:hover { color: var(--brand); }

/* ---------------------------------------------------------------------------
   Admin shell
   --------------------------------------------------------------------------- */
.admin-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    background: var(--ink);
    color: rgba(255, 255, 255, .78);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .22s ease;
}

.admin-sidebar .sidebar-head {
    padding: 1.05rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.admin-nav { padding: .75rem .6rem; overflow-y: auto; flex: 1; }

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: rgba(255, 255, 255, .74);
    border-radius: var(--radius-sm);
    padding: .6rem .7rem;
    font-size: .93rem;
    font-weight: 500;
    margin-bottom: .18rem;
}

.admin-nav .nav-link i { font-size: 1.02rem; width: 1.2rem; text-align: center; }
.admin-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.admin-nav .nav-link.active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

.admin-nav .nav-section {
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .34);
    padding: 1rem .7rem .35rem;
    font-weight: 700;
}

.admin-sidebar .sidebar-foot {
    padding: .8rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, .09);
    font-size: .74rem;
    color: rgba(255, 255, 255, .4);
}

.admin-main {
    margin-inline-start: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-inline: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.admin-content { padding: 1.5rem 1.25rem 3rem; flex: 1; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .admin-main { margin-inline-start: 0; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 1035;
    }
}

/* Page heading */
.page-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-head h1 {
    font-size: 1.42rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0;
}

.page-head .page-sub { color: var(--ink-muted); font-size: .89rem; margin-top: .2rem; }

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.panel-title { font-weight: 700; font-size: .98rem; margin: 0; }
.panel-body { padding: 1.15rem; }

/* Stat tiles */
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-top: .3rem;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand-050);
    color: var(--brand-700);
}

.stat.is-warning .stat-icon { background: #fff4e6; color: #b45309; }
.stat.is-danger .stat-icon { background: #fef2f2; color: #b91c1c; }
.stat.is-success .stat-icon { background: #ecfdf5; color: #047857; }

/* Tables */
.table-wrap { overflow-x: auto; }

.table-bizwave {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .9rem;
}

.table-bizwave thead th {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .68rem .9rem;
    white-space: nowrap;
    text-align: left;
}

.table-bizwave tbody td {
    padding: .78rem .9rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table-bizwave tbody tr:last-child td { border-bottom: 0; }
.table-bizwave tbody tr:hover { background: #fcfcfd; }

.table-empty {
    text-align: center;
    padding: 2.75rem 1rem;
    color: var(--ink-muted);
}

.table-empty i { font-size: 1.9rem; display: block; margin-bottom: .6rem; opacity: .45; }

/* Code chip */
.code-chip {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 600;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .16rem .45rem;
    letter-spacing: .04em;
    white-space: nowrap;
}

/* Status badges */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .74rem;
    font-weight: 600;
    padding: .24rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-soft.is-success { background: #ecfdf5; color: #047857; }
.badge-soft.is-danger  { background: #fef2f2; color: #b91c1c; }
.badge-soft.is-warning { background: #fffbeb; color: #b45309; }
.badge-soft.is-info    { background: #eff6ff; color: #1d4ed8; }
.badge-soft.is-muted   { background: var(--surface-alt); color: var(--ink-muted); }
.badge-soft.is-brand   { background: var(--brand-050); color: var(--brand-700); }

/* Destination rows */
.destination {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin-bottom: .55rem;
}

.destination.is-active {
    border-color: var(--brand);
    background: linear-gradient(0deg, var(--brand-050), var(--brand-050));
}

.link-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    color: var(--ink-muted);
    cursor: grab;
    touch-action: none;
}

.link-drag-handle:active { cursor: grabbing; }
.link-drag-handle .bi { font-size: 1rem; }
.destination.is-dragging { opacity: .4; }

.destination input[type="radio"] { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }
.destination .dest-body { flex: 1; min-width: 0; }

.destination .dest-label {
    font-weight: 600;
    font-size: .92rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.destination .dest-url {
    font-family: var(--font-mono);
    font-size: .76rem;
    color: var(--ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Copyable URL field */
.copy-field { display: flex; gap: .4rem; }

/* The button keeps its label on one line: CJK breaks between characters, so
   "複製" was wrapping into two rows on a narrow screen. */
.copy-field .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.copy-field input {
    font-family: var(--font-mono);
    font-size: .82rem;
    background: var(--surface-alt);
    min-width: 0;
}

/* Login */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 460px at 50% -10%, rgba(255, 133, 0, .13), transparent 60%),
        var(--surface-alt);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 2rem 1.75rem;
}

/* Toasts */
.toast-stack {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 1rem);
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(92vw, 380px);
}

.biz-toast {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink-muted);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: .8rem .9rem;
    font-size: .9rem;
    animation: toastIn .22s ease-out;
}

.biz-toast.is-success { border-left-color: #059669; }
.biz-toast.is-danger  { border-left-color: #dc2626; }
.biz-toast.is-warning { border-left-color: #d97706; }
.biz-toast.is-info    { border-left-color: #2563eb; }

.biz-toast .toast-icon { font-size: 1.05rem; line-height: 1.35; flex: 0 0 auto; }
.biz-toast.is-success .toast-icon { color: #059669; }
.biz-toast.is-danger  .toast-icon { color: #dc2626; }
.biz-toast.is-warning .toast-icon { color: #d97706; }
.biz-toast.is-info    .toast-icon { color: #2563eb; }

.biz-toast .toast-close {
    background: none;
    border: 0;
    color: var(--ink-muted);
    padding: 0;
    margin-left: auto;
    line-height: 1;
    font-size: 1rem;
    cursor: pointer;
}

.biz-toast.is-leaving { animation: toastOut .18s ease-in forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

@media (prefers-reduced-motion: reduce) {
    .biz-toast, .biz-toast.is-leaving { animation: none; }
}

/* Profile public page */
.profile-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, var(--brand-050), transparent);
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow);
    background: var(--brand-050);
}

/* ---------------------------------------------------------------------------
   Gate on a public profile (ended plan or deactivated card).

   The profile stays visible underneath and the whole page is blurred and
   dimmed; the card is the only interactive thing on screen. The layout also
   marks the header, main and footer `inert`, so this is not just a visual
   block.
   --------------------------------------------------------------------------- */
.profile-gated-page {
    overflow: hidden;
}

.profile-gated-page main {
    pointer-events: none;
    user-select: none;
}

.expired-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    overflow-y: auto;
    background: rgba(22, 24, 29, .55);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
}

.expired-gate-card {
    width: min(440px, 100%);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: expiredGateIn .22s ease-out both;
}

.expired-gate-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-050);
    color: var(--brand-700);
    font-size: 1.5rem;
}

.expired-gate-card h2 {
    margin: 0 0 .5rem;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.expired-gate-card p {
    margin: 0 0 1.25rem;
    color: var(--ink-muted);
    font-size: .94rem;
    line-height: 1.65;
}

.expired-gate-card .btn {
    min-height: 46px;
    --bs-btn-focus-shadow-rgb: 255, 133, 0;
}

.expired-gate-card .expired-gate-note {
    margin: .9rem 0 0;
    font-size: .82rem;
}

.expired-gate-note a {
    color: var(--ink-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.expired-gate-note a:hover {
    color: var(--brand-700);
}

/* Language toggle inside a profile gate. It sits outside the inert page, so
   it remains the one way to change language while the popup is open. */
.expired-gate-card .gate-lang {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: .9rem;
    font-size: .8rem;
}
.expired-gate-card .gate-lang a {
    color: var(--ink-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.expired-gate-card .gate-lang a:hover {
    color: var(--brand-700);
}
.expired-gate-card .gate-lang .is-active {
    color: var(--ink);
    font-weight: 700;
}
.expired-gate-card .gate-lang .sep {
    color: var(--muted);
}

@keyframes expiredGateIn {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .expired-gate-card { animation: none; }
}

/* Profile photo picker — the drop zone is also the preview, so what you are
   about to save is the thing you are looking at. */
.avatar-drop {
    display: inline-grid;
    place-items: center;
    padding: 6px;
    border: 2px dashed var(--line);
    border-radius: 50%;
    transition: border-color .2s ease, background .2s ease;
}

.avatar-drop.is-dragover {
    border-color: var(--brand);
    background: var(--brand-050);
}

/* Document upload zone. The real file input stretches over the whole box, so
   clicking anywhere opens the picker and the native `required` check still
   works; the script only adds the drop and filename behaviour. */
.file-drop {
    position: relative;
    display: block;
    padding: 1rem;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.file-drop.is-dragover,
.file-drop:focus-within {
    border-color: var(--brand);
    background: var(--brand-050);
}

.file-drop-input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    pointer-events: none;
}

.file-drop-inner .bi {
    font-size: 1.5rem;
    color: var(--brand);
}

/* Bounced email rows in the admin delivery log. */
.table-bizwave tbody tr.is-bounced td {
    background: #fef2f2;
}

.avatar-canvas {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: var(--radius-sm);
    background: #f1f2f4;
    cursor: grab;
    /* Stop the browser scrolling the page while a crop is being dragged. */
    touch-action: none;
}

.link-preview {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .75rem;
}

.link-preview-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: .2rem;
}

.link-preview-url {
    font-size: .85rem;
    color: var(--ink-soft);
    word-break: break-all;
}

/* ---------------------------------------------------------------------------
   Bio — the 簡介, rendered from blocks (App\Models\BioBlocks)
   --------------------------------------------------------------------------- */
.bio-body {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.85;
}

.bio-body.is-compact {
    font-size: .92rem;
    line-height: 1.75;
}

.bio-body > *:last-child { margin-bottom: 0; }
.bio-body p { margin-bottom: 1rem; }

.bio-figure { margin: 0 0 1.25rem; }

.bio-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.bio-figure figcaption {
    margin-top: .5rem;
    text-align: center;
    font-size: .8rem;
    color: var(--ink-muted);
}

/* 16:9, so the iframe keeps its shape before it loads and the page never jumps. */
.bio-video {
    position: relative;
    padding-top: 56.25%;
    margin-bottom: .5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.bio-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bio-video-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    font-size: .8rem;
    color: var(--ink-muted);
}

.bio-link a {
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Bio block editor — the 簡介 as it is written
   --------------------------------------------------------------------------- */
.bio-editor { position: relative; }

.bio-drop-overlay {
    position: absolute;
    inset: -6px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px dashed var(--brand);
    border-radius: var(--radius-sm);
    background: rgba(255, 246, 232, .94);
    color: var(--brand);
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

.bio-drop-overlay[hidden] { display: none; }

.bio-drop-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
}

.bio-drop-overlay-inner .bi { font-size: 1.8rem; }

.bio-blocks { display: grid; gap: .75rem; }

/* The "nothing here yet" note sits after the list and steps aside once the
   editor puts a block in it. */
.bio-blocks:not(.is-empty) ~ .bio-empty-note { display: none; }

.bio-block {
    padding: .6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.bio-block-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: -.6rem -.6rem .6rem;
    padding: .4rem .6rem;
    border-bottom: 1px solid var(--line);
}

.bio-block-tools {
    display: flex;
    gap: .25rem;
    margin-left: auto;
}

.bio-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.bio-drop {
    display: grid;
    place-items: center;
    gap: .35rem;
    min-height: 120px;
    padding: .75rem;
    text-align: center;
    cursor: pointer;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    transition: border-color .2s ease, background .2s ease;
}

.bio-drop.is-dragover {
    border-color: var(--brand);
    background: var(--brand-050);
}

.bio-drop-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.bio-drop-prompt {
    font-size: .82rem;
    color: var(--ink-muted);
}

.profile-link-btn {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .55rem;
    transition: border-color .15s ease, transform .15s ease;
}

.profile-link-btn:hover {
    border-color: var(--brand);
    color: var(--ink);
    transform: translateY(-1px);
}

/* Misc */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ink-muted);
}

/* Only the illustration directly inside the empty state is enlarged. An icon
   inside a button here (e.g. "Add card") must keep the normal button metrics,
   otherwise the plus renders at 2rem on a line of its own. */
.empty-state > i { font-size: 2rem; display: block; margin-bottom: .65rem; opacity: .4; }
.empty-state .btn i { font-size: inherit; display: inline-block; margin-bottom: 0; opacity: 1; }

.hint { font-size: .8rem; color: var(--ink-muted); }

.mono { font-family: var(--font-mono); }

.text-truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-bar {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control,
.filter-bar .form-select { min-width: 0; }

.sticky-actions { position: sticky; bottom: 0; }

/* A visible focus ring everywhere, since several controls are icon-only. */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ===========================================================================
   Card claim & member area
   =========================================================================== */

/* Controls that only make sense with JavaScript. The inline script in the
   claim view adds `.js` before the form paints, so steps never flash. */
.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }

.claim-wrap { padding: 2.5rem 0 4rem; }

.claim-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    background: var(--brand-050);
    color: var(--brand);
    border: 1px solid var(--brand-100);
}

.claim-icon-success { background: #e8f7ee; color: #198754; border-color: #c7ead5; }

.claim-code-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: .18em;
    background: var(--brand-050);
    color: var(--brand-700);
    border: 1px dashed var(--brand-100);
    border-radius: 999px;
    padding: .45rem 1rem;
}

.claim-code-chip-sm {
    font-size: .78rem;
    padding: .25rem .6rem;
    letter-spacing: .12em;
    vertical-align: middle;
}

.claim-steps {
    list-style: none;
    display: flex;
    gap: .5rem;
    padding: 0;
    margin: 0 0 1rem;
}

.claim-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--ink-muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .75rem;
}

.claim-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .78rem;
    background: var(--surface-alt);
    flex: none;
}

.claim-step.is-active { color: var(--brand-700); border-color: var(--brand-100); background: var(--brand-050); }
.claim-step.is-active .claim-step-num { background: var(--brand); color: #fff; }
.claim-step.is-done .claim-step-num { background: #198754; color: #fff; }

.js [data-claim-step]:not(.is-active) { display: none; }

.claim-panel { margin-bottom: 1rem; }
.claim-panel .panel-body { padding: 1.5rem; }
.claim-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.5rem 1.5rem; }

.destination-choices { display: grid; gap: .65rem; }

.destination-choice {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s, background .15s;
}

.destination-choice:hover { border-color: var(--brand-100); background: var(--brand-050); }
.destination-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-050); box-shadow: inset 0 0 0 1px var(--brand); }
.destination-choice .form-check-input { margin-top: .2rem; flex: none; }

.destination-choice-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    color: var(--brand-700);
    flex: none;
}

.destination-choice-text strong { display: block; }
.destination-fields { border-top: 1px dashed var(--line); padding-top: 1rem; }

.claim-url-preview {
    margin-top: .5rem;
    max-width: 100%;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.claim-avatar-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--brand-100);
    display: block;
}

.claim-review { display: grid; gap: .5rem; margin: 0 0 1rem; }
.claim-review > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .5rem; }
.claim-review dt { color: var(--ink-muted); font-weight: 500; }
.claim-review dd { margin: 0; text-align: right; word-break: break-word; }

.claim-credentials { display: grid; gap: .75rem; margin: 0 0 1rem; }
.claim-credentials > div { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.claim-credentials dt { color: var(--ink-muted); font-weight: 500; }
.claim-credentials dd { margin: 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.claim-credentials code { font-family: var(--font-mono); background: var(--brand-050); padding: .3rem .55rem; border-radius: 6px; }

.claim-note { border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .9rem; background: var(--surface-alt); border: 1px solid var(--line); }
.claim-note-success { background: #e8f7ee; border-color: #c7ead5; color: #146c43; }
.claim-note-warning { background: #fff8e1; border-color: #ffe08a; color: #664d03; }

/* A page-head action keeps its icon and label on one line; when space is
   tight the whole button wraps below the heading instead of splitting. */
.member-head .btn { white-space: nowrap; }

.member-header .member-nav { gap: .25rem; }
.member-nav-link { text-decoration: none; color: var(--ink-soft); font-size: .9rem; font-weight: 500; padding: .35rem .6rem; border-radius: 999px; }
.member-nav-link:hover { color: var(--brand-700); background: var(--brand-050); }
.member-nav-link.is-active { color: var(--brand-700); background: var(--brand-050); }

.member-main { min-height: calc(100vh - 200px); }
.member-footer { border-top: 1px solid var(--line); background: var(--surface); }

.member-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-alt); flex: none; }
.member-avatar-lg { width: 88px; height: 88px; }
.member-avatar-initial { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.4rem; }

.member-cards { display: grid; gap: .75rem; }
.member-card { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.member-card-main { flex: 1 1 260px; min-width: 0; }
.member-card.is-inactive { background: var(--surface-alt); }
.member-card-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.member-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.member-card-visual { display: flex; align-items: center; gap: .5rem; flex: none; }
.member-card-qr.is-compact { width: 64px; height: 64px; padding: 4px; }
.member-card-qr {
    flex: none;
    width: 84px;
    height: 84px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: zoom-in;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.member-card-qr:hover,
.member-card-qr:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(255, 133, 0, .15);
    outline: 0;
}
.member-card-qr-thumb,
.member-card-qr-thumb svg { display: block; width: 100%; height: 100%; }
.member-card-qr-thumb i { font-size: 1.6rem; color: var(--muted); }
.member-qr-modal-code { width: min(320px, 78vw); margin: 0 auto; }
.member-qr-modal-code svg { display: block; width: 100%; height: auto; }
@media (max-width: 575.98px) {
    .member-card-qr { width: 68px; height: 68px; }
}

.member-facts { display: grid; gap: .45rem; margin: 0; }
.member-facts > div { display: flex; justify-content: space-between; gap: 1rem; }
.member-facts dt { color: var(--ink-muted); font-weight: 500; }
.member-facts dd { margin: 0; word-break: break-word; }

@media (max-width: 575.98px) {
    .claim-step span:last-child { display: none; }
    .claim-step { justify-content: center; }
    .claim-actions { justify-content: stretch; }
    .claim-actions .btn { flex: 1; }
    .claim-review > div { flex-direction: column; gap: .15rem; }
    .claim-review dd { text-align: left; }
}

/* The photo drop zone is also a button: click opens the picker. */
.avatar-drop {
    cursor: pointer;
}

.avatar-drop:hover,
.avatar-drop:focus-visible {
    border-color: var(--brand);
    background: var(--brand-050);
}

/* Templates with a non-circular avatar window: the ring must not claim the
   photo will be round. */
.avatar-drop.is-masked {
    border-radius: var(--radius-sm);
}

.avatar-native-input {
    max-width: 360px;
}

/* Template cover picker: a 2:1 frame, matching the stored cover. */
.article-cover-drop {
    max-width: none;
    aspect-ratio: 16 / 9;
}

/* Small drag-and-drop image fields (client logo, testimonial avatar). */
.media-field { max-width: 100%; }

.media-drop {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 110px;
    padding: .75rem;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.media-drop:hover,
.media-drop:focus-visible,
.media-drop.is-dragover {
    border-color: var(--brand);
    background: var(--brand-050);
}

.media-drop img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-drop-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 92px;
    object-fit: contain;
}

.media-drop-avatar {
    width: 96px;
    height: 96px;
    padding: 0;
    border-radius: 50%;
}

.media-drop-avatar img {
    object-fit: cover;
    border-radius: 50%;
}

.media-drop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .5rem;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
    line-height: 1.4;
}

.media-drop-empty[hidden] { display: none; }
.media-drop img[hidden] { display: none; }

.media-drop-empty .bi { font-size: 1.5rem; }

.cover-drop {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 2 / 1;
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    background: #f1f2f4;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.cover-drop.is-dragover,
.cover-drop:hover,
.cover-drop:focus-visible {
    border-color: var(--brand);
    background: var(--brand-050);
}

.cover-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-empty {
    display: grid;
    gap: .35rem;
    place-items: center;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
    padding: 1rem;
}

.cover-empty i {
    font-size: 1.8rem;
}

.cover-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    border-radius: var(--radius-sm);
    background: #f1f2f4;
    cursor: grab;
    /* Stop the browser scrolling the page while a crop is being dragged. */
    touch-action: none;
}

.cover-native-input {
    max-width: 360px;
}

/* Billing / free-trial summary */
.billing-summary .panel-title {
    letter-spacing: .01em;
}

.billing-actions .btn {
    min-height: 44px;
}

.billing-trial-banner {
    border-left: 4px solid var(--brand);
}

.billing-cycle-option {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .7rem .8rem .7rem 2.3rem;
    transition: border-color .15s ease, background-color .15s ease;
}

.billing-cycle-option:hover {
    border-color: var(--brand);
}

.billing-cycle-option:has(.form-check-input:checked) {
    border-color: var(--brand);
    background: var(--brand-050);
}

/* ---------------------------------------------------------------------------
   Legal documents (privacy policy, terms and conditions)

   A reading page, deliberately quieter than the rest of the public site: one
   measure, generous leading, and a contents rail that stays in view on a desk
   but becomes an ordinary list above the document on a phone.
   --------------------------------------------------------------------------- */
.legal-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.legal-aside {
    position: sticky;
    top: 1.25rem;
}

.legal-toc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem 1rem .85rem;
}

.legal-toc-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 .55rem;
    padding: 0 .45rem;
}

.legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .1rem;
    max-height: calc(100vh - 10rem);
    overflow: auto;
}

.legal-toc a {
    display: block;
    padding: .3rem .45rem;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: .81rem;
    line-height: 1.4;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
    background: var(--brand-050);
    color: var(--brand-700);
}

.legal-doc {
    padding: clamp(1.35rem, 3vw, 2.75rem);
}

.legal-doc h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin: 0;
}

.legal-summary {
    max-width: 64ch;
    margin: .7rem 0 0;
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.legal-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: .82rem;
}

.legal-section {
    margin-top: 2.1rem;
    scroll-margin-top: 1.25rem;
}

.legal-section h2 {
    margin: 0 0 .65rem;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.legal-section p {
    max-width: 72ch;
    margin: 0 0 .8rem;
    color: var(--ink-soft);
    font-size: .95rem;
    line-height: 1.75;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    display: grid;
    gap: .45rem;
    max-width: 72ch;
    margin: .35rem 0 .9rem;
    padding-left: 1.15rem;
}

.legal-section li {
    padding-left: .15rem;
    color: var(--ink-soft);
    font-size: .93rem;
    line-height: 1.7;
}

.legal-section li::marker {
    color: var(--brand);
}

.legal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem;
    margin-top: 2.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .9rem;
}

.legal-foot span {
    color: var(--ink-muted);
}

.legal-foot a {
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .legal-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .legal-aside {
        position: static;
    }

    .legal-toc ol {
        grid-template-columns: 1fr 1fr;
        column-gap: 1rem;
        max-height: none;
    }
}

@media (max-width: 575.98px) {
    .legal-toc ol {
        grid-template-columns: 1fr;
    }

    .legal-section {
        margin-top: 1.75rem;
    }
}

@media print {
    .site-header,
    .site-footer,
    .legal-aside,
    .legal-foot {
        display: none !important;
    }

    .legal-doc {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .legal-section {
        break-inside: avoid;
    }
}

/* ===========================================================================
   Template gallery — member and administrator profile editors
   =========================================================================== */
.template-gallery {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.template-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .8rem;
}

.template-filter {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    padding: .45rem .75rem;
}

.template-filter:hover {
    border-color: var(--brand);
    color: var(--brand-700);
}

.template-filter.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.template-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    max-height: 38rem;
    overflow: auto;
    padding: .15rem .25rem .75rem;
}

.template-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-width: 0;
    padding: .4rem;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.template-card:hover {
    border-color: var(--brand-100);
    box-shadow: var(--shadow-sm);
}

.template-card.is-selected,
.template-card:has(.template-radio:checked) {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-050);
}

.template-radio {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.template-card-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin: 0;
    min-width: 0;
}

.template-card-thumb,
.template-thumb-placeholder {
    aspect-ratio: 9 / 16;
    background: linear-gradient(145deg, var(--surface-alt), var(--brand-050));
    border-radius: calc(var(--radius) - 4px);
    display: grid;
    object-fit: cover;
    object-position: top;
    place-items: center;
    width: 100%;
}

.template-card-thumb {
    border: 1px solid var(--line);
    height: auto;
}

.template-thumb-placeholder {
    color: var(--brand-600);
    font-size: 1.5rem;
}

.template-card-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .4rem;
    min-width: 0;
}

.template-card-name {
    color: var(--ink);
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.2;
}

.template-card-category {
    color: var(--ink-muted);
    font-size: .72rem;
    line-height: 1.2;
}

.template-card-badge {
    background: var(--brand-050);
    border-radius: 999px;
    color: var(--brand-700);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .12rem .4rem;
    text-transform: uppercase;
}

.template-card-preview {
    align-items: center;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    display: inline-flex;
    font-size: .74rem;
    font-weight: 600;
    justify-content: center;
    margin-top: auto;
    padding: .4rem .5rem;
    text-decoration: none;
}

.template-card-preview:hover {
    background: var(--brand-050);
    color: var(--brand-700);
}

.template-card-preview.is-disabled {
    color: var(--ink-muted);
    font-size: .68rem;
    font-weight: 500;
    text-align: center;
}

.template-radio:focus-visible + .template-card-label {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.template-preview-frame {
    background: #fff;
    border: 0;
    display: block;
    height: min(78vh, 900px);
    width: 100%;
}

.template-preview-loading {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    display: flex;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 2;
}

.template-preview-loading[hidden] {
    display: none;
}

@media (max-width: 575.98px) {
    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .template-preview-frame {
        height: 70vh;
    }
}

.template-card[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------------------
   Tap analytics (member card page)
   ---------------------------------------------------------------------------
   The map ramp is one hue — brand orange, light to dark — because the country
   fill encodes magnitude, not identity. No-data land stays a neutral grey so
   the shaded countries are the only thing that reads as data.
   --------------------------------------------------------------------------- */
.analytics-panel { --map-land: #eef0f4; }

.analytics-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.analytics-kpi {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: .7rem .85rem;
    display: grid;
    gap: .15rem;
}

.analytics-kpi-label {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.analytics-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

/* Map / chart switch */
.analytics-switch {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .15rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .15rem;
}

.analytics-arrow {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    font-size: .8rem;
}

.analytics-arrow:hover,
.analytics-arrow:focus-visible {
    background: var(--surface);
    color: var(--brand-700);
}

.analytics-switch-label {
    min-width: 5.5rem;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}

.analytics-views { margin-top: 1rem; }

.analytics-view[hidden] { display: none; }

.analytics-empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    padding: 2.25rem 1rem;
    text-align: center;
    color: var(--ink-muted);
}

.analytics-empty i { font-size: 1.6rem; display: block; margin-bottom: .4rem; opacity: .55; }
.analytics-empty span { font-size: .84rem; }

.analytics-caption {
    margin: .55rem 0 0;
    font-size: .78rem;
    color: var(--ink-muted);
}

.analytics-note {
    margin: .9rem 0 0;
    font-size: .8rem;
    color: var(--ink-muted);
}

.analytics-subtitle {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 1.4rem 0 .7rem;
}

/* --- World map ------------------------------------------------------------ */
.tap-map {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: .6rem;
    min-height: 160px;
}

.tap-map svg {
    display: block;
    width: 100%;
    height: auto;
}

.tap-map path {
    fill: var(--map-land);
    stroke: #ffffff;
    stroke-width: .5;
}

.tap-map path.map-level-1 { fill: #ffd6ad; }
.tap-map path.map-level-2 { fill: #ffab5c; }
.tap-map path.map-level-3 { fill: var(--brand); }
.tap-map path.map-level-4 { fill: var(--brand-700); }

.tap-map-dot {
    /* A marker's size carries the count; one colour keeps a 1-tap island from
       disappearing into the sea. */
    fill: var(--brand);
    stroke: #ffffff;
    stroke-width: 1.4;
}

.tap-map-status {
    display: grid;
    place-items: center;
    min-height: 150px;
    color: var(--ink-muted);
    font-size: .84rem;
}

.analytics-legend {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .6rem;
    font-size: .74rem;
    color: var(--ink-muted);
}

.analytics-swatch {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.analytics-swatch.is-round { width: 10px; height: 10px; border-radius: 50%; }
.analytics-swatch.map-level-1 { background: #ffd6ad; }
.analytics-swatch.map-level-2 { background: #ffab5c; }
.analytics-swatch.map-level-3 { background: var(--brand); }
.analytics-swatch.map-level-4 { background: var(--brand-700); }

.analytics-legend-dot {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.tap-countries {
    list-style: none;
    margin: .9rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem 1.25rem;
}

.tap-country {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 56px auto;
    gap: .5rem;
    align-items: center;
    font-size: .86rem;
}

.tap-country-flag { font-size: .95rem; line-height: 1; }
.tap-country-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tap-country-bar {
    height: 5px;
    border-radius: 999px;
    background: var(--brand-050);
    overflow: hidden;
}

.tap-country-bar i {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
}

.tap-country-count { font-size: .82rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* --- 14-day chart --------------------------------------------------------- */
.tap-chart { margin: 0; }

.tap-chart-plot {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 170px;
    padding-top: 1.4rem;
    border-top: 1px solid #eef0f4;
    border-bottom: 1px solid var(--line);
}

.tap-chart-max {
    position: absolute;
    top: 0;
    left: 0;
    font-size: .68rem;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

.tap-chart-col {
    position: relative;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tap-chart-bar {
    display: block;
    width: 100%;
    max-width: 24px;
    background: var(--brand);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}

.tap-chart-bar.is-zero { background: #e8ebf0; }

.tap-chart-value {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -6px);
    font-size: .74rem;
    font-weight: 700;
    color: var(--ink);
}

.tap-chart-axis {
    display: flex;
    gap: 2px;
    margin-top: .4rem;
}

.tap-chart-axis span {
    flex: 1 1 0;
    text-align: center;
    font-size: .68rem;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Button breakdown ----------------------------------------------------- */
.tap-buttons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .65rem;
}

.tap-button-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .75rem;
    align-items: center;
}

.tap-button-name {
    font-size: .88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tap-button-count { font-size: .82rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tap-button-share { color: #9aa1ac; margin-left: .15rem; }
.tap-table-country { white-space: nowrap; }

.tap-button-track {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 999px;
    background: var(--brand-050);
    overflow: hidden;
}

.tap-button-fill {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
}

/* --- Hover tooltip -------------------------------------------------------- */
.tap-tip {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -100%);
    background: var(--ink);
    color: #fff;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.3;
    padding: .32rem .55rem;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow);
}

@media (max-width: 767.98px) {
    .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tap-countries { grid-template-columns: minmax(0, 1fr); }
    .tap-chart-axis span.is-minor { visibility: hidden; }
}

/* ---------------------------------------------------------------------------
   Passkeys (Face ID / Touch ID)
   --------------------------------------------------------------------------- */
.passkey-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: .6rem;
}

.passkey-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: .65rem .85rem;
}

.passkey-row > i {
    flex: none;
    font-size: 1.15rem;
    color: var(--brand-700);
}

.passkey-row > div {
    min-width: 0;
}

.passkey-row .hint {
    font-size: .8rem;
    margin: 0;
}

.passkey-row .btn {
    flex: none;
}

/* ---------------------------------------------------------------------------
   Card artwork & print orders
   --------------------------------------------------------------------------- */
.member-card-thumb {
    flex: none;
    width: 96px;
    aspect-ratio: 85.6 / 54;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-alt);
    display: grid;
    place-items: center;
}

.member-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-card-thumb-empty { color: #b9bec7; font-size: 1.35rem; }

.artwork-figure { margin: 0; }
.artwork-figure img {
    display: block;
    width: 220px;
    aspect-ratio: 85.6 / 54;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-alt);
}
.artwork-figure figcaption { margin-top: .35rem; font-size: .8rem; color: var(--ink-muted); }

/* --- Card editor ---------------------------------------------------------- */
.editor-tabs {
    display: flex;
    gap: .25rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .15rem;
}

.editor-tabs button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .32rem .95rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.editor-tabs button.is-active {
    background: var(--surface);
    color: var(--brand-700);
    box-shadow: var(--shadow-sm);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .85rem;
}

.editor-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .32rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface);
    cursor: pointer;
    overflow: hidden;
    max-width: 100%;
}

.editor-upload:hover { border-color: var(--brand); color: var(--brand-700); }

.editor-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.editor-stage {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.editor-canvas-wrap {
    position: relative;
    width: 100%;
    touch-action: none;
    cursor: grab;
}

.editor-art {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.editor-guide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.editor-hint { margin-top: .6rem; font-size: .78rem; color: var(--ink-muted); }

.editor-add {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}

.editor-empty { font-size: .86rem; color: var(--ink-muted); }
.editor-control .form-label { font-size: .8rem; margin-bottom: .25rem; }
.editor-control .form-range { width: 100%; }

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface);
}

.qty-stepper button {
    width: 34px;
    height: 34px;
    border: 0;
    background: var(--surface-alt);
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1;
}

.qty-stepper button:hover { background: var(--brand-050); color: var(--brand-700); }

.qty-stepper input {
    width: 54px;
    border: 0;
    text-align: center;
    font-weight: 700;
    background: var(--surface);
    -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.currency-choice {
    flex: 1;
    display: flex;
    gap: .5rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .55rem .75rem;
    cursor: pointer;
    background: var(--surface);
}

.currency-choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-050);
}

.currency-choice input { margin: 0; }

/* Card stock picker: four product tiles, each with its material preview. */
.card-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
.card-type-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .55rem;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.card-type-choice:hover { border-color: var(--brand); }
.card-type-choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-050);
    box-shadow: 0 0 0 .2rem rgba(255, 133, 0, .12);
}
.card-type-choice input {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 2;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
.card-type-image {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f2f0eb;
}
.card-type-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-type-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.card-type-body strong { font-size: .86rem; line-height: 1.25; }
.card-type-price { font-size: .76rem; color: var(--ink-muted); }
.card-type-body .hint { font-size: .72rem; line-height: 1.3; }

@media (max-width: 1199.98px) {
    .card-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .card-type-grid { grid-template-columns: 1fr; }
}

.order-total { display: grid; gap: .35rem; margin: .5rem 0 .75rem; }
.order-total > div { display: flex; justify-content: space-between; }
.order-total dt { font-weight: 500; color: var(--ink-muted); }
.order-total dd { margin: 0; font-weight: 700; }

.editor-preview {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15, 18, 25, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: auto;
}

.editor-preview-inner {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 980px;
    width: 100%;
}

.editor-preview-inner img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

/* --- Connections ---------------------------------------------------------- */
.connect-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
}

.connect-fab-btn {
    border-radius: 999px;
    padding: .75rem 1.35rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 575.98px) {
    .connect-fab { right: 1rem; left: 1rem; bottom: 1rem; }
    .connect-fab-btn { width: 100%; }
}

.connection-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-050);
    color: var(--brand-700);
    font-weight: 700;
    overflow: hidden;
    flex: none;
}

.connection-avatar img { width: 100%; height: 100%; object-fit: cover; }

.connection-photo {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.editor-stage.is-dragover {
    border-color: var(--brand);
    background: var(--brand-050);
}

.editor-stage { position: relative; }

.editor-trash {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: .8rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    pointer-events: none;
    z-index: 5;
}

.editor-trash.is-hot {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* The Connect action sits under the template's own add-to-contacts button. */
.connect-inline {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1.25rem;
}

.connect-inline .connect-fab-btn {
    padding: .65rem 1.2rem;
}

/* The guest's first step: one big camera button, with manual entry as text. */
.guest-camera-btn {
    width: 100%;
    display: grid;
    place-items: center;
    gap: .3rem;
    padding: 1.5rem 1rem 1.6rem;
    border: 2px dashed var(--brand);
    border-radius: 14px;
    background: var(--brand-050);
    color: var(--brand-700, var(--brand));
    text-align: center;
    font-weight: 700;
    transition: background .15s ease, border-color .15s ease;
}

.guest-camera-btn:hover,
.guest-camera-btn:focus-visible {
    background: var(--brand-100, var(--brand-050));
    border-style: solid;
}

.guest-camera-btn i {
    font-size: 2.1rem;
    line-height: 1;
}

.guest-camera-btn span { font-size: 1.02rem; }

.guest-camera-btn small {
    font-weight: 400;
    font-size: .8rem;
    color: var(--ink-muted);
    max-width: 30ch;
}

/* Referral page: a short numbered explainer. */
.referral-steps {
    display: grid;
    gap: .4rem;
    padding-left: 1.15rem;
    font-size: .9rem;
}

.referral-steps li::marker {
    color: var(--brand);
    font-weight: 700;
}

/* --- Photo field (drop / choose / camera) --------------------------------- */
.photo-drop {
    display: grid;
    place-items: center;
    gap: .35rem;
    min-height: 120px;
    padding: .85rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--ink-muted);
    font-size: .85rem;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.photo-drop:hover,
.photo-drop:focus-visible,
.photo-drop.is-dragover {
    border-color: var(--brand);
    background: var(--brand-050);
}

.photo-drop i { font-size: 1.4rem; }
.photo-drop img { max-width: 100%; max-height: 200px; border-radius: 8px; display: block; }

/* --- Meetings ------------------------------------------------------------- */
.meeting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }

.meeting-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-alt);
    padding: .7rem .85rem;
}

.meeting-item.is-first { background: var(--brand-050); border-color: #ffd7a3; }
.meeting-when { font-weight: 700; font-size: .9rem; }
.meeting-place { color: var(--ink-muted); font-size: .82rem; }
.meeting-note { font-size: .86rem; margin-top: .25rem; white-space: pre-line; }

.meeting-block { border-top: 1px solid var(--line); padding-top: 1rem; }
.meeting-block:first-of-type { border-top: 0; padding-top: 0; }
.meeting-block-title { margin-bottom: .75rem; }
.meeting-photo { display: inline-block; margin-top: .5rem; }
.meeting-photo img {
    max-width: 200px;
    max-height: 140px;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
}

/* --- Camera capture ------------------------------------------------------- */
.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(10, 12, 16, .82);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.camera-modal-inner {
    width: 100%;
    max-width: 640px;
    background: #0d0f13;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.camera-modal video {
    display: block;
    width: 100%;
    max-height: 70vh;
    background: #000;
    object-fit: contain;
}

.camera-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    background: #14171d;
}

/* Member testimonial preview */
.member-testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.member-testimonial-initial {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.member-testimonial-preview {
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7f6f1;
}

.member-testimonial-quote {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-line;
}

.member-testimonial-person {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.member-testimonial-person strong {
    display: block;
    font-size: .9rem;
}

.member-testimonial-person small {
    display: block;
    color: var(--ink-muted);
    font-size: .78rem;
}

/* Drag ordering in the landing admin lists */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: .25rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: #fff;
    color: var(--ink-muted);
    cursor: grab;
    vertical-align: middle;
}

.drag-handle:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.drag-handle:active { cursor: grabbing; }
.drag-handle .bi { font-size: 1rem; }

tr.is-dragging { opacity: .4; }

/* ===========================================================================
   Sunshine (太陽圖) — private per-card business map
   =========================================================================== */
.sunshine-privacy {
    color: var(--ink-muted);
    font-size: .82rem;
}

.sunshine-ai-quota {
    padding: .8rem .9rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: var(--surface-alt);
}

.sunshine-ai-quota-empty {
    color: #8a5a00;
    font-size: .85rem;
}

.sunshine-ai-progress {
    position: sticky;
    top: .75rem;
    z-index: 5;
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    border: 1px solid var(--brand-100);
    border-radius: .75rem;
    background: var(--brand-050);
    color: var(--brand-700);
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .06);
}

.sunshine-ai-progress[hidden] {
    display: none !important;
}

.sunshine-step .panel-head {
    align-items: flex-start;
    gap: 1rem;
}

.sunshine-step-title {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.sunshine-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--brand-050);
    color: var(--brand-700);
    font-weight: 700;
    font-size: .9rem;
}

.sunshine-stage {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: .85rem;
    align-items: center;
    min-height: 200px;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.sunshine-stage.is-radial {
    display: block;
    height: var(--sunshine-height, 560px);
    min-height: var(--sunshine-height, 560px);
    padding: 0;
    border-style: solid;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 133, 0, .07), transparent 48%),
        var(--surface-alt);
}

.sunshine-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.sunshine-lines line {
    stroke: #d7d9df;
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
}

.sunshine-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    width: 100%;
    max-width: 150px;
    aspect-ratio: 1;
    margin: 0 auto;
    padding: .65rem;
    border: 1px solid #d9dce2;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color .18s, transform .18s, box-shadow .18s;
}

.sunshine-node:hover,
.sunshine-node:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-050);
    transform: translateY(-2px);
    outline: none;
    z-index: 3;
}

.sunshine-stage.is-radial .sunshine-node {
    position: absolute;
    width: 132px;
    height: 132px;
    max-width: none;
    margin: 0;
    transform: translate(-50%, -50%);
}

.sunshine-stage.is-radial .sunshine-node:hover,
.sunshine-stage.is-radial .sunshine-node:focus-visible {
    transform: translate(-50%, -52%);
    z-index: 4;
}

.sunshine-node.is-center {
    grid-column: 1 / -1;
    width: 168px;
    height: 168px;
    max-width: none;
    margin: 0 auto;
    border: 2px solid var(--brand);
    background: var(--brand-050);
    cursor: default;
    box-shadow: var(--shadow);
}

.sunshine-stage.is-radial .sunshine-node.is-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 172px;
    height: 172px;
}

.sunshine-node.is-self {
    border-style: dashed;
    border-color: var(--brand);
    background: #fffaf2;
}

.sunshine-node.is-shared {
    border-color: #b7791f;
}

.sunshine-node-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.sunshine-node.is-center .sunshine-node-label {
    font-size: .98rem;
}

.sunshine-node-sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: .68rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.sunshine-node-badge {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.sunshine-node.is-self .sunshine-node-badge {
    background: var(--brand-700);
}

.sunshine-count {
    display: inline-block;
    margin-top: .1rem;
    padding: .1rem .38rem;
    border-radius: 999px;
    background: #eef0f4;
    color: var(--ink-soft);
    font-size: .58rem;
    font-weight: 700;
    white-space: nowrap;
}

.sunshine-node-shared {
    color: #8a5a00;
    font-size: .56rem;
    font-weight: 700;
}

.sunshine-picker {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1rem;
}

.sunshine-pill {
    display: inline-flex;
    align-items: center;
    padding: .35rem .75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}

.sunshine-pill:hover {
    border-color: var(--brand);
    color: var(--brand-700);
}

.sunshine-pill.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.sunshine-list {
    border-top: 1px solid var(--line);
}

.sunshine-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--line);
}

.sunshine-row:last-child {
    border-bottom: 0;
}

.sunshine-row-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--brand);
    flex: 0 0 .55rem;
}

.sunshine-empty {
    padding: 1.25rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    text-align: center;
}

.sunshine-note {
    padding: .7rem .9rem;
    border: 1px solid #ffd7a3;
    border-radius: var(--radius-sm);
    background: var(--brand-050);
    color: #704300;
    font-size: .8rem;
    line-height: 1.55;
}

.sunshine-match-head {
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line);
}

.sunshine-match-list {
    display: flex;
    flex-direction: column;
}

.sunshine-match-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
}

.sunshine-match-row:last-child {
    border-bottom: 0;
}

.sunshine-match-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--brand-050);
    color: var(--brand-700);
    font-weight: 700;
}

.sunshine-match-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sunshine-match-main {
    min-width: 0;
    flex: 1 1 auto;
}

.sunshine-match-terms {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: .35rem;
}

.sunshine-match-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex: 0 0 auto;
}

.sunshine-shared-badge {
    display: inline-block;
    margin-top: .35rem;
    color: #1f7a45;
    font-size: .72rem;
    font-weight: 650;
}

@media (max-width: 767.98px) {
    .sunshine-stage.is-radial {
        display: block;
        height: var(--sunshine-height, 330px);
        min-height: var(--sunshine-height, 330px);
        padding: 0;
    }

    .sunshine-stage.is-radial .sunshine-node {
        width: 92px;
        height: 92px;
        padding: .35rem;
    }

    .sunshine-stage.is-radial .sunshine-node.is-center {
        width: 120px;
        height: 120px;
        padding: .5rem;
    }

    .sunshine-stage.is-radial .sunshine-node:hover,
    .sunshine-stage.is-radial .sunshine-node:focus-visible {
        transform: translate(-50%, -52%);
    }

    .sunshine-lines {
        display: block;
    }

    .sunshine-node-label {
        font-size: .64rem;
    }

    .sunshine-node.is-center .sunshine-node-label {
        font-size: .78rem;
    }

    .sunshine-node-sub {
        font-size: .56rem;
        -webkit-line-clamp: 1;
    }

    .sunshine-node-badge,
    .sunshine-count,
    .sunshine-node-shared {
        font-size: .52rem;
    }

    .sunshine-node-shared {
        display: none;
    }

    .sunshine-match-row {
        flex-wrap: wrap;
    }

    .sunshine-match-actions {
        width: 100%;
        justify-content: flex-start;
        padding-left: 3.3rem;
    }
}

[data-sunshine-content] {
    transition: opacity .15s ease;
}

[data-sunshine-content].is-loading {
    opacity: .55;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Admin dashboard — new customer registrations
   --------------------------------------------------------------------------- */
.registration-chart {
    --reg-line: var(--brand-700);
    --reg-grid: var(--line);
    --reg-axis: #c3c2b7;
}

.registration-range-btn {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: .8rem;
}

.registration-range-btn:hover {
    background: var(--surface-alt);
    color: var(--ink);
}

.registration-range-btn.is-active {
    background: var(--brand-050);
    border-color: var(--brand-100);
    color: var(--brand-700);
    font-weight: 600;
}

.registration-chart-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: .35rem;
}

.registration-chart-readout {
    display: flex;
    align-items: baseline;
    gap: .55rem;
}

.registration-chart-readout-date {
    color: var(--ink-muted);
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.registration-chart-readout-value {
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.registration-chart-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    color: var(--ink-muted);
    font-size: .82rem;
}

.registration-chart-plot {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    outline: none;
    touch-action: pan-x pan-y;
}

.registration-chart-plot:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.registration-chart-svg {
    display: block;
    width: 100%;
    min-width: 640px;
    height: auto;
}

.registration-gridline {
    stroke: var(--reg-grid);
    stroke-width: 1;
}

.registration-baseline {
    stroke: var(--reg-axis);
    stroke-width: 1;
}

.registration-axis-label {
    fill: var(--ink-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.registration-area {
    fill: var(--reg-line);
    opacity: .10;
}

.registration-line {
    fill: none;
    stroke: var(--reg-line);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.registration-endpoint {
    fill: var(--reg-line);
    stroke: var(--surface);
    stroke-width: 2;
}

.registration-endpoint-label {
    fill: var(--ink);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.registration-crosshair {
    stroke: var(--ink-muted);
    stroke-width: 1;
    opacity: .45;
    visibility: hidden;
    pointer-events: none;
}

.registration-hover-dot {
    fill: var(--reg-line);
    stroke: var(--surface);
    stroke-width: 2;
    visibility: hidden;
    pointer-events: none;
}

.registration-chart-table {
    margin-top: .9rem;
}

.registration-chart-table summary {
    color: var(--brand-700);
    cursor: pointer;
    font-size: .84rem;
    font-weight: 600;
}

.registration-chart-table-wrap {
    max-height: 240px;
    overflow: auto;
    margin-top: .5rem;
    border-top: 1px solid var(--line);
}

.registration-chart-table .table-bizwave {
    margin: 0;
}

@media (max-width: 575.98px) {
    .registration-chart-svg {
        min-width: 560px;
    }

    .registration-chart-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}
