/* AlpsCraft ERP — semantic component classes.
   Shared across admin + customer portal. Depends on tokens.css. */

/* ──────────────────────────────
   App shell
   ────────────────────────────── */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-base);
}

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: var(--layout-pad);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
}

@media (min-width: 768px) {
    .app-main { padding: var(--layout-pad-lg); }
}

.app-main--centered {
    max-width: var(--layout-max);
    margin-inline: auto;
    width: 100%;
}

/* Page load fade-up */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.fade-in { animation: fade-up var(--dur-slow) var(--ease-out) both; }
.fade-in-1 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 40ms; }
.fade-in-2 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 80ms; }
.fade-in-3 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 120ms; }
.fade-in-4 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 160ms; }

/* Ambient accent wash for hero sections */
.ambient {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.ambient::before {
    content: '';
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(1000px 400px at 12% -20%, rgb(var(--color-accent-rgb) / 0.10), transparent 60%),
        radial-gradient(800px 300px at 88% -30%, rgb(var(--color-cta-rgb) / 0.06), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ──────────────────────────────
   Topbar
   ────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 var(--layout-pad);
    height: var(--topbar-h);
    background: var(--color-topbar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-fg-primary);
}

.logo-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-strong);
    background: linear-gradient(140deg, rgb(var(--color-accent-rgb) / 0.18), rgb(var(--color-cta-rgb) / 0.08));
    color: var(--color-fg-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* Inline SVG mountain mark + Fraunces wordmark composite. Adapts to theme via
   CSS variables (no PNG, no filter band-aids). Lives in .topbar__brand. */
.topbar__mark {
    width: 26px;
    height: 26px;
    color: var(--color-accent);
    flex-shrink: 0;
    display: inline-flex;
}
.topbar__mark svg { width: 100%; height: 100%; display: block; }

/* Real brand logo in the topbar (replaces the SVG mark + Fraunces wordmark). The stacked
   ALPS/CRAFT image; on dark themes it swaps to logo-inverse.png via the theme-aware logo
   rule near the auth-card logo. Sized to sit comfortably in the 60px topbar. */
.topbar__logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.topbar__wordmark {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 500;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    line-height: 1;
}

.topbar__tag {
    margin-left: 0.625rem;
    padding-left: 0.75rem;
    border: 0;
    border-left: 1px solid var(--color-border-strong);
    border-radius: 0;
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-eyebrow);
    color: var(--color-fg-tertiary);
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar__nav-link {
    color: var(--color-fg-primary);
    font-size: var(--fs-sm);
    font-weight: 450;
    position: relative;
    transition: color var(--dur) var(--ease-out);
}
.topbar__nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease-out);
}
.topbar__nav-link:hover::after { transform: scaleX(1); }

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    background: transparent;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    transition: all var(--dur) var(--ease-out);
}
.user-chip:hover {
    background: var(--color-bg-raised);
    border-color: var(--color-border-default);
    color: var(--color-fg-primary);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-bg-strong), var(--color-accent-bg));
    border: 1px solid var(--color-border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
    align-items: center;
    justify-content: center;
}
@media (max-width: 767px) {
    .mobile-toggle { display: inline-flex; }
}

/* The lead cluster (hamburger + brand) may shrink so the right-hand action
   buttons are never pushed off-screen on narrow viewports. */
.topbar__lead { min-width: 0; }
.topbar__brand { min-width: 0; }

@media (max-width: 767px) {
    .topbar { gap: 0.5rem; padding: 0 1rem; }
    .topbar__actions { gap: 0.375rem; flex-shrink: 0; }
    .topbar__logo { height: 30px; }
    /* Preferences + sign-out relocate into the drawer footer (.sidebar__account)
       on phones, so the bar stays lean: brand · bell · avatar. The descendant
       selector outranks the later `.btn { display: inline-flex }` rule. */
    .topbar__actions .topbar__account-action { display: none; }
}
@media (max-width: 360px) {
    .topbar__tag { display: none; }
}

/* ──────────────────────────────
   Portal mobile nav
   The hamburger toggles a slide-down panel beneath the topbar. On desktop
   (≥900px) the cluster is display:contents, so the nav links + account
   actions sit inline exactly as before. The 900px breakpoint (vs the usual
   767px) is deliberate — the portal's localized nav labels need the room.
   Scoped to .topbar__cluster / new classes so admin (no cluster) is untouched.
   ────────────────────────────── */
.topbar__cluster { display: contents; }

.topbar__menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
    background: transparent;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.topbar__menu-btn:hover { background: var(--color-bg-raised); color: var(--color-fg-primary); border-color: var(--color-border-default); }
.topbar__menu-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.topbar__menu-icon { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.topbar__menu-icon--close { display: none; }
.topbar__menu-btn.is-open .topbar__menu-icon--open { display: none; }
.topbar__menu-btn.is-open .topbar__menu-icon--close { display: block; }

.topbar__nav-backdrop { display: none; }

@media (max-width: 899px) {
    .topbar__menu-btn { display: inline-flex; }

    /* Cluster → slide-down panel anchored under the sticky topbar */
    .topbar__cluster {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--topbar-h));
        max-height: calc(100dvh - var(--topbar-h));
        overflow-y: auto;
        padding: 0.625rem 0.75rem 0.875rem;
        background: var(--color-bg-elevated);
        border-bottom: 1px solid var(--color-border-subtle);
        box-shadow: var(--shadow-overlay);
        z-index: 48;
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity var(--dur) var(--ease-out),
                    transform var(--dur) var(--ease-out),
                    visibility 0s linear var(--dur);
    }
    .topbar__cluster.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity var(--dur) var(--ease-out),
                    transform var(--dur) var(--ease-out);
    }

    /* Nav links become full-width rows */
    .topbar__cluster .topbar__nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.125rem;
        width: 100%;
    }
    .topbar__cluster .topbar__nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.8rem 0.75rem;
        border-radius: var(--radius-sm);
        font-size: var(--fs-md);
        color: var(--color-fg-primary);
    }
    .topbar__cluster .topbar__nav-link::after { display: none; }
    .topbar__cluster .topbar__nav-link:hover { background: var(--color-bg-raised); }

    /* Account row pinned beneath the links */
    .topbar__cluster .topbar__actions {
        width: 100%;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--color-border-subtle);
        justify-content: space-between;
        gap: 0.75rem;
    }
    .topbar__cluster .user-chip { flex: 1 1 auto; min-width: 0; }
    .topbar__cluster .user-chip > span:not(.user-avatar) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Reveal the email + sign-out label inside the panel (they carry the
       `hidden sm:inline` utility which hides them below 640px). */
    .topbar__cluster .hidden { display: inline !important; }

    .topbar__nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: var(--color-bg-overlay);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--dur) var(--ease-out);
    }
    .topbar__nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

    body.portal-nav-open { overflow: hidden; }
}

/* ──────────────────────────────
   Notification bell (topbar)
   ────────────────────────────── */
.bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bell__button {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-fg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dur) var(--ease-out);
}
.bell__button:hover {
    background: var(--color-bg-raised);
    border-color: var(--color-border-default);
    color: var(--color-fg-primary);
}
.bell__button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.bell__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--color-cta);
    color: var(--color-cta-fg, #fff);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.bell__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 1rem);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.18));
    z-index: var(--z-popover, 50);
    overflow: hidden;
    animation: fade-up var(--dur) var(--ease-out) both;
}
.bell__dropdown[hidden] { display: none; }

.bell__dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-fg-secondary);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    background: var(--color-bg-inset);
}
.bell__see-all {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.bell__see-all:hover { color: var(--color-accent-strong); }

.bell__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}

.bell__item {
    border-bottom: 1px solid var(--color-border-subtle);
}
.bell__item:last-child { border-bottom: 0; }
.bell__item--unread { background: rgb(var(--color-accent-rgb) / 0.04); }

.bell__item-form {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
        "channel template time mark"
        "dot     dot      dot  mark";
    column-gap: 0.625rem;
    row-gap: 0.125rem;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
}
.bell__item-channel {
    grid-area: channel;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-fg-muted);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
}
.bell__item-template {
    grid-area: template;
    color: var(--color-fg-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bell__item-time {
    grid-area: time;
    font-size: var(--fs-xs);
    color: var(--color-fg-muted);
}
.bell__item-dot {
    grid-area: dot;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    justify-self: start;
    align-self: center;
}
.bell__item-mark {
    grid-area: mark;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border-default);
    background: var(--color-bg-elevated);
    color: var(--color-fg-secondary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dur) var(--ease-out);
}
.bell__item-mark:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.bell__loading {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bell__empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--color-fg-muted);
}
.bell__empty svg { margin-bottom: 0.5rem; opacity: 0.7; }
.bell__empty p { margin: 0; font-size: var(--fs-sm); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ──────────────────────────────
   Sidebar
   ────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border-subtle);
    padding: 1rem 0.75rem;
    overflow-y: auto;
    min-height: calc(100vh - var(--topbar-h));
    position: sticky;
    top: var(--topbar-h);
    align-self: flex-start;
}

.sidebar__group { margin-bottom: 1.25rem; }
.sidebar__group-label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-muted);
    padding: 0.5rem 0.75rem 0.375rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: var(--radius-sm);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--dur) var(--ease-out);
    border-left: 2px solid transparent;
    position: relative;
}
.sidebar-link:hover {
    color: var(--color-fg-primary);
    background: var(--color-bg-raised);
}
.sidebar-link__icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    opacity: 0.85;
}
.sidebar-link--active {
    color: var(--color-accent);
    background: var(--color-accent-bg);
    border-left-color: var(--color-accent-strong);
}
.sidebar-link--active .sidebar-link__icon { opacity: 1; color: var(--color-accent); }

/* Drawer account footer — hidden on desktop (these actions live in the topbar),
   surfaced at the foot of the mobile drawer so the bar can stay lean. */
