/* Page-wide rules shared by every Zelarion screen (components.md, motion.md, mobile.md). */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
/* The interface scale (tokens.css). The opening screen is drawn before the page and must not jump, so it
   cancels the zoom. Anything sized to the window uses --z-vh / --z-vw, which are in zoomed-page pixels. */
body { zoom: var(--z-ui-scale); }

body {
    margin: 0;
    background: var(--z-bg);
    color: var(--z-text);
    font: 400 14px/22px var(--z-font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--z-font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 34px; }
h2 { font-size: 18px; line-height: 26px; }
h3 { font-size: 15px; line-height: 22px; }
h1:focus { outline: none; }
p { margin: 0; }

a { color: var(--z-accent-strong); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--z-accent);
    outline-offset: 2px;
}

.z-muted { color: var(--z-text-muted); }
.z-label { font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: .06em; color: var(--z-text-muted); }
.z-num { font-variant-numeric: tabular-nums; }
/* Skip link: off screen until a keyboard user tabs to it, then the first thing on the page. */
.z-skip {
    position: fixed;
    top: var(--z-space-3);
    left: var(--z-space-3);
    z-index: 200;
    padding: var(--z-space-2) var(--z-space-4);
    border-radius: var(--z-radius-control);
    background: var(--z-accent-strong);
    color: var(--z-on-accent);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.z-skip:focus { transform: none; }

.z-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; }

/* Sections on bare pages, divided by hairlines instead of cards */
.z-page-head { display: flex; flex-wrap: wrap; gap: var(--z-space-4); align-items: flex-end; justify-content: space-between; padding-block: var(--z-space-6) var(--z-space-5); }
.z-page-head p { margin-top: var(--z-space-1); }
.z-section { padding-block: var(--z-space-7); }
.z-section + .z-section { border-top: 1px solid var(--z-hairline); }
.z-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--z-space-4); margin-bottom: var(--z-space-5); }

/* KPI strip: figures divided by vertical hairlines, not cards */
.z-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.z-kpi { padding: var(--z-space-4) var(--z-space-5); }
.z-kpi + .z-kpi { border-left: 1px solid var(--z-hairline); }
/* A KPI that opens its list: clickable, so it lifts (non-clickable KPIs only tint) */
.z-kpi--link { color: inherit; text-decoration: none; border-radius: var(--z-radius-control); transition: background-color var(--z-dur-hover) var(--z-ease-out), transform var(--z-dur-hover) var(--z-ease-out); }
.z-kpi--link:hover { background: var(--z-surface-2); transform: translateY(-1px); }
.z-kpis--quiet { margin-top: var(--z-space-2); border-top: 1px solid var(--z-hairline); }
.z-kpis--quiet .z-kpi__value { font-size: 20px; line-height: 28px; }
.z-kpi__value { display: block; margin-top: var(--z-space-2); font: 600 28px/34px var(--z-font-display); font-variant-numeric: tabular-nums; }

/* Non-clickable hover: tint only, no lift, no pointer */
.z-hoverable { border-radius: var(--z-radius-control); transition: background-color var(--z-dur-hover) var(--z-ease-out); }
.z-hoverable:hover { background: var(--z-surface-2); }
.z-reveal { opacity: 0; transform: translateY(2px); transition: opacity var(--z-dur-hover) var(--z-ease-out), transform var(--z-dur-hover) var(--z-ease-out); }
.z-hoverable:hover .z-reveal, .z-hoverable:focus-within .z-reveal { opacity: 1; transform: none; }

/* Staged page entry: each direct child rises in turn (motion.md) */
/* backwards, not both: after the entrance the element keeps no transform or filter. A kept one (even
   "none" computed as a matrix) makes it the containing block of every position: fixed descendant. */
.z-enter > * { animation: z-rise var(--z-dur-page) var(--z-ease-out) backwards; }
.z-enter > :nth-child(2) { animation-delay: calc(1 * var(--z-stagger)); }
.z-enter > :nth-child(3) { animation-delay: calc(2 * var(--z-stagger)); }
.z-enter > :nth-child(4) { animation-delay: calc(3 * var(--z-stagger)); }
.z-enter > :nth-child(5) { animation-delay: calc(4 * var(--z-stagger)); }
.z-enter > :nth-child(6) { animation-delay: calc(5 * var(--z-stagger)); }
.z-enter > :nth-child(7) { animation-delay: calc(6 * var(--z-stagger)); }
.z-enter > :nth-child(n+8) { animation-delay: calc(7 * var(--z-stagger)); }
@keyframes z-rise { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
    @keyframes z-rise { from { opacity: 0; } to { opacity: 1; } }
}

