/**
 * Whisser Humanizers: shared design system for every page in this folder.
 * Apple-inspired: system font, translucent materials, spring motion, light and dark themes.
 * Theme tokens hang off :root[data-theme]; assets/head.php sets it before first paint.
 */

/* ---------- Tokens ---------- */

:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
    --ease: cubic-bezier(.32, .72, 0, 1);
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --spring-soft: cubic-bezier(.3, 1.3, .5, 1);
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    color-scheme: light;
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --field: rgba(118, 118, 128, .08);
    --field-focus: #ffffff;
    --fill: rgba(118, 118, 128, .18);
    --fill-2: rgba(118, 118, 128, .10);
    --label: #1d1d1f;
    --label-2: #6e6e73;
    --label-3: #a1a1a6;
    --separator: rgba(0, 0, 0, .09);
    --hairline: rgba(0, 0, 0, .05);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, .10);
    --green: #34c759;
    --red: #ff3b30;
    --orange: #ff9500;
    --purple: #af52de;
    --switch-off: #e9e9eb;
    --seg-thumb: #ffffff;
    --material: rgba(255, 255, 255, .72);
    --material-strong: rgba(255, 255, 255, .88);
    --scrim: rgba(0, 0, 0, .28);
    --glow-1: rgba(0, 113, 227, .10);
    --glow-2: rgba(175, 82, 222, .08);
    --skeleton: rgba(118, 118, 128, .10);
    --skeleton-hi: rgba(118, 118, 128, .22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 6px rgba(0, 0, 0, .03);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10), 0 30px 80px rgba(0, 0, 0, .12);
    --focus-ring: 0 0 0 4px rgba(0, 113, 227, .20);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #161618;
    --field: rgba(118, 118, 128, .16);
    --field-focus: #2c2c2e;
    --fill: rgba(118, 118, 128, .34);
    --fill-2: rgba(118, 118, 128, .20);
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #6e6e73;
    --separator: rgba(255, 255, 255, .11);
    --hairline: rgba(255, 255, 255, .07);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, .18);
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --switch-off: #39393d;
    --seg-thumb: #636366;
    --material: rgba(28, 28, 30, .72);
    --material-strong: rgba(36, 36, 38, .88);
    --scrim: rgba(0, 0, 0, .55);
    --glow-1: rgba(10, 132, 255, .17);
    --glow-2: rgba(191, 90, 242, .11);
    --skeleton: rgba(118, 118, 128, .16);
    --skeleton-hi: rgba(118, 118, 128, .32);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .08);
    --focus-ring: 0 0 0 4px rgba(10, 132, 255, .32);
}

/* ---------- Base ---------- */

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

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* No body background: the canvas carries it so the ambient layer (z-index -1) stays visible. */
body.hz {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--label);
    font: 400 17px/1.47 var(--font);
    letter-spacing: -.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* Zero specificity, so component classes (.hz-btn, .hz-input…) always win over this reset. */
:where(.hz) :where(button, input, textarea, select) { font: inherit; color: inherit; letter-spacing: inherit; }
.hz :focus { outline: none; }
.hz :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hz ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.hz [hidden] { display: none !important; }
.hz * { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
.hz-lock { overflow: hidden; }

.hz-i {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hz-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Ambient backdrop ---------- */

.hz-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.hz-ambient::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(38% 34% at 18% 12%, var(--glow-1), transparent 70%),
        radial-gradient(34% 30% at 86% 8%, var(--glow-2), transparent 70%);
    animation: hz-drift 26s var(--ease) infinite alternate;
    will-change: transform;
}

/* ---------- Navigation ---------- */

.hz-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px max(20px, env(safe-area-inset-left)) 10px max(20px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid transparent;
    transition: border-color .3s ease, background-color .3s ease;
}

.hz-nav.is-scrolled { border-bottom-color: var(--separator); }
.hz-nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.hz-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 36px;
    margin-left: -6px;
    padding: 0 12px 0 4px;
    border-radius: 999px;
    color: var(--accent);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease, transform .3s var(--spring);
}