.sidebar__account { display: none; }
.sidebar__account-id {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 0.25rem 0.75rem;
    min-width: 0;
}
.sidebar__account-email {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sidebar__account-actions { display: flex; gap: 0.5rem; }
.sidebar__account-logout { flex: 1; }
.sidebar__account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-raised);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--dur) var(--ease-out);
}
.sidebar__account-btn:hover {
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
    background: var(--color-bg-inset);
}
.sidebar__account-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 767px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        width: min(20rem, 86vw);
        padding: 0.75rem 0.875rem calc(1rem + env(safe-area-inset-bottom, 0px));
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        /* Explicit height (not top+bottom): a fixed box with top+bottom+auto-height
           collapses to content height anchored at y:0 on mobile engines, tucking the
           first item under the topbar. dvh tracks the mobile address bar. */
        height: calc(100vh - var(--topbar-h));
        height: calc(100dvh - var(--topbar-h));
        min-height: 0;
        z-index: var(--z-sidebar);
        border-right: 1px solid var(--color-border-default);
        box-shadow: var(--shadow-overlay);
        transform: translateX(-100%);
        transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
        overscroll-behavior: contain;
        scroll-padding-top: 0.5rem;
    }
    .sidebar.is-open { transform: translateX(0); }

    /* Generous touch targets; first label kept clear of the topbar edge. */
    .sidebar-link { padding: 0.6875rem 0.75rem; }
    .sidebar > .sidebar__group:first-child { margin-top: 0.25rem; }

    /* Account footer pinned to the foot of the drawer. */
    .sidebar__account {
        display: block;
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid var(--color-border-subtle);
    }

    /* Staggered reveal of the groups as the drawer slides open. */
    .sidebar .sidebar__group,
    .sidebar .sidebar__account { opacity: 0; transform: translateX(-10px); }
    .sidebar.is-open .sidebar__group,
    .sidebar.is-open .sidebar__account {
        opacity: 1;
        transform: none;
        transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
    }
    .sidebar.is-open .sidebar__group:nth-child(1) { transition-delay: 70ms; }
    .sidebar.is-open .sidebar__group:nth-child(2) { transition-delay: 110ms; }
    .sidebar.is-open .sidebar__group:nth-child(3) { transition-delay: 150ms; }
    .sidebar.is-open .sidebar__group:nth-child(4) { transition-delay: 190ms; }
    .sidebar.is-open .sidebar__group:nth-child(5) { transition-delay: 230ms; }
    .sidebar.is-open .sidebar__group:nth-child(6) { transition-delay: 270ms; }
    .sidebar.is-open .sidebar__account { transition-delay: 310ms; }

    .sidebar-backdrop {
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        z-index: calc(var(--z-sidebar) - 1);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--dur) var(--ease-out);
    }
    .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }

    /* Lock the page behind the open drawer. */
    body.sidebar-open { overflow: hidden; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
    .sidebar .sidebar__group,
    .sidebar .sidebar__account { opacity: 1; transform: none; transition: none; }
}

/* ──────────────────────────────
   Footer
   ────────────────────────────── */
.footer {
    border-top: 1px solid var(--color-border-subtle);
    padding: 1rem var(--layout-pad);
    text-align: center;
    color: var(--color-fg-muted);
    font-size: var(--fs-xs);
    background: var(--color-bg-base);
}
.footer a { color: var(--color-fg-tertiary); transition: color var(--dur) var(--ease-out); }
.footer a:hover { color: var(--color-fg-primary); text-decoration: underline; }

/* ──────────────────────────────
   Page header
   ────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header__title {
    font-size: var(--fs-3xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
    color: var(--color-fg-primary);
}
.page-header__subtitle,
.page-header__sub {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
}
.page-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Hero dashboard band */
.hero {
    position: relative;
    padding: 2rem 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-subtle);
    background: linear-gradient(180deg, rgb(var(--color-accent-rgb) /0.06), transparent 60%), var(--color-bg-elevated);
    margin-bottom: 1.5rem;
    overflow: hidden;
    isolation: isolate;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 260px at 0% 0%, rgb(var(--color-accent-rgb) / 0.14), transparent 60%),
        radial-gradient(500px 240px at 100% 100%, rgb(var(--color-cta-rgb) / 0.06), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.hero__eyebrow {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-accent);
}
.hero__title {
    font-size: var(--fs-4xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
    color: var(--color-fg-primary);
    margin-top: 0.5rem;
}
.hero__subtitle {
    color: var(--color-fg-secondary);
    font-size: var(--fs-md);
    margin-top: 0.5rem;
    max-width: 52ch;
}

/* ──────────────────────────────
   Cards
   ────────────────────────────── */
.card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.card--tight { padding: 1rem 1.25rem; }
.card--flush { padding: 0; overflow: hidden; }
.card--interactive {
    transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
    cursor: pointer;
}
.card--interactive:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-raised);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.card__head h2, .card__head h3 {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
}
.card__body { padding: 1rem 1.25rem; }
.card__foot {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-bg-inset);
}

/* Stat card */
.stat-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.stat-card:hover { border-color: var(--color-border-default); transform: translateY(-1px); }
.stat-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.stat-card__label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
}
.stat-card__icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg);
    color: var(--color-accent);
}
.stat-card__icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.stat-card__value {
    font-family: var(--font-sans);
    font-size: var(--fs-3xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: 1.1;
    color: var(--color-fg-primary);
}
.stat-card__delta {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
}

/* Tone variants (accent chip color) */
.stat-card--accent .stat-card__icon { background: var(--color-accent-bg); color: var(--color-accent); }
.stat-card--success .stat-card__icon { background: var(--color-success-bg); color: var(--color-success); }
.stat-card--warning .stat-card__icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card--danger .stat-card__icon { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-card--neutral .stat-card__icon { background: var(--color-neutral-bg); color: var(--color-fg-secondary); }

/* Quick-action card */
.quick-action {
    display: block;
    padding: 1.125rem 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--dur) var(--ease-out);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.quick-action::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(160px 100px at 10% 0%, var(--color-accent-bg), transparent 60%);
    opacity: 0;
    transition: opacity var(--dur) var(--ease-out);
    z-index: -1;
}
.quick-action:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-1px);
}
.quick-action:hover::after { opacity: 1; }
.quick-action__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
}
.quick-action__desc {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
}
.quick-action__arrow {
    color: var(--color-fg-muted);
    transition: color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
    margin-left: auto;
}
.quick-action:hover .quick-action__arrow { color: var(--color-accent); transform: translateX(2px); }

/* ──────────────────────────────
   Buttons
   ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    text-decoration: none;
    user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

.btn--lg { padding: 0.625rem 1.125rem; font-size: var(--fs-base); }
.btn--sm { padding: 0.375rem 0.625rem; font-size: var(--fs-xs); }
.btn--block { display: flex; width: 100%; }

.btn-primary {
    background: var(--color-cta);
    color: var(--color-cta-fg);
    border-color: var(--color-cta);
}
.btn-primary:hover { background: var(--color-cta-hover); border-color: var(--color-cta-hover); }
.btn-primary:focus-visible { box-shadow: var(--shadow-focus-cta); }

.btn-secondary {
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
}
.btn-secondary:hover { background: var(--color-bg-overlay); border-color: var(--color-border-strong); }

.btn-ghost {
    background: transparent;
    color: var(--color-fg-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--color-bg-raised); color: var(--color-fg-primary); }

.btn-outline {
    background: transparent;
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
}
.btn-outline:hover { border-color: var(--color-border-strong); background: var(--color-bg-raised); }

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: rgba(248, 113, 113, 0.25);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.45); }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border-color: var(--color-border-subtle);
    color: var(--color-fg-secondary);
}
.btn-icon:hover { background: var(--color-bg-raised); color: var(--color-fg-primary); border-color: var(--color-border-default); }

/* Link button (looks like text) */
.btn-link {
    padding: 0;
    background: transparent;
    color: var(--color-accent);
    border: 0;
    font-weight: 500;
}
.btn-link:hover { color: var(--color-accent-strong); text-decoration: underline; }

/* ──────────────────────────────
   Forms
   ────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.375rem; }

.label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-fg-secondary);
    letter-spacing: 0.005em;
}
.label .req { color: var(--color-danger); margin-left: 2px; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    line-height: 1.35;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--color-fg-muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-border-strong); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-accent-strong);
    box-shadow: var(--shadow-focus);
    background: var(--color-bg-overlay);
}
.input--mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.input--error, .select--error, .textarea--error {
    border-color: rgba(248, 113, 113, 0.55);
}
.input--error:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25); }
.textarea { resize: vertical; min-height: 80px; }

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7384' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 12px;
}
.select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2338BDF8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.select option { background: var(--color-bg-overlay); color: var(--color-fg-primary); }

.field-error {
    color: var(--color-danger);
    font-size: var(--fs-xs);
    line-height: 1.4;
}
.field-hint {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-xs);
    line-height: 1.4;
}

/* Input with leading icon (search bars) */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group__icon {
    position: absolute;
    left: 0.75rem;
    width: 14px;
    height: 14px;
    color: var(--color-fg-tertiary);
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}
.input-group .input { padding-left: 2.125rem; }

/* Filter pill bar container */
.filter-bar {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.filter-bar .input, .filter-bar .select { min-width: 160px; }
.filter-bar .input-group { flex: 1 1 240px; }

/* Form section — groups related fields, works as a group inside a .card */
.form-section { margin-bottom: 1.5rem; }
.form-section + .form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
}
.form-section__head { margin-bottom: 1rem; }
.form-section__title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
    margin: 0;
}
.form-section__subtitle,
.form-section__sub {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin: 0.25rem 0 0;
}
.form-section__optional {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-fg-muted);
    font-weight: 500;
    margin-left: 0.5rem;
}
.field-label__optional { color: var(--color-fg-muted); font-weight: 400; font-size: var(--fs-xs); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem 1.25rem; }
@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid--2 { grid-template-columns: 1fr 1fr; }
    .form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
    .form-grid__full,
    .field--full { grid-column: 1 / -1; }
}
.input--upper { text-transform: uppercase; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.release-add-form { margin-top: 1.5rem; }

.form-actions {
    display: flex;
    gap: 0.625rem;
    padding-top: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Tables
   ────────────────────────────── */
.table-wrap {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.table-wrap--scroll { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.table thead th {
    background: var(--color-bg-inset);
    color: var(--color-fg-tertiary);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
    white-space: nowrap;
}
.table tbody td {
    padding: 0.875rem 1rem;
    color: var(--color-fg-secondary);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--color-bg-raised); }
.table tbody tr.is-muted { opacity: 0.55; }
.table a { color: var(--color-fg-primary); font-weight: 500; }
.table a:hover { color: var(--color-accent); }
.table .num { font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--color-fg-tertiary); }
.table__action-cell { text-align: right; width: 1%; white-space: nowrap; }

/* Stacked table — collapses each row into a label/value card on narrow screens.
   Opt-in via `.table--stack` so admin tables keep their horizontal scroll.
   Each <td> needs a `data-label` for its column heading. Breaks below 768px so
   the multi-column table only renders where it has room to avoid clipping. */
@media (max-width: 767px) {
    .table--stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .table--stack tbody tr { display: block; padding: 0.5rem 0.25rem; }
    .table--stack tbody tr + tr { border-top: 1px solid var(--color-border-subtle); }
    .table--stack tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.3rem 0.75rem;
        border: 0;
        text-align: right;
        overflow-wrap: anywhere;
    }
    .table--stack tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: var(--fs-2xs);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: var(--ls-wider);
        color: var(--color-fg-tertiary);
        text-align: left;
    }
    .table--stack tbody td:first-child {
        font-size: var(--fs-base);
        font-weight: 600;
        color: var(--color-fg-primary);
        padding-top: 0.5rem;
    }
}