/* Red dot: rare, earned, pops once (components.md) */
.z-dot-host { position: relative; }
.z-dot {
    position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--z-attention); box-shadow: 0 0 0 2px var(--z-surface);
    animation: z-dot-arrive 420ms var(--z-ease-out) both;
}
/* A dot tied to a seen-key waits for zelarion.js to confirm it is unseen (no flash of a dot already seen). */
.z-dot[data-z-dot]:not([data-z-dot-shown]) { display: none; }
.z-dot--count {
    width: auto; min-width: 16px; height: 16px; padding: 0 4px; top: -6px; right: -8px;
    font: 600 10px/16px var(--z-font-body); color: var(--z-on-attention); text-align: center; border-radius: var(--z-radius-pill);
}
@keyframes z-dot-arrive { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Forms */
.z-field { display: grid; gap: var(--z-space-2); }
.z-field label { font-weight: 500; }
.z-input {
    width: 100%; min-height: 40px; padding: 0 var(--z-space-3);
    background: var(--z-surface); color: var(--z-text);
    border: 1px solid var(--z-hairline-strong); border-radius: var(--z-radius-control);
    font: inherit;
    transition: border-color var(--z-dur-hover) var(--z-ease-out), box-shadow var(--z-dur-hover) var(--z-ease-out);
}
.z-input:focus { outline: none; border-color: var(--z-accent); box-shadow: 0 0 0 3px var(--z-accent-soft); }
.validation-message, .z-error { color: var(--z-danger); font-size: 13px; }

/* An inline form puts its fields side by side, bottom-aligned with its button. A field's error hangs below its
   control instead of growing the field, so one error never lifts that field above its neighbours; while an error
   shows, the form adds the room it hangs in. Pages set the columns. */
.z-inline-form { display: grid; gap: var(--z-space-4); align-items: end; }
.z-inline-form .z-field { position: relative; }
.z-inline-form .z-field > .validation-message {
    position: absolute; inset-inline: 0; top: calc(100% + var(--z-space-1)); line-height: 1.35;
}
.z-inline-form:has(.validation-message) { row-gap: var(--z-space-8); padding-block-end: var(--z-space-6); }
.z-status { padding: var(--z-space-3) var(--z-space-4); border-radius: var(--z-radius-control); background: var(--z-accent-soft); color: var(--z-text); }
@keyframes z-status-in { from { opacity: 0; transform: translateY(-6px); } }
.z-status { animation: z-status-in 320ms cubic-bezier(0.25, 0.8, 0.25, 1); }
.z-status--error { background: color-mix(in oklab, var(--z-danger) 12%, var(--z-surface)); }

/* Tables: hairline rows, stacked rows on phones (mobile.md) */
.z-table { width: 100%; border-collapse: collapse; }
.z-table th { position: sticky; top: 0; background: var(--z-surface-2); text-align: left; font-weight: 500; color: var(--z-text-muted); }
.z-table th, .z-table td { padding: var(--z-space-3) var(--z-space-4); border-bottom: 1px solid var(--z-hairline); height: 48px; }
.z-table tbody tr { transition: background-color var(--z-dur-hover) var(--z-ease-out); }
.z-table tbody tr:hover { background: var(--z-surface-2); }
@media (max-width: 767px) {
    .z-table thead { display: none; }
    .z-table, .z-table tbody, .z-table tr, .z-table td { display: block; width: 100%; }
    .z-table tr { padding: var(--z-space-3) 0; border-bottom: 1px solid var(--z-hairline); }
    .z-table td { height: auto; border: 0; padding: 2px 0; }
    .z-table td:first-child { font-weight: 600; }
}

/* A link that starts the page's one primary action looks like the primary button */
.z-link-btn {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--z-space-4);
    border-radius: var(--z-radius-control); font-weight: 500; text-decoration: none;
    color: var(--z-on-accent);
    background: linear-gradient(180deg, color-mix(in oklab, var(--z-accent-strong) 86%, white), var(--z-accent-strong));
    /* The same lip as ZButton (ZButton.razor.css): rests on a visible edge, rises on hover, drops onto it on press. */
    box-shadow: inset 0 1px 0 var(--z-highlight), 0 var(--z-lip) 0 color-mix(in oklab, var(--z-accent-strong) 62%, black),
                0 10px 18px -8px color-mix(in oklab, var(--z-accent-strong) 55%, transparent);
    transition: transform var(--z-dur-release) var(--z-ease-spring), box-shadow var(--z-dur-release) var(--z-ease-spring),
                filter var(--z-dur-hover) var(--z-ease-out);
}
.z-link-btn:hover {
    filter: brightness(1.06); transform: translateY(-1px);
    box-shadow: inset 0 1px 0 var(--z-highlight), 0 calc(var(--z-lip) + 1px) 0 color-mix(in oklab, var(--z-accent-strong) 62%, black),
                0 12px 22px -8px color-mix(in oklab, var(--z-accent-strong) 60%, transparent);
}
.z-link-btn:active {
    transform: translateY(var(--z-lip)); filter: brightness(.96);
    box-shadow: inset 0 2px 4px rgb(var(--z-shadow-ink) / .28), 0 0 0 transparent, 0 0 0 transparent;
    transition-duration: var(--z-dur-press); transition-timing-function: var(--z-ease-out);
}

/* Everything else that can be pressed (nav links, tabs, chips that are links, menu items, icon buttons) sinks a
   little under the finger and springs back. :where() keeps this at zero specificity, so any component that designs
   its own press (the buttons above, tiles, the pager) wins without a fight. Plain text links have no class and are
   left alone. */
:where(button, summary, [role="button"], a[class]) { transition: transform var(--z-dur-release) var(--z-ease-spring); }
/* The state sits inside :where() too: outside it, ":active" alone would outweigh a component's own press. */
:where(button:active:not(:disabled), summary:active, [role="button"]:active, a[class]:active) {
    transform: scale(.97); transition-duration: var(--z-dur-press); transition-timing-function: var(--z-ease-out);
}

/* Form footer and the breadcrumb label above a page title */
.z-actions { display: flex; align-items: center; gap: var(--z-space-5); padding-top: var(--z-space-6); }
.z-page-head .z-label a { color: inherit; text-decoration: none; }
.z-page-head .z-label a:hover { color: var(--z-accent-strong); }

/* Chips */
.z-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--z-space-2); border-radius: var(--z-radius-pill); background: var(--z-surface-2); font-size: 12px; font-weight: 500; }
.z-chip--accent { background: var(--z-accent-soft); color: var(--z-accent-strong); }

/* Empty state */
.z-empty { display: grid; justify-items: start; gap: var(--z-space-3); padding: var(--z-space-8) 0; }

/* Theme switch: the circle animation runs on the new snapshot only (motion.md) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Blazor's reconnect and error surfaces */
#blazor-error-ui { display: none; }

/* Segmented tabs: a raised pill slides to the current tab (the same indicator script as the sidebar) */
.z-tabs {
    position: relative; display: inline-flex; gap: 2px; padding: 4px;
    border-radius: var(--z-radius-pill); background: var(--z-surface-2);
    box-shadow: inset 0 1px 2px rgb(var(--z-shadow-ink) / .06);
}
.z-tabs__pill {
    position: absolute; top: 4px; bottom: 4px; left: 0; opacity: 0;
    border-radius: var(--z-radius-pill); background: var(--z-surface); box-shadow: var(--z-shadow-raised);
    transition: transform var(--z-dur-state) var(--z-ease-in-out), width var(--z-dur-state) var(--z-ease-in-out), opacity var(--z-dur-state);
}
.z-tabs__tab {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: var(--z-space-2);
    min-height: 32px; padding: 0 var(--z-space-4); border-radius: var(--z-radius-pill);
    color: var(--z-text-muted); font: 500 13px/1 var(--z-font-body); text-decoration: none; white-space: nowrap;
    transition: color var(--z-dur-hover) var(--z-ease-out);
}
.z-tabs__tab:hover { color: var(--z-text); }
.z-tabs__tab[aria-current="page"] { color: var(--z-text); }