.hz-back .hz-i { width: 22px; height: 22px; stroke-width: 2.4; transition: transform .35s var(--spring); }

@media (hover: hover) {
    .hz-back:hover { background: var(--accent-soft); }
    .hz-back:hover .hz-i { transform: translateX(-3px); }
}

.hz-back:active { transform: scale(.95); }

/* ---------- Buttons ---------- */

.hz-btn {
    --btn-h: 44px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-h);
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: transform .3s var(--spring), background-color .2s ease, box-shadow .3s var(--ease), opacity .2s ease, color .2s ease;
}

.hz-btn .hz-i { width: 18px; height: 18px; }
.hz-btn:disabled { cursor: not-allowed; opacity: .5; }
.hz-btn.is-loading:disabled { cursor: progress; opacity: .88; }

.hz-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--accent) 85%, transparent);
}

.hz-btn-green {
    background: var(--green);
    color: #fff;
    box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--green) 85%, transparent);
}

/* Light sheen that sweeps across filled buttons on hover. */
.hz-btn-primary::after, .hz-btn-green::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .9s var(--ease);
}

.hz-btn-gray { background: var(--fill-2); color: var(--label); }
.hz-btn-tinted { background: var(--accent-soft); color: var(--accent); }
.hz-btn-sm { --btn-h: 34px; padding: 0 14px; font-size: 14px; }
.hz-btn-sm .hz-i { width: 16px; height: 16px; }
.hz-btn-lg { --btn-h: 52px; padding: 0 30px; font-size: 17px; }
.hz-btn-block { width: 100%; }

@media (hover: hover) {
    .hz-btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
        box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 90%, transparent);
        transform: translateY(-1px);
    }
    .hz-btn-green:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
    .hz-btn-primary:hover:not(:disabled)::after, .hz-btn-green:hover:not(:disabled)::after { transform: translateX(120%); }
    .hz-btn-gray:hover:not(:disabled) { background: var(--fill); }
    .hz-btn-tinted:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 24%, transparent); }
}

.hz-btn:active:not(:disabled) { transform: scale(.96); transition-duration: .12s; }

.hz-icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--fill-2);
    color: var(--label);
    cursor: pointer;
    transition: transform .3s var(--spring), background-color .2s ease, color .2s ease, opacity .2s ease;
}

.hz-icon-btn .hz-i { width: 18px; height: 18px; }
.hz-icon-btn.is-plain { background: transparent; }
.hz-icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.hz-icon-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.hz-icon-btn.is-done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.hz-icon-btn.is-done .hz-i { animation: hz-pop .45s var(--spring); }

@media (hover: hover) {
    .hz-icon-btn:hover:not(:disabled) { background: var(--fill); }
    .hz-icon-btn.is-active:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 24%, transparent); }
}

.hz-icon-btn:active:not(:disabled) { transform: scale(.86); transition-duration: .12s; }

@media (pointer: coarse) {
    .hz-icon-btn { width: 40px; height: 40px; }
}

/* Delayed tooltip under icon buttons (mouse only). */
.hz-icon-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 30;
    padding: 5px 9px;
    border-radius: 8px;
    background: var(--label);
    color: var(--bg);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px) scale(.96);
    transition: opacity .15s ease, transform .25s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
    .hz-icon-btn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0) scale(1); transition-delay: .45s; }
}

/* Theme toggle: shows the mode it switches to. */
.hz-theme-btn .hz-i { grid-area: 1 / 1; transition: transform .55s var(--spring), opacity .3s ease; }
:root[data-theme="dark"] .hz-theme-btn .i-moon,
:root:not([data-theme="dark"]) .hz-theme-btn .i-sun { opacity: 0; transform: rotate(-120deg) scale(.4); }

/* ---------- Fields ---------- */

.hz-editor {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--label);
    font-size: 17px;
    line-height: 1.6;
    letter-spacing: -.012em;
    resize: none;
    outline: none;
}