/* ──────────────────────────────
   Badges & pills
   ────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}
.badge--dotless::before { display: none; }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge--accent  { background: var(--color-accent-bg);  color: var(--color-accent); }
.badge--neutral { background: var(--color-neutral-bg); color: var(--color-fg-secondary); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
    font-size: var(--fs-xs);
    font-weight: 500;
}
.pill--accent { background: var(--color-accent-bg); color: var(--color-accent); border-color: rgb(var(--color-accent-rgb) / 0.24); }

/* ──────────────────────────────
   Alerts / banners
   ────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-elevated);
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    position: relative;
    overflow: hidden;
}
.alert::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-accent-strong);
}
.alert__icon {
    flex-shrink: 0;
    width: 16px; height: 16px;
    color: inherit;
    stroke: currentColor;
    fill: none;
    margin-top: 1px;
}
.alert--error { background: rgba(248, 113, 113, 0.06); color: var(--color-danger); border-color: rgba(248, 113, 113, 0.2); }
.alert--error::before { background: var(--color-danger); }
.alert--info { background: var(--color-info-bg); color: var(--color-info); border-color: rgba(96, 165, 250, 0.24); }
.alert--info::before { background: var(--color-info); }
.alert--success { background: var(--color-success-bg); color: var(--color-success); border-color: rgba(74, 222, 128, 0.24); }
.alert--success::before { background: var(--color-success); }
.alert--warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(251, 191, 36, 0.22); }
.alert--warning::before { background: var(--color-warning); }

/* ──────────────────────────────
   Hint card — featured guide callout (markdown content)
   Use for product hints, "getting started" notes, and similar.
   ────────────────────────────── */
.hint-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding: 1.75rem 1.875rem;
    margin-bottom: 2rem;
    background:
        linear-gradient(180deg, rgb(var(--color-accent-rgb) / 0.08), transparent 60%),
        var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.hint-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.55;
}
.hint-card__icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgb(var(--color-accent-rgb) / 0.14);
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) / 0.22);
}
.hint-card__icon svg { width: 20px; height: 20px; }
.hint-card__body { margin: 0; align-self: center; }
@media (max-width: 640px) {
    .hint-card { padding: 1.25rem; grid-template-columns: 1fr; gap: 0.875rem; }
    .hint-card__icon { width: 32px; height: 32px; }
    .hint-card__icon svg { width: 18px; height: 18px; }
}

/* ──────────────────────────────
   Empty state
   ────────────────────────────── */
.empty-state {
    background: var(--color-bg-elevated);
    border: 1px dashed var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    align-items: center;
    justify-content: center;
    color: var(--color-fg-tertiary);
    margin-bottom: 1rem;
}
.empty-state__icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.empty-state__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
}
.empty-state__body {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
    max-width: 48ch;
    margin-inline: auto;
}
.empty-state .btn { margin-top: 1rem; }

/* ──────────────────────────────
   Breadcrumb
   ────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--color-fg-tertiary);
    font-size: var(--fs-xs);
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--color-fg-tertiary); transition: color var(--dur) var(--ease-out); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb__sep { color: var(--color-fg-muted); }
.breadcrumb__current { color: var(--color-fg-secondary); }

/* ──────────────────────────────
   Auth card
   ────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--color-bg-base);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.auth-shell::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(600px 360px at 18% 22%, rgb(var(--color-accent-rgb) / 0.14), transparent 55%),
        radial-gradient(500px 300px at 82% 80%, rgb(var(--color-cta-rgb) / 0.10), transparent 55%),
        radial-gradient(800px 500px at 50% 110%, rgb(var(--color-accent-rgb) / 0.05), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.auth-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(800px 600px at 50% 50%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(800px 600px at 50% 50%, #000, transparent 70%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.7;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-raised);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
}
.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}
.auth-card__brand--centered {
    justify-content: center;
}
.auth-card__brand-mark { /* uses .logo-mark */ }
.auth-card__brand-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}
/* Theme-aware brand logo. Markup always ships logo.png (dark-ink wordmark + moss ridge,
   transparent — correct on light surfaces). On any DARK surface, swap the rendered image
   to logo-inverse.png (cream wordmark + sage ridge) via the CSS `content` replacement, so
   no template needs a second <img>. Matched both by the auth class and by src, so it also
   covers any future dark logo placement (e.g. a topbar logo). Forced-light surfaces
   (offer / campaign / PDF / email) never hit this rule, so they keep logo.png.
   Replaces the previous filter: invert() hack, which only approximated the dark variant. */
[data-theme="dark"] .auth-card__brand-logo,
[data-theme="dark"] img[src$="/images/logo.png"] {
    content: url("/images/logo-inverse-28c1bc880bcfc76704d38ebb8a9c030a.png");
}
.auth-card__brand-text {
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    font-size: var(--fs-md);
}
.auth-card h1 {
    font-size: var(--fs-2xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin-bottom: 0.25rem;
}
.auth-card__lede {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-bottom: 1.5rem;
}
.auth-card__divider {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin-top: 1.25rem;
}
.auth-card__divider a { color: var(--color-accent); font-weight: 500; }
.auth-card__divider a:hover { text-decoration: underline; }

/* ──────────────────────────────
   Release card (product detail)
   ────────────────────────────── */
.release-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.release-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: block;
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.release-card:hover { border-color: var(--color-border-default); background: var(--color-bg-raised); }
.release-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.release-card__title-block { display: flex; flex-direction: column; gap: 0.125rem; }
.release-card__version {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-accent);
    letter-spacing: 0;
}
.release-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.release-card__date {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
}
.release-card__notes {
    font-family: var(--font-sans);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    white-space: pre-wrap;
    margin-top: 0.75rem;
}
.release-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.875rem;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    font-size: var(--fs-2xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    letter-spacing: 0;
}
.meta-chip strong { color: var(--color-fg-secondary); font-weight: 500; margin-right: 0.25rem; text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--font-sans); font-size: 10px; }

/* ──────────────────────────────
   Release feature materials
   A distinct "shelf" of downloadable assets attached to a release, set off
   from the artifact meta chips by a hairline divider so the two never collide.
   ────────────────────────────── */
.release-card__materials {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
}
.release-card__materials-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 1rem;
    font-family: var(--font-sans);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    color: var(--color-fg-tertiary);
}
.release-card__materials-title::before {
    content: "";
    flex: 0 0 auto;
    width: 1.25rem;
    height: 2px;
    border-radius: 2px;
    background: var(--color-accent);
}

/* ──────────────────────────────
   Attachment card grid
   (distinct class so the bare `.attachment-list` used by the customer-messages
   form and public offer landing pages is not affected)
   ────────────────────────────── */
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 0.875rem;
    margin-top: 0;
    list-style: none;
    padding: 0;
}
.attachment-item {
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out);
}
.attachment-item:hover {
    border-color: var(--color-border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
}
.attachment-item__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: var(--color-bg-elevated);
}
.attachment-item__icon {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    color: var(--color-fg-muted);
}
.attachment-item__body {
    padding: 0.75rem 0.75rem 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 auto;
}
.attachment-item__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--fs-xs);
    line-height: var(--lh-snug);
    color: var(--color-fg-secondary);
    word-break: break-word;
}
.attachment-item__size {
    font-size: var(--fs-2xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
}
.attachment-item__desc {
    font-size: var(--fs-xs, 0.75rem);
    color: var(--color-fg-muted, #6b7280);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.attachment-item__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem 0.75rem;
    margin-top: auto;
    border-top: 1px solid var(--color-border-subtle);
}
/* Uniform pill treatment so Preview / Download / Remove read as one tidy row
   instead of a bordered button stacked above a bare text link. Buttons size to
   their label (basis: auto) and grow to share the row; an action that doesn't
   fit wraps cleanly to the next line rather than overflowing/colliding. */
.attachment-item__actions > .btn,
.attachment-item__actions > form {
    flex: 1 1 auto;
}
.attachment-item__actions > form { display: flex; }
.attachment-item__actions > form > .btn { flex: 1 1 auto; }
.attachment-item__actions .btn {
    justify-content: center;
    padding-inline: 0.5rem;
    background: var(--color-bg-elevated);
    border-color: var(--color-border-subtle);
    color: var(--color-fg-secondary);
}
.attachment-item__actions .btn:hover {
    background: var(--color-bg-base);
    border-color: var(--color-border-default);
    color: var(--color-fg-primary);
}
.attachment-item__actions .btn--danger-text {
    color: var(--color-danger);
}
.attachment-item__actions .btn--danger-text:hover {
    color: var(--color-danger);
}
.attachment-empty {
    font-size: var(--fs-sm);
    color: var(--color-fg-muted);
    margin: 0;
}

/* ──────────────────────────────
   Toast
   Elevated confirmation popover, anchored top-right below the sticky topbar.
   Uses an OPAQUE surface (never --color-bg-overlay, which is the modal scrim),
   a semantic status coin, and an auto-dismiss progress rail synced to the 5s
   JS timeout. The region is click-through; only the toast itself is interactive.
   ────────────────────────────── */
.toast-region {
    position: fixed;
    top: calc(var(--topbar-h) + 0.875rem);
    right: clamp(0.75rem, 2vw, 1.5rem);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.625rem;
    max-width: min(24rem, calc(100vw - 1.5rem));
    pointer-events: none;
}

.toast {
    --toast-accent: var(--color-accent);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 0.8125rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-overlay);
    color: var(--color-fg-primary);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.45;
    overflow: hidden;
    pointer-events: auto;
    animation: toast-in 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Status coin — solid semantic disc with an inverse glyph; theme-aware via tokens. */
.toast::before {
    content: "";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: var(--radius-pill);
    background: var(--toast-accent);
    box-shadow: var(--shadow-sm);
    color: var(--color-fg-inverse);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

/* Auto-dismiss progress rail — depletes over the 5s dismiss window. */
.toast::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: var(--toast-accent);
    transform-origin: left;
    opacity: 0.5;
    animation: toast-progress 5s linear both;
}

.toast--success { --toast-accent: var(--color-success); }
.toast--error   { --toast-accent: var(--color-danger); }
.toast--success::before { content: "\2713"; } /* ✓ */
.toast--error::before   { content: "\2715"; } /* ✕ */

.toast.is-leaving {
    animation: toast-out 320ms var(--ease-out) forwards;
    pointer-events: none;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-0.5rem) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateX(0.75rem) scale(0.97); }
}
@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

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