/* Delta pill beside a figure: +12% / -3% */
.z-delta { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--z-space-2); border-radius: var(--z-radius-pill); font: 600 12px/1 var(--z-font-body); font-variant-numeric: tabular-nums; background: var(--z-surface-2); color: var(--z-text-muted); }
.z-delta--up { background: color-mix(in oklab, var(--z-success) 14%, var(--z-surface)); color: var(--z-success); }
.z-delta--down { background: color-mix(in oklab, var(--z-danger) 14%, var(--z-surface)); color: var(--z-danger); }

/* Charts: lines draw in, areas fade up, bars grow from the baseline in a stagger (motion.md) */
.z-chart { position: relative; }
.z-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.z-chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: z-draw var(--z-dur-chart) var(--z-ease-out) forwards; }
.z-chart-area { opacity: 0; animation: z-fade-up var(--z-dur-chart) var(--z-ease-out) 120ms forwards; }
.z-chart-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: z-grow 720ms var(--z-ease-out) both; }
/* Stagger by position, not an inline --i: the CSP forbids style attributes. Later bars share the last delay. */
.z-chart-bar:nth-child(2) { animation-delay: calc(1 * var(--z-stagger)); }
.z-chart-bar:nth-child(3) { animation-delay: calc(2 * var(--z-stagger)); }
.z-chart-bar:nth-child(4) { animation-delay: calc(3 * var(--z-stagger)); }
.z-chart-bar:nth-child(5) { animation-delay: calc(4 * var(--z-stagger)); }
.z-chart-bar:nth-child(6) { animation-delay: calc(5 * var(--z-stagger)); }
.z-chart-bar:nth-child(7) { animation-delay: calc(6 * var(--z-stagger)); }
.z-chart-bar:nth-child(8) { animation-delay: calc(7 * var(--z-stagger)); }
.z-chart-bar:nth-child(9) { animation-delay: calc(8 * var(--z-stagger)); }
.z-chart-bar:nth-child(10) { animation-delay: calc(9 * var(--z-stagger)); }
.z-chart-bar:nth-child(11) { animation-delay: calc(10 * var(--z-stagger)); }
.z-chart-bar:nth-child(12) { animation-delay: calc(11 * var(--z-stagger)); }
.z-chart-bar:nth-child(n+13) { animation-delay: calc(12 * var(--z-stagger)); }
.donut__segment { transform-box: view-box; transform-origin: 50% 50%; animation: z-pop 640ms var(--z-ease-out) both; }
.donut__segment:nth-of-type(2) { animation-delay: calc(1 * var(--z-stagger) * 2); }
.donut__segment:nth-of-type(3) { animation-delay: calc(2 * var(--z-stagger) * 2); }
.donut__segment:nth-of-type(4) { animation-delay: calc(3 * var(--z-stagger) * 2); }
.donut__segment:nth-of-type(5) { animation-delay: calc(4 * var(--z-stagger) * 2); }
.donut__segment:nth-of-type(6) { animation-delay: calc(5 * var(--z-stagger) * 2); }
@keyframes z-pop { from { opacity: 0; transform: rotate(-12deg) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes z-draw { to { stroke-dashoffset: 0; } }
@keyframes z-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes z-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Crosshair readout over a chart: a guide, a glowing dot and a tooltip (placed by zelarion.js) */
.z-crosshair__guide, .z-crosshair__dot, .z-crosshair__tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity var(--z-dur-hover) var(--z-ease-out); }
.z-chart[data-z-crosshair-on] .z-crosshair__guide, .z-chart[data-z-crosshair-on] .z-crosshair__dot, .z-chart[data-z-crosshair-on] .z-crosshair__tip { opacity: 1; }
.z-crosshair__guide { top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--z-accent) 60%, transparent), transparent); }
.z-crosshair__dot {
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: var(--z-surface); border: 3px solid var(--z-accent);
    box-shadow: 0 0 0 6px color-mix(in oklab, var(--z-accent) 22%, transparent), 0 0 18px 2px color-mix(in oklab, var(--z-accent) 55%, transparent);
}
.z-crosshair__tip {
    transform: translate(-50%, calc(-100% - 14px)); padding: var(--z-space-2) var(--z-space-3);
    border-radius: var(--z-radius-control); background: var(--z-text); color: var(--z-bg);
    font: 500 12px/1.3 var(--z-font-body); white-space: nowrap; box-shadow: var(--z-shadow-overlay);
}
.z-crosshair__tip strong { display: block; font: 600 14px/1.3 var(--z-font-display); font-variant-numeric: tabular-nums; }
.z-crosshair__guide, .z-crosshair__dot, .z-crosshair__tip { transition-property: opacity, left, top; transition-duration: var(--z-dur-hover); }

/* Page change: the page being left softens and blurs while the next one loads (motion.md) */
.content { transition: opacity var(--z-dur-state) var(--z-ease-out), filter var(--z-dur-state) var(--z-ease-out); }
.content[data-z-leaving] { opacity: .55; filter: blur(3px) saturate(.9); }

@media (prefers-reduced-motion: reduce) {
    .z-chart-line { animation: none; stroke-dashoffset: 0; }
    .z-chart-area, .z-chart-bar, .donut__segment { animation: none; opacity: 1; }
    .content[data-z-leaving] { filter: none; }
    .z-tabs__pill { transition: opacity var(--z-dur-state); }
}

/* Panels, key-value rows, toolbars, dropdowns: the backoffice building blocks (CRM DESIGN.md §5).
   Panels are glass where the app has glass, flat otherwise; never a drop shadow. */