.hz-editor::placeholder { color: var(--label-3); opacity: 1; }
.hz-editor:focus-visible { outline: none; }

.hz-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--field);
    color: var(--label);
    font-size: 16px;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .25s var(--ease);
}

textarea.hz-input { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.hz-input::placeholder { color: var(--label-3); }
.hz-input:focus, .hz-input:focus-visible { outline: none; background: var(--field-focus); border-color: var(--accent); box-shadow: var(--focus-ring); }

/* ---------- Segmented control & chips ---------- */

.hz-seg {
    --n: 2;
    --i: 0;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 2px;
    border-radius: 10px;
    background: var(--fill-2);
}

.hz-seg::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc((100% - 4px) / var(--n));
    border-radius: 8px;
    background: var(--seg-thumb);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
    transform: translateX(calc(var(--i) * 100%));
}

.hz-seg.is-ready::before { transition: transform .45s var(--spring-soft); }
.hz-seg input { position: absolute; opacity: 0; pointer-events: none; }

.hz-seg label {
    display: block;
    overflow: hidden;
    padding: 8px 4px;
    border-radius: 8px;
    color: var(--label);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity .2s ease, transform .25s var(--spring);
}

.hz-seg input:checked + label { font-weight: 600; }
.hz-seg label:active { transform: scale(.95); opacity: .7; }
.hz-seg input:focus-visible + label { box-shadow: var(--focus-ring); }

.hz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hz-chips input { position: absolute; opacity: 0; pointer-events: none; }

.hz-chips label {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--fill-2);
    color: var(--label);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color .25s ease, color .25s ease, box-shadow .3s var(--ease), transform .3s var(--spring);
}

.hz-chips label:active { transform: scale(.93); }
.hz-chips input:checked + label {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent);
    animation: hz-settle .4s var(--spring);
}
.hz-chips input:focus-visible + label { box-shadow: var(--focus-ring); }

@media (hover: hover) {
    .hz-chips input:not(:checked) + label:hover { background: var(--fill); }
}

/* ---------- Switch ---------- */

.hz-switch {
    position: relative;
    display: inline-block;
    flex: none;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.hz-switch input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hz-switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background-color .3s var(--ease); }

.hz-switch .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06);
    transition: transform .4s var(--spring-soft), width .25s var(--ease);
}

.hz-switch input:checked ~ .track { background: var(--green); }
.hz-switch input:checked ~ .knob { transform: translateX(20px); }
.hz-switch:active .knob { width: 33px; }
.hz-switch:active input:checked ~ .knob { transform: translateX(14px); }
.hz-switch input:focus-visible ~ .track { box-shadow: var(--focus-ring); }

/* ---------- Slider ---------- */

.hz-range {
    --val: 50%;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.hz-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--accent) var(--val), var(--fill) var(--val));
}

.hz-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -10px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 .5px 4px rgba(0, 0, 0, .14), 0 6px 13px rgba(0, 0, 0, .14);
    transition: transform .25s var(--spring);
    -webkit-appearance: none;
    appearance: none;
}

.hz-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.hz-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--fill); }
.hz-range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }

.hz-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 .5px 4px rgba(0, 0, 0, .14), 0 6px 13px rgba(0, 0, 0, .14);
    transition: transform .25s var(--spring);
}

.hz-range:active::-moz-range-thumb { transform: scale(1.15); }
.hz-range:focus-visible { outline: none; }
.hz-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }

/* ---------- Progress, skeleton, spinner ---------- */

.hz-progress {
    position: relative;
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--fill-2);
}

.hz-progress-fill {
    position: relative;
    overflow: hidden;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    transition: width .4s var(--ease);
}

.hz-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
    transform: translateX(-100%);
    animation: hz-sweep 1.3s ease-in-out infinite;
}

.hz-skeleton { display: grid; gap: 14px; }