/* HTMX indicator inline next to search input */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; color: var(--color-accent); align-items: center; gap: 0.375rem; font-size: var(--fs-xs); }
.htmx-request.htmx-indicator { display: inline-flex; }

/* Spinning glyph */
.spinner {
    width: 12px; height: 12px;
    border: 1.5px solid var(--color-border-default);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Giant error page */
.error-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
.error-hero__code {
    font-family: var(--font-sans);
    font-size: clamp(4rem, 18vw, 10rem);
    font-weight: 600;
    letter-spacing: var(--ls-tighter);
    line-height: 0.95;
    background: linear-gradient(180deg, var(--color-accent), var(--color-fg-muted));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-hero__title {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin-top: 0.75rem;
    letter-spacing: var(--ls-tight);
}
.error-hero__body {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-md);
    margin-top: 0.5rem;
    max-width: 48ch;
    margin-inline: auto;
}
.error-hero__actions {
    margin-top: 1.75rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Dashboard hero band
   ────────────────────────────── */
.hero {
    position: relative;
    margin-bottom: 2rem;
    padding: 2.25rem 1.75rem 2rem;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(900px 340px at 12% -10%, rgb(var(--color-accent-rgb) /0.12), transparent 60%),
        radial-gradient(600px 260px at 100% 120%, rgb(var(--color-cta-rgb) /0.08), transparent 70%),
        linear-gradient(180deg, var(--color-bg-elevated), var(--color-bg-base));
    border: 1px solid var(--color-border-subtle);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
    pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin: 0.5rem 0 0.5rem;
}
.hero__subtitle {
    color: var(--color-fg-secondary);
    font-size: var(--fs-md);
    max-width: 68ch;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0;
}

/* Section header shared */
.section-header { margin-bottom: 1rem; }
.section-title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
    letter-spacing: var(--ls-tight);
}
.section-sub {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin: 0.25rem 0 0;
}

/* ──────────────────────────────
   Stat card grid + variants
   ────────────────────────────── */
.stat-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }

.stat-card {
    position: relative;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.125rem 1.25rem;
    overflow: hidden;
    transition: transform var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out),
                background var(--dur-mid) var(--ease-out);
}
.stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-default);
    background: var(--color-bg-raised);
}
.stat-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.stat-card__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--color-fg-tertiary);
}
.stat-card__icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
}
.stat-card__icon svg { width: 16px; height: 16px; }
.stat-card__value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.stat-card--accent .stat-card__icon { color: var(--color-accent); background: var(--color-accent-bg); border-color: rgb(var(--color-accent-rgb) /0.2); }
.stat-card--success .stat-card__icon { color: var(--color-success); background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); }
.stat-card--warning .stat-card__icon { color: var(--color-warning); background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.2); }
.stat-card--danger .stat-card__icon  { color: var(--color-danger);  background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }

/* ──────────────────────────────
   Quick actions grid
   ────────────────────────────── */
.quick-action-grid {
    display: grid;
    gap: 0.875rem;
    grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 640px) { .quick-action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .quick-action-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    color: var(--color-fg-primary);
    text-decoration: none;
    transition: all var(--dur-mid) var(--ease-out);
}
.quick-action:hover {
    transform: translateY(-1px);
    border-color: rgb(var(--color-accent-rgb) /0.28);
    background: var(--color-bg-raised);
    box-shadow: 0 0 0 1px rgb(var(--color-accent-rgb) /0.12), 0 10px 30px rgba(0,0,0,0.3);
}
.quick-action__icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) /0.22);
    flex-shrink: 0;
}
.quick-action__icon svg { width: 18px; height: 18px; }
.quick-action__body { flex: 1; min-width: 0; }
.quick-action__label {
    display: block;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
}
.quick-action__sub {
    display: block;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin-top: 2px;
}
.quick-action__arrow {
    color: var(--color-fg-muted);
    transition: color var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.quick-action__arrow svg { width: 16px; height: 16px; }
.quick-action:hover .quick-action__arrow {
    color: var(--color-accent);
    transform: translateX(2px);
}

/* Card header + table-empty */
.card--pad-0 { padding: 0 !important; }
.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.card__title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
}
.card__sub {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin: 0.2rem 0 0;
}
.table-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
}

/* Inline monospace code chip */
.mono, code.mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-primary);
}

/* xl breakpoint helper for 2-column tables on dashboard */
@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Helpers for data styling */
.link-accent {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--dur-mid) var(--ease-out);
}
.link-accent:hover { color: var(--color-accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--color-fg-muted);
    margin-right: 0.375rem;
    vertical-align: middle;
}
.status-dot--success { background: var(--color-success); box-shadow: 0 0 0 3px rgba(74,222,128,0.14); }
.status-dot--danger { background: var(--color-danger); box-shadow: 0 0 0 3px rgba(248,113,113,0.14); }
.status-dot--warning { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(251,191,36,0.14); }

tr.is-inactive { opacity: 0.55; }
.font-mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

/* Avatar + user cell */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgb(var(--color-accent-rgb) /0.14), rgb(var(--color-accent-rgb) /0.04));
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) /0.22);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.avatar--sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar--lg { width: 44px; height: 44px; font-size: 0.9rem; }
.user-cell { display: inline-flex; align-items: center; gap: 0.625rem; }

/* Checkbox inline pattern */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    user-select: none;
    cursor: pointer;
    padding: 0.4rem 0;
}
.checkbox input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xs, 4px);
    cursor: pointer;
}

.text-muted { color: var(--color-fg-muted); }
.inline { display: inline; }

/* Meta list — definition-list used on detail pages */
.meta-list { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; }
.meta-list__row { display: grid; grid-template-columns: 120px 1fr; gap: 0.75rem; align-items: baseline; }
.meta-list__row dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-fg-tertiary);
    font-weight: 600;
}
.meta-list__row dd { color: var(--color-fg-primary); font-size: var(--fs-sm); margin: 0; }

/* Title with badges on same line */
.title-with-badges { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }

/* Prose block for long-form text (plain text — preserves whitespace) */
.prose {
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
    white-space: pre-wrap;
    margin: 0;
}

/* Rich prose — for rendered markdown HTML (no pre-wrap, real block elements) */
.prose--rich {
    white-space: normal;
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
}
.prose--rich > :first-child { margin-top: 0; }
.prose--rich > :last-child { margin-bottom: 0; }
.prose--rich p { margin: 0 0 0.75rem; }
.prose--rich strong { color: var(--color-fg-primary); font-weight: 600; }
.prose--rich em { color: var(--color-fg-primary); }
.prose--rich code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
}
.prose--rich pre {
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.875rem;
    overflow-x: auto;
    margin: 0.5rem 0 0.75rem;
}
.prose--rich pre code { background: none; padding: 0; }
.prose--rich a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-color: rgb(var(--color-accent-rgb) / 0.35);
    text-underline-offset: 2px;
}
.prose--rich a:hover { text-decoration-color: var(--color-accent); }
.prose--rich ul, .prose--rich ol { margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }
.prose--rich li { margin: 0.25rem 0; }
.prose--rich h1, .prose--rich h2, .prose--rich h3,
.prose--rich h4, .prose--rich h5, .prose--rich h6 {
    color: var(--color-fg-primary);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    margin: 0.75rem 0 0.5rem;
}
.prose--rich h1 { font-size: var(--fs-lg); }
.prose--rich h2 { font-size: var(--fs-md); }
.prose--rich h3, .prose--rich h4, .prose--rich h5, .prose--rich h6 { font-size: var(--fs-sm); }
.prose--rich blockquote {
    border-left: 2px solid var(--color-border-default);
    padding-left: 0.875rem;
    color: var(--color-fg-tertiary);
    margin: 0.5rem 0;
}
.prose--rich hr {
    border: 0;
    border-top: 1px solid var(--color-border-subtle);
    margin: 1rem 0;
}

/* Card title with right-aligned meta (pill, action, badge) */
.card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* File input + upload form inline */
.input-file {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    max-width: 200px;
}
.input-file::file-selector-button {
    margin-right: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-default);
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background var(--dur) var(--ease-out);
}
.input-file::file-selector-button:hover { background: var(--color-bg-overlay); }
.upload-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Meta chip muted variant */
.meta-chip--muted { color: var(--color-fg-muted); font-family: var(--font-sans); }
.meta-chip--mono { font-family: var(--font-mono); cursor: pointer; }
.meta-chip--mono:hover { border-color: var(--color-accent); color: var(--color-fg-secondary); }