.z-panel {
    border: 1px solid var(--z-glass-border);
    border-radius: 16px;
    background: var(--z-surface);
    backdrop-filter: blur(var(--z-glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--z-glass-blur)) saturate(1.4);
}
.z-panel + .z-panel { margin-top: var(--z-space-4); }
.z-panel__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-4);
    min-height: 56px; padding: var(--z-space-3) var(--z-space-5);
    border-bottom: 1px solid var(--z-hairline);
}
.z-panel__head h2, .z-panel__head h3 { margin: 0; font: 600 15px/1.3 var(--z-font-display); }
.z-panel__head p { margin: 2px 0 0; color: var(--z-text-muted); font-size: 13px; }
.z-panel__actions { display: flex; flex: none; align-items: center; gap: var(--z-space-4); }
.z-panel__body { padding: var(--z-space-5); }
.z-panel__body--flush { padding: 0; }
.z-panel > .z-table th:first-child, .z-panel > .z-table td:first-child { padding-left: var(--z-space-5); }
.z-panel > .z-table th { background: transparent; }

.z-kv { display: grid; margin: 0; }
.z-kv > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: var(--z-space-4); padding: var(--z-space-3) var(--z-space-5); border-top: 1px solid var(--z-hairline); }
.z-kv > div:first-child { border-top: 0; }
.z-kv dt { color: var(--z-text-muted); font-size: 13px; }
.z-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.z-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--z-space-3); margin-bottom: var(--z-space-4); }
.z-toolbar__grow { flex: 1 1 240px; }

/* Actions menu: a <details class="z-dropdown"> opens without script; zelarion.js closes it on an
   outside click or Esc. It floats above the page, so it is the one panel here with a shadow. */
.z-dropdown { position: relative; display: inline-block; }
.z-dropdown > summary { list-style: none; cursor: pointer; }
.z-dropdown > summary::-webkit-details-marker { display: none; }
.z-dropdown__menu {
    position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 200px; padding: 6px;
    border: 1px solid var(--z-glass-border); border-radius: 12px; background: var(--z-glass-strong);
    backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6);
    box-shadow: var(--z-shadow-overlay);
    animation: z-menu-in var(--z-dur-state) var(--z-ease-out);
}
.z-dropdown__item {
    display: flex; align-items: center; gap: var(--z-space-3); width: 100%; min-height: 40px; padding: 0 var(--z-space-3);
    border: 0; border-radius: 8px; background: none; color: var(--z-text); font: 500 14px/1 var(--z-font-body);
    text-align: left; text-decoration: none; cursor: pointer;
    transition: background-color var(--z-dur-hover) var(--z-ease-out);
}
.z-dropdown__item:hover { background: var(--z-surface-2); }
.z-dropdown__item--danger { color: var(--z-danger); }
@keyframes z-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Status dot: state without a colored stripe (CRM DESIGN.md §4) */
.z-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.z-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.z-state--danger { color: var(--z-danger); }
.z-state--warm { color: var(--z-warm-strong); }
.z-state--success { color: var(--z-success); }
.z-state--muted { color: var(--z-text-muted); }

/* Deal board drag and drop (CRM DESIGN.md §6): the lifted card, the lane under the pointer, and the
   placeholder that opens where the card will land. Placed and animated by zelarion.js. */
/* Text on a draggable card is not selectable and its links do not start a native drag: a selection
   pressed on, or a native drag, makes the browser cancel the pointer gesture mid-drag. */
@media (min-width: 1280px) {
    [data-z-card][data-z-draggable] { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
    [data-z-card][data-z-draggable] a, [data-z-card][data-z-draggable] img { -webkit-user-drag: none; }
}
.z-dragging {
    position: fixed !important; z-index: 60; margin: 0 !important; pointer-events: none;
    cursor: grabbing; box-shadow: var(--z-shadow-lift) !important; transform-origin: 50% 40%;
}
/* The real card stays in the DOM, hidden, while a copy on <body> follows the pointer. */
.z-drag-source { display: none !important; }
/* The carried copy is opaque: a translucent card over the cards under it reads as a ghost. */
.z-dragging { background: var(--z-surface-opaque) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html[data-z-board-saving] [data-z-card] { cursor: progress !important; }
[data-z-lane][data-z-over] { border-color: var(--z-accent) !important; border-style: solid !important; background: color-mix(in oklab, var(--z-accent-soft) 70%, transparent) !important; }
.z-drop-placeholder {
    box-sizing: border-box; flex: none; overflow: hidden;
    border: 1.5px dashed color-mix(in oklab, var(--z-accent) 55%, transparent); border-radius: 12px;
    background: color-mix(in oklab, var(--z-accent-soft) 60%, transparent);
    box-shadow: inset 0 2px 6px rgb(var(--z-shadow-ink) / .08);
}
html[data-z-board-dragging], html[data-z-board-dragging] * { cursor: grabbing !important; user-select: none; }

/* Side panel (ZDrawer): slides in from the right over a softened page (CRM DESIGN.md §5) */
html:has(.z-drawer) { overflow: hidden; }
.z-drawer { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.z-drawer__scrim {
    position: absolute; inset: 0; background: rgb(var(--z-shadow-ink) / .28);
    backdrop-filter: blur(6px) saturate(.9); -webkit-backdrop-filter: blur(6px) saturate(.9);
    animation: z-scrim-in var(--z-dur-state) var(--z-ease-out) both;
}
.z-drawer__panel {
    position: relative; display: flex; flex-direction: column; width: min(560px, var(--z-vw)); height: 100%;
    border-left: 1px solid var(--z-glass-border); background: var(--z-glass-strong);
    backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6);
    box-shadow: var(--z-shadow-overlay);
    animation: z-drawer-in 420ms var(--z-ease-out) both;
}
@media (min-width: 768px) { .z-drawer__panel { height: calc(100% - 24px); margin: 12px; border: 1px solid var(--z-glass-border); border-radius: 16px; } }
.z-drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--z-space-4); padding: var(--z-space-5) var(--z-space-6); border-bottom: 1px solid var(--z-hairline); }
.z-drawer__head h2 { margin: 0; font: 600 18px/1.3 var(--z-font-display); }
.z-drawer__head p { margin: 4px 0 0; color: var(--z-text-muted); font-size: 13px; }
.z-drawer__close { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; color: var(--z-text-muted); text-decoration: none; transition: background-color var(--z-dur-hover) var(--z-ease-out), color var(--z-dur-hover) var(--z-ease-out); }
.z-drawer__close:hover { background: var(--z-surface-2); color: var(--z-text); }
.z-drawer__body { flex: 1; overflow: auto; padding: var(--z-space-6); overscroll-behavior: contain; }
.z-drawer__body form { display: grid; gap: var(--z-space-5); align-content: start; }
.z-drawer__foot {
    position: sticky; bottom: calc(-1 * var(--z-space-6)); display: flex; justify-content: flex-end; gap: var(--z-space-3);
    margin: 0 calc(-1 * var(--z-space-6)) calc(-1 * var(--z-space-6)); padding: var(--z-space-4) var(--z-space-6);
    border-top: 1px solid var(--z-hairline); background: var(--z-glass-strong);
}
.z-drawer[data-z-closing] .z-drawer__panel { animation: z-drawer-out 240ms var(--z-ease-in-out) both; }
.z-drawer[data-z-closing] .z-drawer__scrim { animation: z-scrim-out 240ms var(--z-ease-in-out) both; }
@keyframes z-drawer-in { from { transform: translateX(calc(100% + 24px)); opacity: .6; } }
@keyframes z-drawer-out { to { transform: translateX(calc(100% + 24px)); opacity: .6; } }
@keyframes z-scrim-in { from { opacity: 0; } }
@keyframes z-scrim-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .z-drawer__panel, .z-drawer[data-z-closing] .z-drawer__panel { animation: z-scrim-in var(--z-dur-state) both; }
}