.hz-skeleton span {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%);
    background-size: 200% 100%;
    animation: hz-shimmer 1.4s linear infinite;
}

.hz-spinner {
    --ring: 2.5px;
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: conic-gradient(from 90deg, transparent 10%, currentColor);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring) - .5px), #000 calc(100% - var(--ring)));
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring) - .5px), #000 calc(100% - var(--ring)));
    animation: hz-spin .75s linear infinite;
}

.hz-spinner.is-lg { --ring: 3.5px; width: 34px; height: 34px; color: var(--accent); }

/* ---------- Cards, badges, counters ---------- */

.hz-card {
    background: var(--surface);
    border: .5px solid var(--hairline);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
}

.hz-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--fill-2);
    color: var(--label-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

.hz-badge .hz-i { width: 14px; height: 14px; }
.hz-badge.is-accent { background: var(--accent-soft); color: var(--accent); }

.hz-count { display: inline-block; font-variant-numeric: tabular-nums; transition: color .2s ease; }
.hz-count.is-over { color: var(--red); }
.hz-bump { animation: hz-bump .32s var(--spring); }
.hz-shake { animation: hz-shake .42s var(--ease); }

/* ---------- Overlays: sheets, dialogs, alerts ---------- */

.hz-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--scrim);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    overscroll-behavior: contain;
    transition: opacity .35s var(--ease);
}

.hz-overlay.is-open { opacity: 1; }

.hz-sheet {
    position: relative;
    width: min(100%, 480px);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 24px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(24px) scale(.96);
    transition: transform .5s var(--ease), opacity .3s ease;
}

.hz-overlay.is-open .hz-sheet { opacity: 1; transform: none; }

.hz-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.hz-sheet-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.hz-grabber { display: none; }

@media (max-width: 640px) {
    .hz-overlay.is-sheet { place-items: end stretch; padding: 0; }

    .hz-overlay.is-sheet .hz-sheet {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        opacity: 1;
        transform: translateY(100%);
    }

    .hz-overlay.is-sheet.is-open .hz-sheet { transform: none; }

    .hz-grabber {
        display: block;
        width: 38px;
        height: 5px;
        margin: 0 auto 14px;
        border-radius: 99px;
        background: var(--fill);
        cursor: grab;
    }

    .hz-overlay.is-sheet [data-drag] { touch-action: none; }
}

.hz-alert {
    width: min(100%, 300px);
    overflow: hidden;
    padding: 22px 18px 0;
    border-radius: 16px;
    background: var(--material-strong);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    box-shadow: var(--shadow-lg);
    text-align: center;
    opacity: 0;
    transform: scale(1.12);
    transition: transform .45s var(--spring), opacity .2s ease;
}

.hz-overlay.is-open .hz-alert { opacity: 1; transform: none; }
.hz-alert h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.hz-alert p { margin: 0 0 20px; color: var(--label-2); font-size: 14px; line-height: 1.4; letter-spacing: -.01em; }
.hz-alert p:first-child { color: var(--label); font-size: 16px; }

.hz-alert-actions { display: flex; margin: 0 -18px; border-top: .5px solid var(--separator); }

.hz-alert-actions button {
    flex: 1;
    height: 46px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 17px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.hz-alert-actions button + button { border-left: .5px solid var(--separator); }
.hz-alert-actions button:hover { background: var(--fill-2); }
.hz-alert-actions button:active { background: var(--fill); }
.hz-alert-actions .is-strong { font-weight: 600; }
.hz-alert-actions .is-destructive { color: var(--red); font-weight: 600; }

/* ---------- Toast (HUD that drops from the top) ---------- */

.hz-toast {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: min(92vw, 420px);
    padding: 8px 18px 8px 8px;
    border: .5px solid var(--separator);
    border-radius: 999px;
    background: var(--material-strong);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: var(--shadow-lg);
    color: var(--label);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -150%) scale(.9);
    transition: transform .55s var(--spring-soft), opacity .25s ease;
}

.hz-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