/* Utility spacing */
.ml-2 { margin-left: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

/* User head — avatar + name+email block on detail pages */
.user-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Address card */
.address-card {
    padding: 1rem;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.address-card > .pill { align-self: flex-start; }
.address {
    font-style: normal;
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.address > div + div { margin-top: 0.125rem; }

/* lg: prefix support for detail page */
@media (min-width: 1024px) {
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Extra small button */
.btn--xs {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    height: 28px;
    border-radius: var(--radius-sm);
}
.btn--danger-text { color: var(--color-danger); }
.btn--danger-text:hover { color: var(--color-danger); background: rgba(248,113,113,0.08); }
.btn--success-text { color: var(--color-success); }
.btn--success-text:hover { color: var(--color-success); background: rgba(74,222,128,0.08); }

/* ──────────────────────────────
   Product grid (portal dashboard)
   ────────────────────────────── */
.product-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.product-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    color: var(--color-fg-primary);
    text-decoration: none;
    transition: transform var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out),
                box-shadow var(--dur-mid) var(--ease-out),
                background var(--dur-mid) var(--ease-out);
}
.product-card:hover {
    transform: translateY(-2px);
    border-color: rgb(var(--color-accent-rgb) /0.3);
    background: var(--color-bg-raised);
    box-shadow: 0 0 0 1px rgb(var(--color-accent-rgb) /0.14), 0 20px 40px rgba(0,0,0,0.35);
}
.product-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.product-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
    letter-spacing: var(--ls-tight);
}
.product-card__title--link {
    display: block;
    text-decoration: none;
}
.product-card__title--link:hover { color: var(--color-accent); }
.product-card__meta {
    margin: 0.25rem 0 0;
    font-size: var(--fs-xs);
    color: var(--color-fg-muted);
}
.product-card__meta--small {
    font-size: var(--fs-2xs);
}
.product-card__meta code {
    font-family: var(--font-mono);
    font-size: inherit;
}
.product-card__actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Action bar — right-aligned action wrapper above lists
   ────────────────────────────── */
.action-bar {
    margin-bottom: 1rem;
    text-align: right;
}

/* ──────────────────────────────
   Tag row — inline group of badges/pills with consistent spacing
   ────────────────────────────── */
.tag-row {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Status icon — circular badge for status / confirmation pages
   ────────────────────────────── */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgb(var(--color-accent-rgb) / 0.12);
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) / 0.24);
}
.status-icon--center {
    margin-inline: auto;
}
.status-icon--success {
    background: rgb(var(--color-success-rgb) / 0.12);
    color: var(--color-success);
    border-color: rgb(var(--color-success-rgb) / 0.28);
}
.status-icon--warning {
    background: rgb(var(--color-warning-rgb) / 0.14);
    color: var(--color-warning);
    border-color: rgb(var(--color-warning-rgb) / 0.32);
}
.status-icon--danger {
    background: rgb(var(--color-danger-rgb) / 0.14);
    color: var(--color-danger);
    border-color: rgb(var(--color-danger-rgb) / 0.32);
}
.product-card__body {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}
.product-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-accent);
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-top: auto;
    transition: gap var(--dur-mid) var(--ease-out);
}
.product-card__cta svg { width: 14px; height: 14px; }
.product-card:hover .product-card__cta { gap: 0.6rem; }
.error-hero__actions { margin-top: 1.5rem; display: inline-flex; gap: 0.5rem; }

/* ──────────────────────────────
   Product card — SERVICE entitlement meta block
   Compact key/value lines for service identifier + support expiry on the dashboard tile.
   ────────────────────────────── */
.product-card__service {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 0.875rem;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-left: 2px solid var(--color-accent-strong);
    border-radius: var(--radius-sm);
}
.product-card__service-line {
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: var(--fs-xs);
    color: var(--color-fg-primary);
}
.product-card__service-label {
    text-transform: uppercase;
    letter-spacing: var(--ls-eyebrow);
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: var(--color-fg-tertiary);
    white-space: nowrap;
}
.product-card__service-line code {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    color: var(--color-accent);
    text-align: right;
    word-break: break-all;
}
.product-card__service-line time,
.product-card__service-value {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-fg-primary);
    letter-spacing: 0;
}

/* ──────────────────────────────
   Entitlement card — service support coverage (portal product-detail hero)
   Two-column layout: hero stat (eyebrow + display-serif date + status pill)
   on the left, refined definition list on the right.
   ────────────────────────────── */
.entitlement-coverage {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
.entitlement-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2.5rem;
    padding: 2rem 2.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--dur) var(--ease-out);
}
.entitlement-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-accent-strong);
    opacity: 0.55;
    transition: opacity var(--dur) var(--ease-out);
}
.entitlement-card.is-warning::before { background: #D5A052; opacity: 0.85; }
.entitlement-card.is-lapsed::before { background: var(--color-fg-muted); opacity: 0.4; }
.entitlement-card.is-active::before,
.entitlement-card.is-perpetual::before { opacity: 0.65; }
.entitlement-card.is-lapsed { opacity: 0.8; }

.entitlement-card__primary {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.entitlement-card__eyebrow {
    margin: 0;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-eyebrow);
    color: var(--color-fg-tertiary);
    font-weight: 600;
}
.entitlement-card__date {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-h2-fluid);
    font-weight: 500;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tighter);
    color: var(--color-fg-primary);
}
.entitlement-card__status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.3125rem 0.75rem;
    font-size: var(--fs-xs);
    color: var(--color-fg-secondary);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    width: fit-content;
    font-variant-numeric: tabular-nums;
}
.entitlement-card__status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-fg-muted);
    flex-shrink: 0;
}
.entitlement-card.is-active .entitlement-card__status-dot,
.entitlement-card.is-perpetual .entitlement-card__status-dot {
    background: #6BB47B;
    box-shadow: 0 0 0 3px rgba(107, 180, 123, 0.18);
}
.entitlement-card.is-warning .entitlement-card__status-dot {
    background: #D5A052;
    box-shadow: 0 0 0 3px rgba(213, 160, 82, 0.20);
    animation: entitlement-pulse 2.4s ease-in-out infinite;
}
.entitlement-card.is-lapsed .entitlement-card__status-dot {
    background: var(--color-fg-muted);
}
@keyframes entitlement-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(213, 160, 82, 0.20); }
    50%      { box-shadow: 0 0 0 6px rgba(213, 160, 82, 0.05); }
}
@media (prefers-reduced-motion: reduce) {
    .entitlement-card.is-warning .entitlement-card__status-dot { animation: none; }
}

.entitlement-card__meta {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    border-left: 1px solid var(--color-border-subtle);
    padding-left: 2.25rem;
    align-self: center;
}
.entitlement-card__meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}
.entitlement-card__meta-row dt {
    margin: 0;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-eyebrow);
    color: var(--color-fg-tertiary);
    font-weight: 600;
}
.entitlement-card__meta-row dd {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
    line-height: var(--lh-snug);
}
.entitlement-card__meta-row dd code {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-accent);
    word-break: break-all;
}
.entitlement-card__meta-row dd time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .entitlement-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .entitlement-card__meta {
        border-left: 0;
        border-top: 1px solid var(--color-border-subtle);
        padding-left: 0;
        padding-top: 1.25rem;
    }
}

/* ──────────────────────────────
   Release-artifact uploader
   ────────────────────────────── */
.uploader {
    width: 100%;
    min-width: 280px;
    max-width: 520px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.uploader:focus-within { border-color: var(--color-border-focus); box-shadow: var(--shadow-focus); }

/* All state slots hidden by default; current state's slot is shown via [data-state] selector. */
.uploader__zone,
.uploader__preview,
.uploader__progress,
.uploader__success,
.uploader__error { display: none; }

.uploader[data-state="idle"]      .uploader__zone     { display: flex; }
.uploader[data-state="selected"]  .uploader__preview  { display: flex; }
.uploader[data-state="uploading"] .uploader__progress { display: flex; }
.uploader[data-state="success"]   .uploader__success  { display: flex; }
.uploader[data-state="error"]     .uploader__error    { display: flex; }

/* IDLE */
.uploader__zone {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 1.5px dashed var(--color-border-default);
    border-radius: var(--radius-sm);
    background: var(--color-bg-inset);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.uploader__zone:hover { border-color: var(--color-border-strong); background: var(--color-bg-raised); }
.uploader__zone--dragover { border-style: solid; border-color: var(--color-accent); background: var(--color-accent-bg); }
.uploader__zone-icon { color: var(--color-fg-tertiary); }
.uploader__zone--dragover .uploader__zone-icon { color: var(--color-accent); }
.uploader__zone-label { margin: 0; font-size: var(--fs-sm); color: var(--color-fg-secondary); }
.uploader__zone-or { color: var(--color-fg-tertiary); margin-left: 0.25rem; }
.uploader__zone-hint { margin: 0; font-size: var(--fs-xs); color: var(--color-fg-muted); font-family: var(--font-mono); }
.uploader__browse {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-accent);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.uploader__browse:hover { text-decoration: underline; }

/* SELECTED */
.uploader__preview { align-items: center; gap: 0.75rem; }
.uploader__file-icon { color: var(--color-fg-tertiary); flex: none; }
.uploader__file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.uploader__file-name {
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uploader__file-size { font-size: var(--fs-xs); color: var(--color-fg-tertiary); font-family: var(--font-mono); }
.uploader__preview-actions { display: inline-flex; gap: 0.375rem; flex: none; }

/* UPLOADING */
.uploader__progress { flex-direction: column; gap: 0.5rem; }
.uploader__progress-head, .uploader__progress-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.uploader__progress-pct {
    font-size: var(--fs-xs);
    font-family: var(--font-mono);
    color: var(--color-accent);
    flex: none;
}
.uploader__bar {
    height: 6px;
    background: var(--color-bg-raised);
    border-radius: var(--radius-pill);
    overflow: hidden;
    width: 100%;
}
.uploader__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
    border-radius: var(--radius-pill);
    transition: width 120ms linear;
}
.uploader__stats {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SUCCESS */
.uploader__success {
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    color: var(--color-success);
    font-size: var(--fs-sm);
    font-weight: 500;
    animation: uploader-pop var(--dur-slow) var(--ease-out) both;
}
.uploader__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--color-success-bg);
}
@keyframes uploader-pop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: none; }
}

/* ERROR */
.uploader__error {
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.5rem;
    border: 1px solid var(--color-danger-bg);
    background: var(--color-danger-bg);
    border-radius: var(--radius-sm);
}
.uploader__error-icon {
    color: var(--color-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    flex: none;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.15);
}
.uploader__error-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.uploader__error-title { font-size: var(--fs-sm); color: var(--color-fg-primary); font-weight: 500; }
.uploader__error-message { font-size: var(--fs-xs); color: var(--color-fg-secondary); }