/* An app with a glass shell paints its blurred photo behind everything (tokens: --z-backdrop). Kept
   here, not in the layout's scoped CSS, so the token's relative url() resolves next to the images. */
.shell[data-glass][data-app] { background: var(--z-backdrop) center / cover no-repeat fixed, var(--z-bg); }

/* A person's avatar keeps one color everywhere (MemberName.Tone). Doubled attribute: it must beat the
   pages' scoped .avatar rules, which load after this file. */
.avatar[data-tone][data-tone="1"] { --tone: var(--z-series-1); }
.avatar[data-tone][data-tone="2"] { --tone: var(--z-series-2); }
.avatar[data-tone][data-tone="3"] { --tone: var(--z-series-3); }
.avatar[data-tone][data-tone="4"] { --tone: var(--z-series-4); }
.avatar[data-tone][data-tone="5"] { --tone: var(--z-series-5); }
.avatar[data-tone][data-tone] {
    background: color-mix(in oklab, var(--tone) 20%, var(--z-surface-opaque));
    color: color-mix(in oklab, var(--tone) 55%, var(--z-text));
}

/* Short labels center on their capitals, not their line box, which sits them low. */
.avatar, .z-chip { text-box: trim-both cap alphabetic; }

/* A menu's trigger keeps its pressed look while the menu is open. */
details.z-dropdown[open] > summary { background: var(--z-surface-2); color: var(--z-text); }

/* Select boxes: the system arrow is replaced by one drawn in the text color, so a select looks like the
   other inputs in both themes. The arrow is two small gradients, not an image. */
select.z-input {
    appearance: none;
    padding-right: var(--z-space-8);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--z-text-muted) 50%),
        linear-gradient(135deg, var(--z-text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}
select.z-input:hover { border-color: var(--z-text-muted); }

/* A menu grows out of its trigger instead of appearing whole. */
@keyframes z-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
details.z-dropdown[open] > .z-dropdown__menu { transform-origin: top right; animation: z-menu-in 160ms var(--z-ease-out); }
.z-dropdown__item { transition: background-color var(--z-dur-hover) var(--z-ease-out), color var(--z-dur-hover) var(--z-ease-out); }
.z-dropdown__item[aria-current="true"] { color: var(--z-accent-strong); font-weight: 600; }

/* A search field with its icon inside: used by list toolbars and the header. */
.z-search { position: relative; display: block; }
.z-search > .z-icon { position: absolute; top: 50%; left: var(--z-space-3); width: 16px; height: 16px; color: var(--z-text-muted); transform: translateY(-50%); pointer-events: none; }
.z-search > .z-input { padding-left: var(--z-space-8); }

/* Opening screen: its styles are in boot.css, which loads first (see App.razor). */
html[data-z-boot="done"] .z-boot__mark { transform: scale(1.12); transition: transform 420ms var(--z-ease-out); }
html[data-z-boot="on"] body { overflow: hidden; }

/* The open list of a select, drawn by us instead of the system (customizable select). A browser without
   it keeps its own list and the arrow above; nothing breaks. The list sits in the top layer, so a drawer
   or a panel never clips it. */
@supports (appearance: base-select) {
    select.z-input, select.z-input::picker(select) { appearance: base-select; }
    select.z-input {
        display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-2);
        padding-right: var(--z-space-3); background-image: none;
    }
    select.z-input::picker-icon { color: var(--z-text-muted); transition: rotate var(--z-dur-state) var(--z-ease-out); }
    select.z-input:open::picker-icon { rotate: 180deg; }
    select.z-input:open { border-color: var(--z-accent); box-shadow: 0 0 0 3px var(--z-accent-soft); }

    select.z-input::picker(select) {
        max-height: min(320px, calc(var(--z-vh) * .5)); margin-block: 6px; padding: 6px;
        border: 1px solid var(--z-hairline); border-radius: 12px;
        background: var(--z-surface-opaque); color: var(--z-text);
        box-shadow: var(--z-shadow-overlay);
        scrollbar-width: thin;
        /* Grows out of the field; allow-discrete lets it also animate while it leaves. */
        opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top center;
        transition: opacity 160ms var(--z-ease-out), transform 160ms var(--z-ease-out),
                    overlay 160ms allow-discrete, display 160ms allow-discrete;
    }
    select.z-input:open::picker(select) { opacity: 1; transform: none; }
    @starting-style {
        select.z-input:open::picker(select) { opacity: 0; transform: translateY(-4px) scale(.98); }
    }

    select.z-input option {
        display: flex; align-items: center; gap: var(--z-space-3);
        min-height: 36px; padding: 0 var(--z-space-3); border-radius: 8px;
        color: var(--z-text); cursor: pointer;
        transition: background-color var(--z-dur-hover) var(--z-ease-out);
    }
    select.z-input option:hover, select.z-input option:focus-visible { background: var(--z-surface-2); outline: none; }
    select.z-input option:checked { background: var(--z-accent-soft); color: var(--z-accent-strong); font-weight: 600; }
    /* The tick goes to the right edge, so the names line up on the left. */
    select.z-input option::checkmark { order: 1; margin-left: auto; color: var(--z-accent-strong); }
}