.hz-toast-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.hz-toast-icon .hz-i { width: 15px; height: 15px; stroke-width: 2.6; }
.hz-toast.is-visible .hz-toast-icon { animation: hz-pop .5s var(--spring) .1s backwards; }
.hz-toast[data-type="success"] .hz-toast-icon { background: var(--green); }
.hz-toast[data-type="error"] .hz-toast-icon { background: var(--red); }

/* ---------- Popover (word suggestions) ---------- */

.hz-popover {
    position: fixed;
    z-index: 1300;
    min-width: 150px;
    max-width: min(300px, calc(100vw - 16px));
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    border: .5px solid var(--separator);
    border-radius: 14px;
    background: var(--material-strong);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: var(--shadow-lg);
    animation: hz-pop-in .3s var(--spring-soft);
}

.hz-popover .suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--label);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.hz-popover .suggestion-item .hz-i { width: 16px; height: 16px; stroke-width: 2.6; }
.hz-popover .suggestion-item.current { color: var(--accent); font-weight: 600; }
.hz-popover .suggestion-item:hover,
.hz-popover .suggestion-item:focus-visible { background: var(--accent); color: #fff; outline: none; }

/* ---------- Accordion & collapse ---------- */

.hz-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .45s var(--ease);
}

.hz-collapse > * { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .45s; }
.hz-collapse.open { grid-template-rows: 1fr; }
.hz-collapse.open > * { visibility: visible; transition: visibility 0s; }

.hz-acc-item {
    margin-bottom: 10px;
    border: .5px solid var(--hairline);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .3s var(--ease), transform .3s var(--spring);
}

.hz-acc-item.is-open { box-shadow: var(--shadow-md); }

.hz-acc-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--label);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.hz-acc-btn .hz-i { color: var(--label-3); transition: transform .45s var(--spring-soft), color .2s ease; }
.hz-acc-item.is-open .hz-acc-btn .hz-i { color: var(--accent); transform: rotate(180deg); }
.hz-acc-item p { margin: 0; padding: 0 20px 18px; color: var(--label-2); font-size: 15px; line-height: 1.55; }

/* ---------- Included site partials (inside/*.php) ---------- */

.hz-extras { color: var(--label); }
.hz-extras :is(h1, h2, h3, h4) { color: var(--label); letter-spacing: -.02em; line-height: 1.2; }
.hz-extras :is(p, li, dd) { color: var(--label-2); line-height: 1.6; }
.hz-extras a { color: var(--accent); }
.hz-extras :is(img, video) { max-width: 100%; height: auto; border-radius: 14px; }
.hz-extras table { width: 100%; border-collapse: collapse; }
.hz-extras :is(th, td) { padding: 10px 12px; border-bottom: .5px solid var(--separator); text-align: left; }

/* ---------- Motion ---------- */

.hz-reveal { animation: hz-rise .7s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }

@keyframes hz-rise { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.985); } }
@keyframes hz-fade-in { from { opacity: 0; } }
@keyframes hz-pop { 0% { transform: scale(.5); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes hz-pop-in { from { opacity: 0; transform: scale(.9) translateY(-4px); } }
@keyframes hz-settle { from { transform: scale(.9); } }
@keyframes hz-bump { 40% { transform: scale(1.12); } }
@keyframes hz-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes hz-spin { to { transform: rotate(360deg); } }
@keyframes hz-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes hz-sweep { to { transform: translateX(100%); } }
@keyframes hz-drift { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }

/* Theme switch: a circular reveal where View Transitions exist, a colour fade elsewhere. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

.hz-theme-fade,
.hz-theme-fade *,
.hz-theme-fade *::before,
.hz-theme-fade *::after {
    transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), box-shadow .45s var(--ease) !important;
}

@media (prefers-reduced-motion: reduce) {
    .hz *, .hz *::before, .hz *::after {
        animation-delay: 0s !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .hz .hz-spinner { animation-duration: 1s !important; animation-iteration-count: infinite !important; }
}