/* ============================================================
   Support module — ticket detail & forms
   ============================================================ */

/* Detail layout: two-column workspace with sticky right rail */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: flex-start;
}
.detail-layout__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.detail-rail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
}
@media (max-width: 1023px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-rail { position: static; }
}

/* ============================================================
   Tabs — anchor-based with ?tab= deep-link; JS-enhanced swap
   ============================================================ */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--color-border-default);
    margin: 0 0 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.tab-nav__item {
    padding: 0.75rem 1rem;
    color: var(--color-fg-secondary);
    font-weight: 500;
    font-size: var(--fs-sm);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out);
}
.tab-nav__item:hover { color: var(--color-fg-primary); }
.tab-nav__item.is-active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}
.tab-nav__item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.tab-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.tab-panel[hidden] { display: none; }

/* Inline confirm panel — htmx-swappable destructive-action affordance */
.inline-confirm {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-raised);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: inline-confirm-in 220ms var(--ease-out);
}
.inline-confirm--danger {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.06) 0%, transparent 100%);
}
.inline-confirm__title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
}
.inline-confirm__body {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    line-height: 1.5;
}
.inline-confirm__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
@keyframes inline-confirm-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* Status pipeline (ticket lifecycle stepper) */
.support-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 0.75rem 0.25rem;
    margin: 0 0 1.5rem;
    scrollbar-width: thin;
}
.support-pipeline__step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-fg-tertiary);
    background: var(--color-neutral-bg);
    border: 1px solid var(--color-border-subtle);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.support-pipeline__step::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}
.support-pipeline__connector {
    flex: 0 0 18px;
    height: 1px;
    background: var(--color-border-default);
    align-self: center;
}
.support-pipeline__step--done {
    color: var(--color-success);
    background: var(--color-success-bg);
    border-color: rgba(74, 222, 128, 0.20);
}
.support-pipeline__step--current {
    color: var(--color-cta);
    background: rgb(var(--color-cta-rgb) / 0.14);
    border-color: rgb(var(--color-cta-rgb) / 0.35);
    box-shadow: 0 0 0 3px var(--color-cta-ring);
}
.support-pipeline__step--current::before { opacity: 1; animation: pipeline-pulse 1.6s ease-in-out infinite; }
.support-pipeline__step--upcoming { color: var(--color-fg-muted); background: transparent; }
.support-pipeline__step--rejected {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-color: rgba(248, 113, 113, 0.30);
}
@keyframes pipeline-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.55; }
}

/* Chip group — segmented selector built on native radios */
.chip-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.chip-group__input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-pill);
    background: var(--color-bg-elevated);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.chip::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-fg-muted);
    flex-shrink: 0;
    transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.chip:hover { border-color: var(--color-border-strong); color: var(--color-fg-primary); transform: translateY(-1px); }
.chip-group__input:focus-visible + .chip { box-shadow: var(--shadow-focus); border-color: var(--color-border-focus); }
.chip-group__input:checked + .chip {
    background: var(--color-accent-bg-strong);
    border-color: var(--color-accent);
    color: var(--color-fg-primary);
}
.chip-group__input:checked + .chip::before {
    background: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}
/* Semantic chip dot colors (active state) */
.chip-group__input:checked + .chip--bug::before      { background: var(--color-danger);  box-shadow: 0 0 0 3px rgba(248,113,113,0.25); }
.chip-group__input:checked + .chip--feature::before  { background: var(--color-info);    box-shadow: 0 0 0 3px rgba(96,165,250,0.25); }
.chip-group__input:checked + .chip--question::before { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(181,122,78,0.25); }
.chip-group__input:checked + .chip--low::before      { background: var(--color-fg-tertiary); }
.chip-group__input:checked + .chip--normal::before   { background: var(--color-info);    box-shadow: 0 0 0 3px rgba(96,165,250,0.25); }
.chip-group__input:checked + .chip--high::before     { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(251,191,36,0.30); }
.chip-group__input:checked + .chip--critical::before { background: var(--color-danger);  box-shadow: 0 0 0 3px rgba(248,113,113,0.30); }
.chip-group__input:checked + .chip--public::before   { background: var(--color-success); box-shadow: 0 0 0 3px rgba(74,222,128,0.25); }
.chip-group__input:checked + .chip--internal::before { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(251,191,36,0.30); }
.chip-group__input:checked + .chip--internal {
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
}
.chip--internal { color: var(--color-warning); }
.chip-group__input:disabled + .chip { opacity: 0.4; cursor: not-allowed; }

/* ──────────────────────────────
   Filter card — structured multi-row filter panel.
   Prominent search row + facet rows (.chip-group) + a footer range row, divided
   by hairlines. Shared admin pattern; pair facet rows with .chip-group for
   accessible multi-select. (inquiry/campaign lists use a scoped clone of this.)
   ────────────────────────────── */
.filter-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.25rem 1.1rem;
}
.filter-card__search {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    flex-wrap: wrap;
}
.filter-card__search .input-group { flex: 1 1 280px; min-width: 220px; }
.filter-card__search .input-group .input { padding-left: 2.25rem; }
.filter-card__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--color-border-subtle);
}
.filter-card__row-label {
    flex-shrink: 0;
    min-width: 64px;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: var(--color-fg-tertiary);
}
.filter-card__row .chip-group { flex: 1 1 auto; }
.filter-card__row .chip {
    padding: 0.35rem 0.7rem;
    font-size: var(--fs-xs);
}
.filter-card__footer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--color-border-subtle);
}
.filter-card__field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--color-fg-tertiary);
}
.filter-card__field .input,
.filter-card__field .select {
    width: auto;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    font-size: var(--fs-sm);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-fg-primary);
}
.filter-card__field .input--date { min-width: 9.25rem; }
.filter-card__date-arrow {
    color: var(--color-fg-muted);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

/* Dropzone — styled label that opens the native file picker */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border: 1.5px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg-raised);
    color: var(--color-fg-secondary);
    cursor: pointer;
    text-align: center;
    transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.dropzone:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
    color: var(--color-fg-primary);
}
.dropzone:focus-within {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
    background: var(--color-accent-bg);
}
.dropzone__icon {
    color: var(--color-accent);
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg-strong);
    border-radius: 50%;
}
.dropzone__label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-fg-primary);
}
.dropzone__label-action { color: var(--color-accent); }
.dropzone__hint {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
}
.dropzone__input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.dropzone__filelist {
    margin-top: 0.5rem;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    word-break: break-all;
    min-height: 1em;
}
.dropzone__filelist:empty::before {
    content: "No files selected";
    color: var(--color-fg-muted);
}

/* Comment thread — speaker bubble timeline */
.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.comment {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: fade-up 280ms var(--ease-out) both;
}
.comment__avatar {
    flex-shrink: 0;
    margin-top: 0.125rem;
}
.comment__bubble {
    flex: 1;
    min-width: 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-card);
    position: relative;
}
.comment__bubble::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 14px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-left: 1px solid var(--color-border-default);
    border-bottom: 1px solid var(--color-border-default);
    transform: rotate(45deg);
}
.comment__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.comment__meta-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-sm);
}
.comment__author {
    font-weight: 600;
    color: var(--color-fg-primary);
}
.comment__date {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
}
.comment__body {
    margin: 0;
    color: var(--color-fg-primary);
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.comment__attachments {
    margin-top: 0.625rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
/* Outbound = current viewer's own message, right-aligned */
.comment--outbound {
    flex-direction: row-reverse;
}
.comment--outbound .comment__bubble {
    background: var(--color-accent-bg);
    border-color: rgb(var(--color-accent-rgb) / 0.22);
}
.comment--outbound .comment__bubble::before {
    left: auto;
    right: -7px;
    border-left: 0;
    border-right: 1px solid rgb(var(--color-accent-rgb) / 0.22);
    border-bottom: 0;
    border-top: 1px solid rgb(var(--color-accent-rgb) / 0.22);
}
.comment--outbound .comment__avatar.avatar {
    background: linear-gradient(135deg, rgb(var(--color-cta-rgb) / 0.20), rgb(var(--color-cta-rgb) / 0.05));
    color: var(--color-cta);
    border-color: rgb(var(--color-cta-rgb) / 0.30);
}
/* Internal = staff-only note */
.comment--internal .comment__bubble {
    background: var(--color-warning-bg);
    border: 1px dashed var(--color-warning);
}
.comment--internal .comment__bubble::before {
    border-color: var(--color-warning);
    background: var(--color-warning-bg);
}

/* Char counter for inputs */
.char-counter {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    text-align: right;
}
.char-counter--warn { color: var(--color-warning); }
.char-counter--danger { color: var(--color-danger); }

/* Force-status danger card collapsible */
.danger-card {
    border-color: rgba(248, 113, 113, 0.25);
    background: linear-gradient(180deg, rgba(248,113,113,0.05), transparent 80%);
}
.danger-card > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    color: var(--color-danger);
    font-weight: 600;
    font-size: var(--fs-sm);
}
.danger-card > summary::-webkit-details-marker { display: none; }
.danger-card > summary::after {
    content: "";
    margin-left: auto;
    width: 8px; height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--dur) var(--ease-out);
}
.danger-card[open] > summary::after { transform: rotate(-135deg); }
.danger-card[open] > summary { margin-bottom: 0.75rem; }

/* Rail card — tighter spacing for sidebar widgets */
.rail-card { padding: 1rem 1.125rem; }
.rail-card .card__title { font-size: var(--fs-sm); margin-bottom: 0.625rem; }
.rail-card--danger {
    border-color: rgba(248, 113, 113, 0.25);
    background: linear-gradient(180deg, rgba(248,113,113,0.05), transparent 80%);
}
.rail-card--danger .card__title { color: var(--color-danger); }

/* Inline form field+button row (for status/assign/priority forms in rail) */
.inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.inline-form__row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.inline-form__row .select,
.inline-form__row .input { flex: 1; min-width: 0; }