/* Date and time picker (zelarion.js): the suite's own panel instead of the browser's blue pop-up. It sits inside
   the app's shell, so --z-accent is the app's colour (green in Steward, orange in Charter). */
input[type="checkbox"], input[type="radio"] { accent-color: var(--z-accent-strong); }
@media (pointer: fine) {
    input[type="date"]::-webkit-calendar-picker-indicator,
    input[type="time"]::-webkit-calendar-picker-indicator,
    input[type="datetime-local"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
}
.z-picker {
    position: fixed; inset: auto; margin: 0; padding: var(--z-space-3);
    border: 1px solid var(--z-glass-border); border-radius: 14px; background: var(--z-glass-strong); color: var(--z-text);
    backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6);
    box-shadow: var(--z-shadow-overlay);
    font: 500 14px/1 var(--z-font-body);
}
.z-picker:popover-open { animation: z-menu-in var(--z-dur-state) var(--z-ease-out); }
.z-picker__body { display: flex; gap: var(--z-space-3); align-items: stretch; }
.z-picker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--z-space-2); }
.z-picker__head strong { font: 600 14px/1.2 var(--z-font-display); }
.z-picker__nav, .z-picker__day, .z-picker__option, .z-picker__link, .z-picker__done {
    border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
    transition: background-color var(--z-dur-hover) var(--z-ease-out), color var(--z-dur-hover) var(--z-ease-out);
}
.z-picker__nav { width: 32px; height: 32px; border-radius: 8px; font-size: 20px; color: var(--z-text-muted); }
.z-picker__nav:hover { background: var(--z-accent-soft); color: var(--z-text); }
.z-picker__grid { display: grid; grid-template-columns: repeat(7, 36px); gap: 2px; }
.z-picker__weekday { display: grid; place-items: center; height: 28px; font-size: 12px; color: var(--z-text-muted); }
.z-picker__day { height: 36px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.z-picker__day:hover:not(:disabled) { background: var(--z-accent-soft); }
.z-picker__day[data-outside] { color: var(--z-text-muted); opacity: .6; }
.z-picker__day[data-today] { box-shadow: inset 0 0 0 1.5px var(--z-accent); }
.z-picker__day:disabled { opacity: .3; cursor: not-allowed; }
.z-picker__day[aria-pressed="true"], .z-picker__option[aria-pressed="true"] {
    background: var(--z-accent-strong); color: var(--z-on-accent); font-weight: 600;
}
.z-picker__clock { display: flex; gap: 4px; }
.z-picker__calendar + .z-picker__clock { padding-left: var(--z-space-3); border-left: 1px solid var(--z-hairline); }
.z-picker__column {
    display: grid; align-content: start; gap: 2px; width: 52px; max-height: 268px; overflow-y: auto;
    scrollbar-width: thin; overscroll-behavior: contain;
}
.z-picker__option { height: 34px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.z-picker__option:hover:not([aria-pressed="true"]) { background: var(--z-accent-soft); }
.z-picker__foot {
    display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-3);
    margin-top: var(--z-space-3); padding-top: var(--z-space-2); border-top: 1px solid var(--z-hairline);
}
.z-picker__actions { display: flex; gap: var(--z-space-2); }
.z-picker__link { height: 32px; padding: 0 var(--z-space-2); border-radius: 8px; color: var(--z-accent-strong); }
.z-picker__link:hover { background: var(--z-accent-soft); }
.z-picker__done { height: 32px; padding: 0 var(--z-space-3); border-radius: 8px; background: var(--z-accent-strong); color: var(--z-on-accent); font-weight: 600; }
.z-picker__done:hover { filter: brightness(1.08); }
.z-picker button:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .z-picker:popover-open { animation: none; } }
/* The part of a date or time field being typed in (day, month, hour…) is highlighted in the app's colour too. */
::-webkit-datetime-edit-day-field:focus, ::-webkit-datetime-edit-month-field:focus, ::-webkit-datetime-edit-year-field:focus,
::-webkit-datetime-edit-hour-field:focus, ::-webkit-datetime-edit-minute-field:focus, ::-webkit-datetime-edit-ampm-field:focus {
    background: var(--z-accent-strong); color: var(--z-on-accent); border-radius: 4px;
}

/* The map (map.js, ADR 0021). Global: its parts are made by script, which scoped CSS cannot reach.
   Layers, bottom to top: tiles, pins and circles, then the controls, credit and search (z-index 2 and 3).
   The script adds the tiles after the markup's own children, so without z-index it would cover the credit. */
.z-map {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border-radius: var(--z-radius-card);
    background: #AAD3DF; /* OpenStreetMap's sea, so the box never flashes white while tiles load */
    box-shadow: 0 0 0 1px var(--z-hairline);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.z-map:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 2px; }
.z-map[data-z-map-pin] { cursor: grab; }
.z-map[data-z-map-dragging] { cursor: grabbing; }
.z-map__tiles, .z-map__overlay { position: absolute; inset: 0; }
.z-map__tiles { z-index: 0; }
.z-map__overlay { z-index: 1; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.z-map__tile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; max-width: none; }
.z-map__ring { fill: color-mix(in oklab, var(--z-accent) 16%, transparent); stroke: var(--z-accent); stroke-width: 2; }
.z-map__ring--new { stroke-dasharray: 6 4; }
.z-map__pin { fill: var(--z-accent-strong); stroke: #FFFFFF; stroke-width: 2; }
.z-map__pin--new { fill: var(--z-danger); }
.z-map__label { fill: #1A1A1A; font: 600 12px var(--z-font-body); paint-order: stroke; stroke: #FFFFFF; stroke-width: 3px; }

/* The search floats over the map, top left, in line with its edge: one raised layer, no button (Enter searches). */
.z-map__search {
    position: absolute;
    top: var(--z-space-3);
    left: var(--z-space-3);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: var(--z-space-2);
    width: min(400px, calc(100% - 2 * var(--z-space-3)));
    height: 46px;
    padding: 0 var(--z-space-3);
    border-radius: var(--z-radius-pill);
    background: var(--z-surface-opaque); /* solid over the map, also in the glass shell */
    box-shadow: var(--z-shadow-overlay);
    cursor: text;
    transition: box-shadow var(--z-dur-hover) var(--z-ease-out);
}
.z-map__search:focus-within { box-shadow: var(--z-shadow-overlay), 0 0 0 2px var(--z-accent); }
.z-map__search-icon { display: inline-flex; flex: none; color: var(--z-text-muted); }
.z-map__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--z-text);
    font: 400 14px/1.4 var(--z-font-body);
    outline: none;
}
/* The pill shows the focus (its own ring); a second ring around the input inside it would double it. */
.z-map__search-input:focus, .z-map__search-input:focus-visible { outline: none; box-shadow: none; }
.z-map__search-input::placeholder { color: var(--z-text-muted); }
.z-map__search-key {
    flex: none;
    padding: 2px 7px;
    border: 1px solid var(--z-hairline-strong);
    border-radius: 6px;
    color: var(--z-text-muted);
    font: 500 11px/1.4 var(--z-font-body);
    opacity: 0;
    transition: opacity var(--z-dur-hover) var(--z-ease-out);
}
.z-map__search:focus-within .z-map__search-key { opacity: 1; }

.z-map__results {
    position: absolute;
    top: calc(var(--z-space-3) + 46px + var(--z-space-1));
    left: var(--z-space-3);
    z-index: 3;
    width: min(400px, calc(100% - 2 * var(--z-space-3)));
    max-height: 280px;
    margin: 0;
    padding: var(--z-space-1);
    overflow-y: auto;
    border-radius: var(--z-radius-card);
    background: var(--z-surface-opaque); /* solid over the map, also in the glass shell */
    box-shadow: var(--z-shadow-overlay);
    list-style: none;
}
.z-map__results[hidden] { display: none; }
.z-map__result {
    display: block;
    width: 100%;
    padding: var(--z-space-2) var(--z-space-3);
    border: 0;
    border-radius: var(--z-radius-control);
    background: none;
    color: var(--z-text);
    font: 400 13px/1.4 var(--z-font-body);
    text-align: left;
    cursor: pointer;
}
.z-map__result:hover, .z-map__result:focus-visible { background: var(--z-surface-2); }
.z-map__result-note { padding: var(--z-space-2) var(--z-space-3); color: var(--z-text-muted); font-size: 13px; }

.z-map__controls { position: absolute; right: var(--z-space-3); bottom: var(--z-space-6); z-index: 2; display: grid; gap: var(--z-space-1); }
.z-map__button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--z-radius-pill);
    background: var(--z-surface-opaque); /* solid over the map, also in the glass shell */
    color: var(--z-text);
    box-shadow: var(--z-shadow-overlay);
    font: 600 18px/1 var(--z-font-body);
    cursor: pointer;
    transition: transform var(--z-dur-hover) var(--z-ease-out);
}
.z-map__button:hover { transform: translateY(-1px); }
.z-map__button:active { transform: scale(.94); }
.z-map__credit {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 2px 6px;
    border-top-left-radius: 6px;
    background: rgb(255 255 255 / .85);
    color: #1A1A1A;
    font-size: 11px;
}
.z-map__credit a { color: inherit; }

/* Tables on phones (class z-table--cards): no sideways scrolling. Each row becomes a card; each cell shows its
   column name from data-label beside its value. data-cell="title" is the card's heading, data-cell="actions" its
   button row at the bottom. The markup stays one table, so desktop and screen readers keep rows and columns. */
@media (max-width: 720px) {
    .z-table--cards, .z-table--cards tbody { display: grid; gap: var(--z-space-3); }
    .z-table--cards thead, .z-table--cards caption {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .z-table--cards tbody tr {
        display: grid; gap: var(--z-space-2); padding: var(--z-space-4);
        border: 1px solid var(--z-glass-border); border-radius: var(--z-radius-card);
        background: var(--z-glass-strong); box-shadow: var(--z-shadow-card);
    }
    .z-table--cards tbody tr:hover { background: var(--z-glass-strong); }
    .z-table--cards td, .z-table--cards tbody th {
        display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); gap: var(--z-space-3); align-items: baseline;
        height: auto; min-height: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere;
    }
    .z-table--cards td[data-label]::before, .z-table--cards tbody th[data-label]::before {
        content: attr(data-label); color: var(--z-text-muted); font-size: 13px; font-weight: 500;
    }
    .z-table--cards td:not([data-label]), .z-table--cards tbody th:not([data-label]) { display: block; }
    .z-table--cards td > .z-chip { justify-self: start; }
    .z-table--cards [data-cell="title"] { font: 600 16px/1.3 var(--z-font-display); }
    .z-table--cards [data-cell="actions"] {
        display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--z-space-2);
        margin-top: var(--z-space-1); padding-top: var(--z-space-3); border-top: 1px solid var(--z-hairline);
    }
    .z-table--cards [data-cell="actions"]:empty { display: none; }
}

/* Theme switch drawing (ZThemeIcon): in dark, the core grows and turns, the rays spin in and vanish, and the mask's
   disc slides across to carve a crescent. The page's own data-theme drives it. */
.z-theme-icon { overflow: visible; }
.z-theme-icon__core { transform-origin: 12px 12px; transition: transform 620ms var(--z-ease-spring); }
.z-theme-icon__rays {
    transform-origin: 12px 12px;
    transition: transform 700ms var(--z-ease-spring), opacity 320ms var(--z-ease-out);
}
.z-theme-icon__cut { transform: translate(14px, -14px); transition: transform 620ms var(--z-ease-out); }
[data-theme="dark"] .z-theme-icon__core { transform: scale(1.55) rotate(-90deg); }
[data-theme="dark"] .z-theme-icon__rays { transform: rotate(-180deg) scale(.2); opacity: 0; }
[data-theme="dark"] .z-theme-icon__cut { transform: translate(5px, -4px); }
@media (prefers-reduced-motion: reduce) {
    .z-theme-icon__core, .z-theme-icon__rays, .z-theme-icon__cut { transition: none; }
}