/* ──────────────────────────────
   Modal
   ────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal[hidden] { display: none !important; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-bg-overlay);
    backdrop-filter: saturate(140%) blur(4px);
    -webkit-backdrop-filter: saturate(140%) blur(4px);
    animation: modal-fade var(--dur-fast) var(--ease-out) both;
    cursor: pointer;
}

.modal__dialog {
    position: relative;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-overlay);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    animation: modal-slide var(--dur) var(--ease-out) both;
}
.modal--sm .modal__dialog { max-width: 360px; }
.modal--lg .modal__dialog { max-width: 640px; }
.modal--xl .modal__dialog { max-width: 880px; }

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.modal__title {
    font-family: var(--font-display);
    font-variation-settings: 'opsz' 24;
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
    margin: 0;
}
.modal__close {
    background: transparent;
    border: 0;
    line-height: 1;
    color: var(--color-fg-tertiary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.modal__close:hover {
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
}
.modal__close:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.modal__body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    color: var(--color-fg-secondary);
    line-height: var(--lh-body);
    /* Critical for flex-column scroll: lets the body shrink below content size
       so overflow-y:auto actually engages instead of pushing the footer off-screen. */
    flex: 1 1 auto;
    min-height: 0;
}
.modal__sub {
    margin: 0.375rem 0 0;
    font-size: var(--fs-sm);
    color: var(--color-fg-tertiary);
    line-height: var(--lh-body);
    max-width: 56ch;
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-bg-inset);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    flex-shrink: 0;
}

@keyframes modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modal-slide {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* When body has modal open, prevent background scroll */
body.modal-open { overflow: hidden; }


/* ──────────────────────────────
   Loading skeletons (shimmer)
   ────────────────────────────── */
.skeleton {
    display: block;
    background: linear-gradient(
        90deg,
        var(--color-bg-raised) 0%,
        var(--color-bg-elevated) 40%,
        var(--color-bg-raised) 80%
    );
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
    will-change: background-position;
}

@keyframes skeleton-shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-text {
    height: 0.875em;
    margin: 0.5em 0;
    border-radius: var(--radius-xs);
}
.skeleton-text--lg { height: 1.25em; }
.skeleton-text--sm { height: 0.6875em; }
.skeleton-text--75 { width: 75%; }
.skeleton-text--50 { width: 50%; }
.skeleton-text--33 { width: 33%; }

.skeleton-circle {
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    background-size: 200px 100%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}


/* ============================================================
   Offer module — Contact Dossier (detail view)
   Editorial dossier aesthetic: status journey strip · sticky meta rail ·
   activity log as the page's spine with direction-tinted entries,
   day-grouped chronology, inline composer, and filter chips.
   ============================================================ */

/* ── Status journey strip ─────────────────────────────────── */
.status-journey {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 0.75rem 0.25rem 1rem;
    margin: 0 0 1.5rem;
    scrollbar-width: thin;
}
.status-journey__step {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0 0.25rem;
    min-width: 80px;
}
.status-journey__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    border: 1.5px solid var(--color-border-default);
    position: relative;
    transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.status-journey__label {
    font-family: var(--font-display);
    font-size: var(--fs-2xs);
    font-weight: 500;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
    white-space: nowrap;
}
.status-journey__date {
    font-size: var(--fs-2xs);
    color: var(--color-fg-muted);
    font-variant-numeric: tabular-nums;
    margin-top: -2px;
}
.status-journey__connector {
    flex: 1 1 24px;
    min-width: 24px;
    height: 1.5px;
    align-self: center;
    margin-top: -22px;
    background: var(--color-border-default);
    background-image: linear-gradient(to right, var(--color-border-default) 50%, transparent 0%);
    background-size: 6px 1.5px;
    background-repeat: repeat-x;
}
.status-journey__step--past .status-journey__dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
}
.status-journey__step--past .status-journey__label { color: var(--color-fg-secondary); }
.status-journey__step--past + .status-journey__connector {
    background: var(--color-accent);
    background-image: none;
}
.status-journey__step--current .status-journey__dot {
    background: var(--color-cta);
    border-color: var(--color-cta);
    box-shadow: 0 0 0 4px var(--color-cta-ring);
    animation: journey-pulse 2s ease-in-out infinite;
}
.status-journey__step--current .status-journey__label {
    color: var(--color-fg-primary);
    font-weight: 700;
}
.status-journey__step--terminal .status-journey__dot {
    background: var(--color-danger);
    border-color: var(--color-danger);
}
.status-journey__step--terminal .status-journey__label {
    color: var(--color-danger);
    font-weight: 600;
}
.status-journey__step--accepted .status-journey__dot {
    background: var(--color-success);
    border-color: var(--color-success);
}
.status-journey__step--accepted .status-journey__label {
    color: var(--color-success);
    font-weight: 600;
}
@keyframes journey-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--color-cta-ring); }
    50%      { box-shadow: 0 0 0 8px rgb(var(--color-cta-rgb) / 0.10); }
}


/* ── Activity Log card (the page's spine) ─────────────────── */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.activity-log__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.activity-log__title {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 500;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin: 0;
}
.activity-log__sub {
    font-size: var(--fs-sm);
    color: var(--color-fg-tertiary);
    margin: 0;
}


/* ── Inline composer (tabbed) ─────────────────────────────── */
.composer {
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.composer__tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--color-bg-inset);
    border-bottom: 1px solid var(--color-border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}
.composer__tabs::-webkit-scrollbar { display: none; }
.composer__tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.65rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-fg-tertiary);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.composer__tab:hover { color: var(--color-fg-primary); background: var(--color-neutral-bg); }
.composer__tab:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.composer__tab[aria-selected="true"] {
    color: var(--color-fg-primary);
    border-bottom-color: var(--color-accent);
    background: var(--color-bg-elevated);
}
.composer__tab-glyph {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: var(--color-fg-tertiary);
    transition: color var(--dur-fast) var(--ease-out);
}
.composer__tab[aria-selected="true"] .composer__tab-glyph { color: var(--color-accent); }
.composer__body {
    padding: 1.25rem;
    background: var(--color-bg-elevated);
}
.composer__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem 1rem;
}
.composer__row--full > * { grid-column: 1 / -1; }
.composer__row > .field--full { grid-column: 1 / -1; }
.composer__followup {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed var(--color-border-default);
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
}
.composer__followup[hidden] { display: none; }
.composer__followup-title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
    margin: 0 0 0.5rem;
}
.composer__check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    cursor: pointer;
    user-select: none;
}
.composer__check input { accent-color: var(--color-accent); width: 16px; height: 16px; }
.composer__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
}
@media (max-width: 640px) {
    .composer__row { grid-template-columns: 1fr; }
}


/* ── Filter chips ─────────────────────────────────────────── */
.filter-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
    margin-bottom: 0.25rem;
}
.filter-chip {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.filter-chip:hover { color: var(--color-fg-primary); background: var(--color-neutral-bg); }
.filter-chip:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.filter-chip[aria-pressed="true"] {
    background: var(--color-accent-bg);
    border-color: var(--color-accent);
    color: var(--color-fg-primary);
}
.filter-chip__count {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-bg);
    color: var(--color-fg-tertiary);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.filter-chip[aria-pressed="true"] .filter-chip__count {
    background: var(--color-accent);
    color: var(--color-fg-inverse);
}


/* ── Timeline (day-grouped) ───────────────────────────────── */
.timeline-v2 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.timeline-v2__day {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.timeline-v2__day-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
    margin: 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.timeline-v2__day-date {
    font-family: var(--font-mono);
    color: var(--color-fg-muted);
    font-size: var(--fs-2xs);
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}
.timeline-v2__entries {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Activity entry — base */
.activity-entry {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.activity-entry:hover { border-color: var(--color-border-default); }
.activity-entry__marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
}
.activity-entry__glyph {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-neutral-bg);
    color: var(--color-fg-secondary);
    font-size: 14px;
    line-height: 1;
}
.activity-entry__avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--color-accent-bg-strong);
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0;
}
.activity-entry__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.3rem;
}
.activity-entry__time {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    color: var(--color-fg-tertiary);
    font-variant-numeric: tabular-nums;
}
.activity-entry__type {
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-secondary);
}
.activity-entry__author {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
}
.activity-entry__author--me {
    color: var(--color-accent);
    font-weight: 500;
}
.activity-entry__subject {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--color-fg-primary);
    margin: 0 0 0.3rem;
    line-height: var(--lh-snug);
}
.activity-entry__body {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    line-height: var(--lh-normal);
    margin: 0;
    white-space: pre-line;
}
.activity-entry__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.activity-entry__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-neutral-bg);
    color: var(--color-fg-secondary);
    font-size: var(--fs-2xs);
    font-weight: 500;
    letter-spacing: var(--ls-wide);
}
.activity-entry__chip--cross-offer {
    background: var(--color-accent-bg);
    color: var(--color-accent);
    text-decoration: none;
}
.activity-entry__chip--cross-offer:hover { background: var(--color-accent-bg-strong); }
.activity-entry__chip--outcome {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}
.activity-entry__chip--outcome-resolved {
    background: var(--color-success-bg);
    color: var(--color-success);
}
.activity-entry__chip--direction-in {
    background: var(--color-success-bg);
    color: var(--color-success);
}
.activity-entry__chip--direction-out {
    background: rgb(var(--color-cta-rgb) / 0.14);
    color: var(--color-cta);
}

/* Direction modifiers — inbound (sage) vs outbound (clay) */
.activity-entry--inbound {
    border-left: 3px solid var(--color-success);
    background: var(--color-success-bg);
}
.activity-entry--outbound {
    border-right: 3px solid var(--color-cta);
    background: rgb(var(--color-cta-rgb) / 0.07);
}
.activity-entry--note {
    background: var(--color-warning-bg);
    border-left: 3px solid var(--color-warning);
}
.activity-entry--note .activity-entry__glyph {
    background: rgb(var(--color-warning-rgb) / 0.20);
    color: var(--color-warning);
}

/* System entry — minimal ribbon, no bubble */
.activity-entry--system {
    grid-template-columns: 44px minmax(0, 1fr);
    background: transparent;
    border: 0;
    border-top: 1px dashed var(--color-border-subtle);
    border-radius: 0;
    padding: 0.5rem 0.5rem 0.5rem 0.85rem;
}
.activity-entry--system .activity-entry__glyph {
    background: transparent;
    color: var(--color-fg-muted);
    width: 20px; height: 20px;
    font-size: 12px;
}
.activity-entry--system .activity-entry__subject,
.activity-entry--system .activity-entry__body {
    font-size: var(--fs-sm);
    color: var(--color-fg-tertiary);
    font-family: var(--font-sans);
    font-weight: 400;
}
.activity-entry--system .activity-entry__type { color: var(--color-fg-muted); }

/* Follow-up entry inline in timeline — diamond marker */
.activity-entry--followup {
    background: var(--color-bg-inset);
    border: 1px solid var(--color-border-default);
}
.activity-entry--followup .activity-entry__glyph {
    background: var(--color-cta);
    color: var(--color-cta-fg);
    transform: rotate(45deg);
    border-radius: var(--radius-xs);
}
.activity-entry--followup .activity-entry__glyph > * { transform: rotate(-45deg); }
.activity-entry--followup-completed { opacity: 0.65; }
.activity-entry--followup-completed .activity-entry__subject { text-decoration: line-through; }

/* Filter visibility — driven by JS adding data-filter-hide */
.activity-entry[data-filter-hide="true"] { display: none; }


/* ── Rail cards (offer detail-specific) ───────────────────── */
.rail-card .meta-list dt {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-fg-tertiary);
}
.rail-card .meta-list dd {
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
    margin: 0;
}
.rail-card__hero {
    display: block;
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 500;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    line-height: 1.1;
}
.rail-card__hero-sub {
    display: block;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-fg-tertiary);
    margin-top: 0.25rem;
}
.rail-card__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rail-card__cross {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-accent-bg);
    color: var(--color-accent);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out);
}
.rail-card__cross:hover { background: var(--color-accent-bg-strong); }

/* Follow-up cards in the rail (and inline use) */
.fu-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-left: 3px solid var(--color-border-default);
}
.fu-card__date {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-fg-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.fu-card__body {
    min-width: 0;
}
.fu-card__type {
    display: block;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-fg-tertiary);
    margin-bottom: 0.15rem;
}
.fu-card__msg {
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
    margin: 0;
    line-height: var(--lh-snug);
}
.fu-card__done {
    appearance: none;
    background: transparent;
    border: 1px solid var(--color-border-default);
    color: var(--color-fg-secondary);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: var(--fs-2xs);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.fu-card__done:hover {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success);
}
.fu-card--overdue {
    border-left-color: var(--color-danger);
    background: var(--color-danger-bg);
}
.fu-card--overdue .fu-card__date { color: var(--color-danger); font-weight: 600; }
.fu-card--today {
    border-left-color: var(--color-cta);
    background: rgb(var(--color-cta-rgb) / 0.08);
}
.fu-card--today .fu-card__date { color: var(--color-cta); font-weight: 600; }
.fu-card--completed { opacity: 0.55; }
.fu-card--completed .fu-card__msg { text-decoration: line-through; }


/* Eyebrow-style title-with-badges adjustments — keep heading on its own line on mobile */
@media (max-width: 640px) {
    .activity-log__header { flex-direction: column; align-items: flex-start; }
}

/* ──────────────────────────────
   Offer create — multi-section form
   ────────────────────────────── */
.offer-create-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 60rem;
}

.form-section { padding: 1.25rem 1.5rem; }
.form-section__head {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 0.75rem;
}
.form-section__title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 500;
    margin: 0.125rem 0 0;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
}
.form-section__sub {
    margin: 0.375rem 0 0;
    font-size: var(--fs-sm);
    color: var(--color-fg-tertiary);
}

/* ──────────────────────────────
   Combobox (typeahead over a hidden <select>)
   ────────────────────────────── */
.combobox { position: relative; }
.combobox__row { display: flex; gap: 0.5rem; align-items: stretch; }
.combobox__input { flex: 1; }
.combobox__addon { white-space: nowrap; flex-shrink: 0; }

.combobox__list {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: var(--z-overlay);
    max-height: 16rem;
    overflow-y: auto;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-raised);
    list-style: none;
    margin: 0;
    padding: 0.25rem;
}
.combobox__option {
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.combobox__option:hover,
.combobox__option--active {
    background: var(--color-bg-overlay);
    color: var(--color-fg-primary);
}
.combobox__option[aria-selected="true"] {
    color: var(--color-accent);
    font-weight: 500;
}
.combobox__option--empty {
    color: var(--color-fg-muted);
    font-style: italic;
    cursor: default;
}
.combobox__option--empty:hover { background: transparent; color: var(--color-fg-muted); }

/* ──────────────────────────────
   Date input + quick-pick chips
   ────────────────────────────── */
.date-with-chips {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.date-with-chips__input { flex: 0 1 12rem; min-width: 9rem; }

.chip-group {
    display: inline-flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.chip {
    padding: 0.3125rem 0.625rem;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-fg-secondary);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--dur) var(--ease-out);
}
.chip:hover {
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
    background: var(--color-bg-overlay);
}
.chip:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ──────────────────────────────
   Items editor (repeating rows)
   ────────────────────────────── */
.items-table {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.items-table__rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.items-table__actions { display: flex; justify-content: flex-start; }

.item-row {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    background: var(--color-bg-raised);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    transition: border-color var(--dur) var(--ease-out);
}
.item-row:focus-within { border-color: var(--color-border-default); }

.item-row__main {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) 4rem 6rem 5rem 5rem auto;
    gap: 0.625rem 0.75rem;
    align-items: end;
}
@media (max-width: 768px) {
    .item-row__main { grid-template-columns: 1fr 1fr; }
    .item-row__product { grid-column: 1 / -1; }
}
.item-row__label {
    font-size: var(--fs-2xs);
    color: var(--color-fg-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
}
.item-row__remove { align-self: end; }
.item-row__remove-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
    line-height: 1;
}
.item-row__remove-btn:hover { color: var(--color-danger); border-color: rgba(248, 113, 113, 0.45); }

.item-row__details { padding-top: 0.25rem; }

/* ──────────────────────────────
   Totals preview
   ────────────────────────────── */
.totals-preview {
    margin-top: 0.5rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-bg-base);
}
.totals-preview .eyebrow { margin-bottom: 0.5rem; }
.totals-preview__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}
.totals-preview__grid > div { display: flex; flex-direction: column; gap: 0.125rem; }
.totals-preview__grid dt {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    color: var(--color-fg-tertiary);
    margin: 0;
}
.totals-preview__grid dd {
    font-family: var(--font-mono);
    font-size: var(--fs-md);
    color: var(--color-fg-primary);
    margin: 0;
}
.totals-preview__grand dd {
    color: var(--color-accent);
    font-size: var(--fs-lg);
    font-weight: 600;
}

/* ──────────────────────────────
   Sticky form actions
   ────────────────────────────── */
.form-actions--sticky {
    position: sticky;
    bottom: 0;
    background: var(--color-bg-base);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-sm);
    margin-top: 0;
    justify-content: flex-end;
}



/* ──────────────────────────────────────────────────────────────
   Account settings / preferences surface (portal + admin /me)
   ────────────────────────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.settings { max-width: 600px; margin: 0 auto; }

/* Compact branded page header (replaces the cavernous empty hero) */
.settings-head {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}
.settings-head__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) / 0.18);
}
.settings-head__icon svg { width: 22px; height: 22px; }
.settings-head__title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: var(--ls-tight);
    line-height: 1.1;
    color: var(--color-fg-primary);
    margin: 0;
}

/* Settings card — accent-icon header + body */
.settings-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.settings-card + .settings-card { margin-top: 1.25rem; }
.settings-card__head {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem 1.375rem;
    border-bottom: 1px solid var(--color-border-subtle);
    background: linear-gradient(180deg, rgb(var(--color-accent-rgb) / 0.03), transparent);
}
.settings-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid rgb(var(--color-accent-rgb) / 0.18);
}
.settings-card__icon svg { width: 19px; height: 19px; }
.settings-card__heading { min-width: 0; }
.settings-card__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin: 0;
}
.settings-card__sub {
    font-size: var(--fs-sm);
    color: var(--color-fg-tertiary);
    margin: 0.2rem 0 0;
    line-height: 1.45;
}
.settings-card__body { padding: 1.25rem 1.375rem; }

/* Language picker — selectable radio cards */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.lang-opt {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.875rem 0.95rem;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    background: var(--color-bg-raised);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease-out),
                background-color var(--dur) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.lang-opt input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    margin: 0;
}
.lang-opt__code {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-fg-muted);
    transition: color var(--dur) var(--ease-out);
}
.lang-opt__name {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--color-fg-primary);
    line-height: 1.2;
}
.lang-opt__check {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 15px;
    height: 15px;
    color: var(--color-accent);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.lang-opt:hover { border-color: var(--color-border-strong); }
.lang-opt:active { transform: translateY(0.5px); }
.lang-opt:has(input:checked) {
    border-color: var(--color-accent);
    background: var(--color-accent-bg);
}
.lang-opt:has(input:checked) .lang-opt__code { color: var(--color-accent); }
.lang-opt:has(input:checked) .lang-opt__check { opacity: 1; transform: scale(1); }
.lang-opt:has(input:focus-visible) {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

/* Toggle row — label/description + iOS-style switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    cursor: pointer;
}
.toggle-row__text { min-width: 0; }
.toggle-row__label {
    display: block;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--color-fg-primary);
}
.toggle-row__desc {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--color-fg-tertiary);
    max-width: 44ch;
}

.switch {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
}
.switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.switch__track {
    display: inline-flex;
    align-items: center;
    width: 46px;
    height: 27px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-inset);
    border: 1px solid var(--color-border-default);
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.switch__thumb {
    width: 19px;
    height: 19px;
    border-radius: var(--radius-pill);
    background: var(--color-fg-tertiary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.switch input:checked + .switch__track {
    background: var(--color-accent);
    border-color: var(--color-accent);
}
.switch input:checked + .switch__track .switch__thumb {
    transform: translateX(19px);
    background: var(--color-fg-inverse);
}
.switch input:focus-visible + .switch__track {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Action bar */
.settings-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.settings-saved {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-success);
}
.settings-saved svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
    .lang-grid { grid-template-columns: 1fr; }
}