/* Dropdown list (zelarion.js, openListbox): the suite's own list for a <select>, in the picker's glass and the app's
   accent. The chosen option is filled and ticked; the keyboard focus ring is the accent. */
.z-listbox {
    position: fixed; inset: auto; margin: 0; padding: var(--z-space-1);
    max-height: min(320px, calc(var(--z-vh) * .5)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    border: 1px solid var(--z-glass-border); border-radius: 12px; background: var(--z-glass-strong); color: var(--z-text);
    backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--z-glass-blur)) saturate(1.6);
    box-shadow: var(--z-shadow-overlay);
}
.z-listbox:popover-open { animation: z-menu-in var(--z-dur-state) var(--z-ease-out); transform-origin: top center; }
.z-listbox__group {
    padding: var(--z-space-2) var(--z-space-3) var(--z-space-1);
    color: var(--z-text-muted); font: 600 11px/1.2 var(--z-font-body); letter-spacing: .06em; text-transform: uppercase;
}
.z-listbox__option {
    display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-4);
    width: 100%; min-height: 36px; padding: 0 var(--z-space-3);
    border: 0; border-radius: 8px; background: none; color: inherit; font: 500 14px/1.2 var(--z-font-body);
    text-align: left; cursor: pointer;
    transition: background-color var(--z-dur-hover) var(--z-ease-out);
}
.z-listbox__option:hover:not(:disabled) { background: var(--z-accent-soft); }
.z-listbox__option:focus-visible { outline: 2px solid var(--z-accent); outline-offset: -2px; }
.z-listbox__option:disabled { opacity: .4; cursor: not-allowed; }
.z-listbox__option[aria-selected="true"] { background: var(--z-accent-strong); color: var(--z-on-accent); font-weight: 600; }
.z-listbox__check { visibility: hidden; font-size: 13px; }
.z-listbox__option[aria-selected="true"] .z-listbox__check { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .z-listbox:popover-open { animation: none; } }

/* Skeletons (ZSkeletons.razor, shown by zelarion.js while the next page is on its way). Soft blocks in the shapes of
   the page; one light sweeps across them all together, so it reads as one surface loading, not forty. */
html[data-z-loading] #main > :not(.z-sk-layer) { visibility: hidden; }
#main:has(> .z-sk-layer) { position: relative; }
/* The layer covers <main> and takes its padding, so the skeleton lines up with where the page will draw. */
.z-sk-layer { position: absolute; inset: 0; z-index: 1; box-sizing: border-box; padding: inherit; animation: z-sk-in 220ms var(--z-ease-out) both; }
@keyframes z-sk-in { from { opacity: 0; } }
.z-sk {
    display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(100deg, var(--z-surface-2) 30%, color-mix(in oklab, var(--z-surface-2) 55%, var(--z-surface)) 50%, var(--z-surface-2) 70%)
        0 0 / 300% 100% fixed;
    animation: z-sk-sweep 1.4s var(--z-ease-in-out) infinite;
}
@keyframes z-sk-sweep { from { background-position-x: 100%; } to { background-position-x: 0%; } }
.z-sk-page { display: grid; gap: var(--z-space-5); }
.z-sk-head, .z-sk-stack, .z-sk-field, .z-sk-panel, .z-sk-lane, .z-sk-tile { display: grid; gap: var(--z-space-2); align-content: start; }
.z-sk--title { height: 30px; width: min(280px, 60%); border-radius: 8px; }
.z-sk--line { width: 100%; }
.z-sk--w20 { width: 20%; } .z-sk--w30 { width: 30%; } .z-sk--w40 { width: 40%; } .z-sk--w50 { width: 50%; } .z-sk--w60 { width: 60%; }
.z-sk--field { height: 40px; border-radius: var(--z-radius-control); }
.z-sk--pill { height: 40px; width: 140px; border-radius: var(--z-radius-control); }
.z-sk--avatar { width: 36px; height: 36px; border-radius: 50%; }
.z-sk--chip { width: 64px; height: 22px; border-radius: var(--z-radius-pill); }
.z-sk--cell { width: 110px; }
.z-sk--icon { width: 36px; height: 36px; border-radius: 10px; }
.z-sk--number { height: 28px; width: 50%; border-radius: 8px; }
.z-sk--chart { height: 200px; border-radius: 12px; }
.z-sk--card { height: 92px; border-radius: 12px; }
.z-sk--button { height: 56px; width: 200px; border-radius: var(--z-radius-control); justify-self: end; }
.z-sk-bar { display: flex; gap: var(--z-space-3); }
.z-sk-bar .z-sk--field { flex: 1; }
.z-sk-rows { display: grid; border: 1px solid var(--z-hairline); border-radius: var(--z-radius-card); background: var(--z-surface); }
.z-sk-row {
    display: grid; grid-template-columns: 36px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 64px; align-items: center;
    gap: var(--z-space-4); min-height: 64px; padding: 0 var(--z-space-4); border-bottom: 1px solid var(--z-hairline);
}
.z-sk-row:last-child { border-bottom: 0; }
.z-sk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--z-space-3); }
.z-sk-tile, .z-sk-panel, .z-sk-lane {
    padding: var(--z-space-4); border: 1px solid var(--z-glass-border); border-radius: var(--z-radius-card); background: var(--z-glass-strong);
}
.z-sk-tile { min-height: 132px; }
.z-sk-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--z-space-4); }
.z-sk-panel { gap: var(--z-space-3); }
.z-sk-panel--form { max-width: 720px; }
.z-sk-panel--hero { min-height: 160px; }
.z-sk-pair { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--z-space-4); }
.z-sk-lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--z-space-3); }
@media (max-width: 720px) {
    .z-sk-bar .z-sk--pill { display: none; }
    .z-sk-rows { border: 0; background: none; gap: var(--z-space-3); }
    .z-sk-row { grid-template-columns: 36px minmax(0, 1fr); padding: var(--z-space-4); border: 1px solid var(--z-glass-border); border-radius: var(--z-radius-card); background: var(--z-glass-strong); }
    .z-sk-row > .z-sk--cell, .z-sk-row > .z-sk--chip { grid-column: 2; }
    .z-sk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .z-sk-split, .z-sk-lanes { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .z-sk { animation: none; } .z-sk-layer { animation: none; } }
