/*
   \==================================================================
   \==   @ Halyt                                                    ==
   \==   @ author: Mai Quoc Viet                                    ==
   \==   @ project: halyt                                           ==
   \==   @ copyright: (c) 2026 Halyt. All rights reserved.          ==
   \==================================================================
*/

/* Admin UI kit.

   One stylesheet for the whole staff side: the shell, Django's own change
   lists and forms, the overview, reports, the KYC and notification desks, and
   the sign-in page. It loads after Django's admin CSS and reuses its variable
   names where Django reads them, so the stock tables and forms take the kit's
   palette without each rule being rewritten.

   The @import has to be the first rule in the file. */
@import url("fonts-be-vietnam-pro.872918d100d3.css");

/* Tokens. Brand values from docs/brand.md; the rest is derived from them.
   Selectors carry the attribute so they outrank Django's own
   `html[data-theme="light"], :root` block, which would otherwise win. */
:root[data-theme="light"],
:root:not([data-theme]) {
    color-scheme: light;

    --hv-ink: #10201a;
    --hv-paper: #ffffff;
    --hv-bone: #f5f1ea;
    --hv-lavender: #9fd3bf;
    --hv-mist: #a3ada7;
    --hv-purple: #0e5a4e;
    /* The logo colour: set it to the project's logo colour. */
    --hv-logo: #0e5a4e;

    --hv-bg: #f3f0e9;
    --hv-surface: #fffdfa;
    --hv-surface-2: #f7f4ee;
    --hv-surface-3: #ebe6dc;
    --hv-field-bg: #ffffff;
    --hv-line: #e2ddd3;
    --hv-line-strong: #cfc8bb;
    --hv-text: #10201a;
    --hv-text-2: #46524d;
    --hv-muted: #6b756f;

    --hv-accent: #0e5a4e;
    --hv-accent-hover: #0a4439;
    --hv-accent-ink: #ffffff;
    --hv-accent-soft: #d8e6df;
    --hv-accent-text: #0a4439;
    --hv-focus: rgba(14, 90, 78, 0.28);

    --hv-good-bg: #e7efe0;
    --hv-good-fg: #3c5731;
    --hv-warn-bg: #f8edd6;
    --hv-warn-fg: #85570c;
    --hv-warn-line: #ead19a;
    --hv-bad-bg: #f7e4e0;
    --hv-bad-fg: #a1372d;
    --hv-info-bg: #dfe9e5;
    --hv-info-fg: #1f4a40;
    --hv-live-bg: #dff0ea;
    --hv-live-fg: #1c6450;
    --hv-quiet-bg: #ede9e1;
    --hv-quiet-fg: #5d665f;
    --hv-danger: #a8392f;
    --hv-danger-hover: #91302a;
    --hv-danger-ink: #fdf6f4;

    --hv-chart: #0e5a4e;
    --hv-chart-zero: #ddd7cb;
    --hv-chart-rule: #e5e0d6;

    --hv-sidebar: #10201a;
    --hv-sidebar-2: #16302a;
    --hv-sidebar-text: #e8eee9;
    --hv-sidebar-muted: #8fa39a;
    --hv-sidebar-active: #9fd3bf;
    --hv-sidebar-line: rgba(245, 241, 234, 0.08);
    --hv-sidebar-badge-bg: rgba(233, 182, 92, 0.18);
    --hv-sidebar-badge-fg: #f1cd8b;

    --hv-scrim: rgba(16, 32, 26, 0.48);
    --hv-topbar-bg: rgba(243, 240, 233, 0.82);
    --hv-shadow-sm: 0 1px 2px rgba(16, 32, 26, 0.05);
    --hv-shadow: 0 1px 2px rgba(16, 32, 26, 0.04), 0 8px 24px -14px rgba(16, 32, 26, 0.18);
    --hv-shadow-lg: 0 28px 64px -24px rgba(16, 32, 26, 0.38), 0 2px 6px rgba(16, 32, 26, 0.06);
    --hv-glow: radial-gradient(1200px 420px at 85% -10%, rgba(159, 211, 191, 0.32), transparent 60%);
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --hv-ink: #10201a;
    --hv-paper: #ffffff;
    --hv-bone: #f5f1ea;
    --hv-lavender: #9fd3bf;
    --hv-mist: #a3ada7;
    --hv-purple: #0e5a4e;
    /* The logo colour: set it to the project's logo colour. */
    --hv-logo: #0e5a4e;

    --hv-bg: #0c1411;
    --hv-surface: #141f19;
    --hv-surface-2: #1a2821;
    --hv-surface-3: #22312a;
    --hv-field-bg: #101915;
    --hv-line: #263430;
    --hv-line-strong: #3a4b44;
    --hv-text: #f1eee6;
    --hv-text-2: #bcc7c0;
    --hv-muted: #8fa39a;

    --hv-accent: #9fd3bf;
    --hv-accent-hover: #bfe4d4;
    --hv-accent-ink: #10201a;
    --hv-accent-soft: rgba(159, 211, 191, 0.12);
    --hv-accent-text: #b8dccb;
    --hv-focus: rgba(159, 211, 191, 0.3);

    --hv-good-bg: rgba(150, 190, 126, 0.15);
    --hv-good-fg: #b6d3a3;
    --hv-warn-bg: rgba(232, 172, 74, 0.14);
    --hv-warn-fg: #ebc37c;
    --hv-warn-line: rgba(232, 172, 74, 0.34);
    --hv-bad-bg: rgba(232, 112, 96, 0.15);
    --hv-bad-fg: #f0a196;
    --hv-info-bg: rgba(120, 180, 160, 0.14);
    --hv-info-fg: #b8dccb;
    --hv-live-bg: rgba(94, 192, 160, 0.14);
    --hv-live-fg: #8ad2b9;
    --hv-quiet-bg: rgba(255, 255, 255, 0.06);
    --hv-quiet-fg: #a9b3ad;
    --hv-danger: #e07d70;
    --hv-danger-hover: #ea9084;
    --hv-danger-ink: #1c0a08;

    --hv-chart: #9fd3bf;
    --hv-chart-zero: #26352e;
    --hv-chart-rule: #22312a;

    --hv-sidebar: #070e0b;
    --hv-sidebar-2: #132820;
    --hv-sidebar-text: #e6ece8;
    --hv-sidebar-muted: #8a9c93;
    --hv-sidebar-active: #9fd3bf;
    --hv-sidebar-line: rgba(245, 241, 234, 0.07);
    --hv-sidebar-badge-bg: rgba(233, 182, 92, 0.16);
    --hv-sidebar-badge-fg: #f1cd8b;

    --hv-scrim: rgba(0, 0, 0, 0.6);
    --hv-topbar-bg: rgba(12, 20, 17, 0.8);
    --hv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --hv-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px -16px rgba(0, 0, 0, 0.6);
    --hv-shadow-lg: 0 28px 64px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
    --hv-glow: radial-gradient(1200px 420px at 85% -10%, rgba(14, 90, 78, 0.24), transparent 60%);
}

/* Django's own variable names, pointed at the tokens above, in both themes. */
:root[data-theme] {
    --primary: var(--hv-accent);
    --secondary: var(--hv-accent);
    --accent: var(--hv-accent);
    --primary-fg: var(--hv-accent-ink);
    --body-fg: var(--hv-text);
    --body-bg: var(--hv-surface);
    --body-quiet-color: var(--hv-muted);
    --body-medium-color: var(--hv-text-2);
    --body-loud-color: var(--hv-text);
    --header-color: var(--hv-text);
    --header-branding-color: var(--hv-text);
    --header-bg: var(--hv-surface);
    --header-link-color: var(--hv-text);
    --breadcrumbs-fg: var(--hv-muted);
    --breadcrumbs-link-fg: var(--hv-text-2);
    --breadcrumbs-bg: transparent;
    --link-fg: var(--hv-accent-text);
    --link-hover-color: var(--hv-text);
    --link-selected-fg: var(--hv-accent-text);
    --hairline-color: var(--hv-line);
    --border-color: var(--hv-line-strong);
    --error-fg: var(--hv-bad-fg);
    --message-success-bg: var(--hv-good-bg);
    --message-warning-bg: var(--hv-warn-bg);
    --message-error-bg: var(--hv-bad-bg);
    --darkened-bg: var(--hv-surface-2);
    --selected-bg: var(--hv-surface-3);
    --selected-row: var(--hv-accent-soft);
    --button-fg: var(--hv-text);
    --button-bg: var(--hv-surface);
    --button-hover-bg: var(--hv-surface-2);
    --default-button-bg: var(--hv-accent);
    --default-button-hover-bg: var(--hv-accent-hover);
    --close-button-bg: var(--hv-surface-3);
    --close-button-hover-bg: var(--hv-line-strong);
    --delete-button-bg: var(--hv-danger);
    --delete-button-hover-bg: var(--hv-danger-hover);
    --object-tools-fg: var(--hv-accent-ink);
    --object-tools-bg: var(--hv-accent);
    --object-tools-hover-bg: var(--hv-accent-hover);
    --font-family-primary: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

    --hv-field-width: 34rem;
    --hv-field-width-sm: 13rem;
    --hv-control: 2.45rem;
    --hv-radius: 14px;
    --hv-radius-sm: 10px;
    --hv-sidebar-width: 16.5rem;
    --hv-sidebar-rail: 4.75rem;
}

/* Stated outright rather than inherited: the content of a <details> (the
   account menu, collapsible fieldsets) hangs off a slot in Chrome's shadow
   tree whose box-sizing is content-box, so `inherit` broke there and the
   account menu's rows ran 16px past its edge on hover. */
html {
    box-sizing: border-box;
}

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

/* Base. Vietnamese stacks up to three marks on one letter, so lines get more
   air than Latin text would need. */
html,
body {
    height: auto;
    min-height: 100%;
}

body.hv-admin {
    margin: 0;
    background: var(--hv-bg);
    background-image: var(--hv-glow);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--hv-text);
    font-family: var(--font-family-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.hv-admin a {
    color: var(--hv-accent-text);
    text-decoration: none;
}

.hv-admin a:hover {
    color: var(--hv-text);
}

.hv-admin a:focus-visible,
.hv-admin button:focus-visible,
.hv-admin summary:focus-visible,
.hv-admin [tabindex]:focus-visible {
    outline: 2px solid var(--hv-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

.hv-admin ::selection {
    background: var(--hv-accent-soft);
}

:where(.hv-admin) :is(h1, h2, h3, h4) {
    color: var(--hv-text);
    font-weight: 650;
    letter-spacing: -0.01em;
}

.hv-admin code,
.hv-admin kbd {
    font-family: var(--font-family-monospace);
}

.hv-i {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.2em;
}

.skip-to-content-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: var(--hv-radius-sm);
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

.skip-to-content-link:focus {
    top: 1rem;
}

[hidden] {
    display: none !important;
}

:root[data-theme="dark"] .hv-show-light,
:root[data-theme="light"] .hv-show-dark,
:root:not([data-theme]) .hv-show-dark {
    display: none !important;
}

/* Shell: rail on the left, a sticky top bar, the page. Django's #container
   carries a 980px minimum width meant for its own layout; cleared here. */
#container.hv-shell {
    display: flex;
    flex-direction: row;
    min-width: 0;
    min-height: 100vh;
    height: auto;
    width: 100%;
}

.hv-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hv-content {
    flex: 1 0 auto;
    padding: 1.75rem 2rem 4rem;
}

.hv-content:focus {
    outline: none;
}

.hv-admin #content {
    position: relative;
    max-width: 92rem;
    margin: 0 auto;
    padding: 0;
    float: none;
    width: auto;
}

.hv-admin #content > h1 {
    margin: 0 0 1.25rem;
    font-size: 1.6rem;
    line-height: 1.25;
}

.hv-admin #content > h2 {
    margin: -0.75rem 0 1.25rem;
    color: var(--hv-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.hv-footer {
    padding: 0 2rem 1.5rem;
    color: var(--hv-muted);
    font-size: 0.75rem;
}

.hv-footer:empty {
    display: none;
}

br.clear {
    display: none;
}

/* Sidebar. Ink in both themes: it is the brand, not a surface that themes. */
.hv-sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 var(--hv-sidebar-width);
    width: var(--hv-sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--hv-sidebar);
    color: var(--hv-sidebar-text);
    z-index: 40;
    transition: flex-basis 0.22s ease, width 0.22s ease;
    overflow: hidden;
    isolation: isolate;
}

.hv-sidebar::after {
    content: "";
    position: absolute;
    inset: auto -40% -6% -30%;
    height: 22rem;
    background: url("../img/contours.b42680d62194.svg") center bottom / cover no-repeat;
    opacity: 0.09;
    pointer-events: none;
    z-index: -1;
}

.hv-admin a.hv-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    color: var(--hv-sidebar-text);
}

.hv-admin a.hv-brand:hover {
    color: var(--hv-paper);
}

.hv-brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
    /* The logo's own tile: blue under the white mark, no purple and no ring,
       so the logo stays two colours (docs/brand.md). */
    background: var(--hv-logo);
}

.hv-brand-mark img {
    height: 1.3rem;
    width: auto;
}

.hv-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    white-space: nowrap;
}

.hv-brand-text strong {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.hv-brand-text small {
    margin-top: 0.15rem;
    color: var(--hv-sidebar-muted);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.hv-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.75rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 243, 239, 0.14) transparent;
}

.hv-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hv-nav li {
    list-style: none;
    padding: 0;
    margin: 0 0 1px;
}

.hv-nav-section + .hv-nav-section {
    margin-top: 0.35rem;
}

.hv-nav-title {
    margin: 1rem 0.65rem 0.35rem;
    color: var(--hv-sidebar-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hv-admin a.hv-nav-link,
.hv-collapse {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.48rem 0.65rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: rgba(230, 233, 225, 0.74);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hv-nav-link .hv-i,
.hv-collapse .hv-i {
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0.8;
}

.hv-admin a.hv-nav-link:hover,
.hv-collapse:hover {
    background: rgba(244, 243, 239, 0.06);
    color: #fbfbf8;
}

.hv-admin a.hv-nav-link.is-active {
    background: linear-gradient(90deg, rgba(159, 211, 191, 0.17), rgba(159, 211, 191, 0.04));
    color: var(--hv-sidebar-active);
}

.hv-nav-link.is-active .hv-i {
    opacity: 1;
}

.hv-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--hv-sidebar-active);
}

.hv-nav-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-nav-badge {
    flex: none;
    min-width: 1.35rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--hv-sidebar-badge-bg);
    color: var(--hv-sidebar-badge-fg);
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.hv-sidebar-foot {
    padding: 0.6rem 0.75rem 0.85rem;
    border-top: 1px solid var(--hv-sidebar-line);
}

.hv-collapse {
    color: var(--hv-sidebar-muted);
}

/* Collapsed to a rail of icons on wide screens. */
@media (min-width: 1024px) {
    .hv-nav-collapsed .hv-sidebar {
        flex-basis: var(--hv-sidebar-rail);
        width: var(--hv-sidebar-rail);
    }

    .hv-nav-collapsed .hv-brand {
        padding-left: 1.2rem;
    }

    .hv-nav-collapsed .hv-brand-text,
    .hv-nav-collapsed .hv-nav-text {
        display: none;
    }

    .hv-nav-collapsed .hv-nav-title {
        height: 1px;
        margin: 0.8rem 0.6rem;
        background: var(--hv-sidebar-line);
        font-size: 0;
    }

    .hv-nav-collapsed .hv-admin a.hv-nav-link,
    .hv-nav-collapsed a.hv-nav-link,
    .hv-nav-collapsed .hv-collapse {
        justify-content: center;
        padding: 0.6rem 0;
    }

    .hv-nav-collapsed .hv-nav-badge {
        position: absolute;
        top: 0.2rem;
        right: 0.45rem;
        min-width: 0.55rem;
        width: 0.55rem;
        height: 0.55rem;
        padding: 0;
        font-size: 0;
        background: var(--hv-sidebar-badge-fg);
    }

    .hv-nav-collapsed .hv-collapse .hv-i {
        transform: scaleX(-1);
    }
}

/* A drawer on narrow screens. */
.hv-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: var(--hv-scrim);
    backdrop-filter: blur(2px);
}

.hv-nav-toggle {
    display: none !important;
}

@media (max-width: 1023px) {
    .hv-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: var(--hv-shadow-lg);
    }

    .hv-nav-open .hv-sidebar {
        transform: none;
    }

    .hv-nav-toggle {
        display: inline-grid !important;
    }

    .hv-sidebar-foot {
        display: none;
    }

    .hv-content {
        padding: 1.25rem 1rem 3rem;
    }
}

/* Top bar. */
.hv-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.75rem;
    padding: 0.55rem 2rem;
    background: var(--hv-topbar-bg);
    backdrop-filter: saturate(1.3) blur(14px);
    -webkit-backdrop-filter: saturate(1.3) blur(14px);
    border-bottom: 1px solid var(--hv-line);
}

@media (max-width: 1023px) {
    .hv-topbar {
        padding: 0.5rem 1rem;
    }
}

.hv-crumbs {
    flex: 1 1 auto;
    min-width: 0;
}

.hv-admin .hv-crumbs .breadcrumbs {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hv-muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-admin .hv-crumbs .breadcrumbs a {
    color: var(--hv-text-2);
}

.hv-admin .hv-crumbs .breadcrumbs a:hover {
    color: var(--hv-accent-text);
}

.hv-admin .hv-crumbs .breadcrumbs span:only-child {
    color: var(--hv-text);
    font-weight: 600;
}

.hv-topbar-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.hv-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius-sm);
    background: var(--hv-surface);
    color: var(--hv-text-2);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hv-icon-btn:hover {
    background: var(--hv-surface-2);
    border-color: var(--hv-line-strong);
    color: var(--hv-text);
}

.hv-icon-btn .hv-i {
    width: 1.15rem;
    height: 1.15rem;
}

.hv-icon-btn-sm {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
}

.hv-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 2.35rem;
    min-width: 14rem;
    padding: 0 0.5rem 0 0.75rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius-sm);
    background: var(--hv-surface);
    color: var(--hv-muted);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.hv-search-trigger:hover {
    border-color: var(--hv-line-strong);
    color: var(--hv-text-2);
}

.hv-search-trigger span {
    flex: 1;
    text-align: left;
}

.hv-admin kbd {
    padding: 0.08rem 0.4rem;
    border: 1px solid var(--hv-line);
    border-bottom-width: 2px;
    border-radius: 0.35rem;
    background: var(--hv-surface-2);
    color: var(--hv-muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

@media (max-width: 720px) {
    .hv-search-trigger {
        min-width: 0;
        width: 2.35rem;
        padding: 0;
        justify-content: center;
    }

    .hv-search-trigger span,
    .hv-search-trigger kbd,
    .hv-user-name,
    .hv-user-caret {
        display: none;
    }
}

.hv-user {
    position: relative;
}

.hv-user summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.35rem;
    padding: 0 0.55rem 0 0.2rem;
    border: 1px solid var(--hv-line);
    border-radius: 999px;
    background: var(--hv-surface);
    color: var(--hv-text);
    font-size: 0.82rem;
    font-weight: 550;
    cursor: pointer;
    list-style: none;
}

.hv-user summary::-webkit-details-marker {
    display: none;
}

.hv-user summary:hover {
    border-color: var(--hv-line-strong);
}

.hv-user-name {
    max-width: 10rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-user-caret {
    color: var(--hv-muted);
    transition: transform 0.15s ease;
}

.hv-user[open] .hv-user-caret {
    transform: rotate(180deg);
}

.hv-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--hv-ink);
    color: var(--hv-lavender);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

:root[data-theme="dark"] .hv-avatar {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 50;
    width: 16.5rem;
    padding: 0.35rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.85rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    animation: hv-pop 0.14s ease-out;
}

.hv-menu-head {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.3rem;
    padding: 0.6rem 0.7rem 0.7rem;
    border-bottom: 1px solid var(--hv-line);
}

.hv-menu-head span {
    color: var(--hv-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-admin .hv-menu-item,
.hv-admin .hv-menu #logout-form button.hv-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 0.55rem;
    background: none;
    color: var(--hv-text);
    font: inherit;
    font-size: 0.84rem;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.hv-admin .hv-menu-item:hover,
.hv-admin .hv-menu #logout-form button.hv-menu-item:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .hv-menu #logout-form button.hv-menu-danger {
    color: var(--hv-bad-fg);
}

.hv-menu #logout-form {
    display: block;
}

@keyframes hv-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Page finder (Ctrl+K). */
.hv-palette {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12vh 1rem 1rem;
    background: var(--hv-scrim);
    backdrop-filter: blur(3px);
}

.hv-palette-box {
    width: min(36rem, 100%);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hv-line);
    border-radius: 1rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    overflow: hidden;
    animation: hv-pop 0.16s ease-out;
}

.hv-palette-field {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--hv-line);
    color: var(--hv-muted);
}

.hv-palette-field .hv-i {
    width: 1.2rem;
    height: 1.2rem;
}

/* Boxed like every other field in the admin: the field rule further down
   draws the box and focus ring. The attribute selector is what lets this
   rule outrank that one, which is later in the file; without it the sizes
   here never applied and the box sat against the top edge. */
.hv-admin .hv-palette-field input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 2.75rem;
    font-size: 0.95rem;
}

.hv-palette-list {
    margin: 0;
    padding: 0.4rem;
    overflow-y: auto;
    list-style: none;
}

.hv-palette-item {
    list-style: none;
    padding: 0;
}

.hv-admin .hv-palette-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    color: var(--hv-text);
}

.hv-palette-item a .hv-i {
    color: var(--hv-muted);
}

.hv-palette-item a span {
    flex: 1;
}

.hv-palette-item a small {
    color: var(--hv-muted);
    font-size: 0.75rem;
}

.hv-palette-item.is-on a {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-palette-item.is-on a .hv-i {
    color: var(--hv-accent-text);
}

.hv-palette-empty {
    margin: 0;
    padding: 1.5rem;
    color: var(--hv-muted);
    text-align: center;
}

/* Messages. */
.hv-admin ul.messagelist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 92rem;
    margin: 0 auto 1.25rem;
    padding: 0;
}

.hv-admin ul.messagelist li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.75rem 0.85rem 0.75rem 1rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-info-bg);
    background-image: none;
    color: var(--hv-info-fg);
    font-size: 0.86rem;
    line-height: 1.5;
    animation: hv-pop 0.2s ease-out;
}

.hv-admin ul.messagelist li.success {
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-admin ul.messagelist li.warning {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
    border-color: var(--hv-warn-line);
}

.hv-admin ul.messagelist li.error {
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-admin ul.messagelist li > .hv-i {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.12rem;
}

.hv-admin ul.messagelist li > span {
    flex: 1;
}

.hv-message-close {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}

.hv-message-close:hover {
    opacity: 1;
    background: rgba(127, 127, 127, 0.12);
}

/* Buttons: the kit set, and Django's submit inputs dressed the same way. */
.hv-btn,
.hv-admin .button,
.hv-admin input[type="submit"],
.hv-admin input[type="button"],
.hv-admin .submit-row input,
.hv-admin a.button,
.hv-admin .submit-row a.deletelink,
.hv-admin .submit-row a.closelink,
.hv-admin .object-tools a,
.hv-admin a.cancel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--hv-control);
    margin: 0;
    padding: 0 1rem;
    border: 1px solid var(--hv-line-strong);
    border-radius: var(--hv-radius-sm);
    background: var(--hv-surface);
    color: var(--hv-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--hv-shadow-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.hv-btn:hover,
.hv-admin .button:hover,
.hv-admin input[type="submit"]:hover,
.hv-admin input[type="button"]:hover,
.hv-admin .submit-row input:hover,
.hv-admin a.button:hover,
.hv-admin a.cancel-link:hover {
    background: var(--hv-surface-2);
    border-color: var(--hv-line-strong);
    color: var(--hv-text);
}

.hv-btn:active,
.hv-admin input[type="submit"]:active {
    transform: translateY(1px);
}

.hv-btn .hv-i {
    width: 1.05rem;
    height: 1.05rem;
}

.hv-btn-primary,
.hv-admin .button.default,
.hv-admin input[type="submit"].default,
.hv-admin .submit-row input.default,
.hv-admin .object-tools a {
    border-color: transparent;
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14), var(--hv-shadow-sm);
}

.hv-btn-primary:hover,
.hv-admin .button.default:hover,
.hv-admin input[type="submit"].default:hover,
.hv-admin .submit-row input.default:hover,
.hv-admin .object-tools a:hover {
    border-color: transparent;
    background: var(--hv-accent-hover);
    color: var(--hv-accent-ink);
}

.hv-admin a.hv-btn-primary,
.hv-admin a.hv-btn-primary:hover {
    color: var(--hv-accent-ink);
}

.hv-btn-ghost {
    background: var(--hv-surface);
}

.hv-btn-danger,
.hv-admin .delete-confirmation input[type="submit"],
.hv-admin .delete-confirmation form input[type="submit"] {
    border-color: transparent;
    background: var(--hv-danger);
    color: var(--hv-danger-ink);
}

.hv-btn-danger:hover,
.hv-admin .delete-confirmation input[type="submit"]:hover {
    border-color: transparent;
    background: var(--hv-danger-hover);
    color: var(--hv-danger-ink);
}

.hv-btn-danger-ghost,
.hv-admin .submit-row a.deletelink {
    border-color: color-mix(in srgb, var(--hv-danger) 40%, transparent);
    background: transparent;
    color: var(--hv-bad-fg);
    box-shadow: none;
}

.hv-btn-danger-ghost:hover,
.hv-admin .submit-row a.deletelink:hover {
    border-color: var(--hv-danger);
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-btn-link,
.hv-admin a.hv-btn-link {
    border-color: transparent;
    background: none;
    box-shadow: none;
    color: var(--hv-accent-text);
    padding: 0 0.5rem;
}

.hv-btn-link:hover {
    background: var(--hv-accent-soft);
    border-color: transparent;
}

.hv-btn-sm {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.55rem;
}

.hv-btn-block {
    width: 100%;
    height: 2.75rem;
    font-size: 0.92rem;
}

.hv-btn[disabled],
.hv-admin input[type="submit"][disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.hv-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.hv-link .hv-i {
    width: 0.95rem;
    height: 0.95rem;
    transition: transform 0.15s ease;
}

.hv-link:hover .hv-i {
    transform: translateX(2px);
}

/* Object tools: the "Add" button beside a list's title. */
.hv-admin .object-tools {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    float: none;
    font-size: inherit;
}

.hv-admin .object-tools li {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
    height: auto;
}

.hv-admin .object-tools a {
    border-radius: var(--hv-radius-sm);
    background-image: none;
    padding: 0 1rem;
}

.hv-admin .object-tools a.addlink::before {
    content: "+";
    margin-right: 0.15rem;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1;
}

.hv-admin .object-tools a.historylink,
.hv-admin .object-tools a.viewsitelink {
    border-color: var(--hv-line-strong);
    background: var(--hv-surface);
    color: var(--hv-text);
}

.hv-admin .object-tools a.historylink:hover,
.hv-admin .object-tools a.viewsitelink:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.change-list #content > h1,
.change-form #content > h1 {
    padding-right: 16rem;
}

@media (max-width: 760px) {
    .hv-admin .object-tools {
        position: static;
        margin: 0 0 1rem;
    }

    .change-list #content > h1,
    .change-form #content > h1 {
        padding-right: 0;
    }
}

/* Fields. Two widths and one height for every control, so a column of inputs
   has a single right edge and a row of mixed controls lines up. */
.hv-admin input[type="text"],
.hv-admin input[type="password"],
.hv-admin input[type="email"],
.hv-admin input[type="url"],
.hv-admin input[type="number"],
.hv-admin input[type="tel"],
.hv-admin input[type="search"],
.hv-admin input[type="date"],
.hv-admin input[type="time"],
.hv-admin input[type="datetime-local"],
.hv-admin select,
.hv-admin textarea,
.hv-admin .vTextField,
.hv-field {
    box-sizing: border-box;
    height: var(--hv-control);
    padding: 0 0.75rem;
    border: 1px solid var(--hv-line-strong);
    border-radius: 0.6rem;
    background-color: var(--hv-field-bg);
    color: var(--hv-text);
    font: inherit;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 1px rgba(16, 32, 26, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hv-admin textarea,
textarea.hv-field {
    height: auto;
    min-height: 5.5rem;
    padding: 0.6rem 0.75rem;
    line-height: 1.55;
    resize: vertical;
}

.hv-admin select:not([multiple]):not([size]) {
    padding-right: 2.2rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8682' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1rem;
}

.hv-admin select[multiple],
.hv-admin select[size] {
    height: auto;
    padding: 0.3rem;
}

.hv-admin input:focus,
.hv-admin select:focus,
.hv-admin textarea:focus,
.hv-field:focus {
    border-color: var(--hv-accent);
    box-shadow: 0 0 0 3px var(--hv-focus);
    outline: none;
}

.hv-admin input::placeholder,
.hv-admin textarea::placeholder {
    color: var(--hv-muted);
    opacity: 0.65;
    font-style: italic;
}

.hv-admin input:focus::placeholder,
.hv-admin textarea:focus::placeholder {
    opacity: 0.45;
}

.hv-admin input[type="checkbox"],
.hv-admin input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--hv-accent);
    vertical-align: middle;
    cursor: pointer;
}

.hv-field,
.hv-admin #content-main .hv-field {
    width: 100%;
    max-width: var(--hv-field-width);
}

.hv-admin .aligned input[type="text"]:not(.hv-field),
.hv-admin .aligned input[type="password"],
.hv-admin .aligned input[type="email"]:not(.hv-field),
.hv-admin .aligned input[type="url"]:not(.hv-field),
.hv-admin .aligned textarea:not(.hv-field) {
    width: 100%;
    max-width: var(--hv-field-width);
}

.hv-field-sm,
.hv-admin #content-main .hv-field-sm {
    max-width: var(--hv-field-width-sm);
}

:root[data-theme="dark"] .hv-admin input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] .hv-admin input[type="time"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] .hv-admin input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}

.hv-admin .flex-container:has(> .hv-date-echo) {
    flex-wrap: wrap;
}

.hv-admin .flex-container > .hv-date-echo {
    flex-basis: 100%;
    margin-left: 13rem;
}

.hv-date-echo {
    margin: 0.3rem 0 0;
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-date-echo:empty {
    display: none;
}

/* Change form: each fieldset is a card with a heading, rows divided by a
   hairline, labels in a fixed column so the eye runs straight down. */
.hv-admin #content-main form > div > fieldset.module,
.hv-admin #content-main fieldset.module,
.hv-admin .module {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-admin .module h2,
.hv-admin .module caption,
.hv-admin fieldset.module h2.fieldset-heading,
.hv-admin .inline-group h2 {
    margin: 0;
    padding: 1rem 1.35rem 0.85rem;
    border-bottom: 1px solid var(--hv-line);
    background: none;
    color: var(--hv-text);
    font-size: 0.95rem;
    font-weight: 650;
    text-align: left;
    text-transform: none;
    letter-spacing: -0.005em;
}

.hv-admin fieldset.module details > summary {
    display: flex;
    align-items: center;
    list-style: none;
    cursor: pointer;
}

.hv-admin fieldset.module details > summary::-webkit-details-marker {
    display: none;
}

.hv-admin fieldset.module details > summary::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 1.35rem;
    border-right: 1.5px solid var(--hv-muted);
    border-bottom: 1.5px solid var(--hv-muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.hv-admin fieldset.module details[open] > summary::after {
    transform: rotate(45deg);
}

.hv-admin fieldset.module details > summary h2.fieldset-heading {
    flex: 1;
}

.hv-admin fieldset.module details:not([open]) > summary h2.fieldset-heading {
    border-bottom: 0;
}

.hv-admin fieldset.module .description,
.hv-admin .module > p.description {
    margin: 0;
    padding: 0.85rem 1.35rem 0;
    color: var(--hv-text-2);
    font-size: 0.83rem;
}

.hv-admin .form-row {
    padding: 0.85rem 1.35rem;
    border-bottom: 1px solid var(--hv-line);
    overflow: visible;
}

.hv-admin fieldset.module .form-row:last-child {
    border-bottom: 0;
}

.hv-admin .aligned label {
    width: 13rem;
    min-width: 13rem;
    padding: 0.5rem 1rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;
}

.hv-admin .aligned label.required,
.hv-admin label.required {
    color: var(--hv-text);
    font-weight: 600;
}

.hv-admin .aligned .checkbox-row label,
.hv-admin .aligned .vCheckboxLabel {
    width: auto;
    min-width: 0;
    padding: 0 0 0 0.55rem;
    color: var(--hv-text);
}

.hv-admin .checkbox-row {
    align-items: center;
}

.hv-admin .aligned div.help,
.hv-admin .aligned p.help,
.hv-admin form .aligned div.help {
    margin-left: 13rem;
    padding-left: 0;
    color: var(--hv-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    max-width: 44rem;
}

.hv-admin .aligned .checkbox-row + div.help {
    margin-left: 1.6rem;
}

.hv-admin .help,
.hv-admin p.help,
.hv-admin form p.help,
.hv-admin div.help {
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-admin .readonly {
    padding: 0.5rem 0;
    color: var(--hv-text);
    font-size: 0.875rem;
    line-height: 1.5;
}

.hv-admin .flex-container.form-multiline {
    gap: 1.5rem;
}

.hv-admin .form-row .fieldBox {
    margin-right: 0;
}

.hv-admin .errornote,
.hv-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
    font-size: 0.86rem;
    font-weight: 500;
}

.hv-alert .hv-i {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
}

.hv-alert-warn {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
    border-color: var(--hv-warn-line);
}

.hv-alert-good {
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-admin ul.errorlist {
    margin: 0 0 0.4rem;
    padding: 0;
    background: none;
    color: var(--hv-bad-fg);
}

.hv-admin ul.errorlist li {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hv-bad-fg);
    font-size: 0.8rem;
    font-weight: 500;
}

.hv-admin .errors input,
.hv-admin .errors select,
.hv-admin .errors textarea,
.hv-admin td ul.errorlist + input {
    border-color: var(--hv-danger);
}

.hv-admin .form-row.errors {
    background: color-mix(in srgb, var(--hv-bad-bg) 45%, transparent);
}

/* Save bar: sticks to the bottom of the screen so "Lưu" is never a scroll away. */
.hv-admin .submit-row {
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin: 1.5rem 0 0;
    padding: 0.75rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: color-mix(in srgb, var(--hv-surface) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--hv-shadow-lg);
}

.hv-admin .submit-row a.deletelink {
    order: -1;
    margin-right: auto;
}

.hv-admin .submit-row a.closelink {
    background: var(--hv-surface);
}

/* Tabs on a change form: one part of the record at a time. */
.hv-tabs-frame {
    position: sticky;
    top: 4.35rem;
    z-index: 15;
    display: flex;
    align-items: center;
    margin: 0 0 1rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--hv-surface) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--hv-shadow-sm);
}

.hv-tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.hv-tabs::-webkit-scrollbar {
    display: none;
}

/* Arrows at the ends of a tab bar that does not fit: hidden while every tab
   is in view, and each one only while there is something on its side. */
.hv-tabs-arrow {
    display: none;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: 0 0.3rem;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface);
    color: var(--hv-text-2);
    box-shadow: var(--hv-shadow-sm);
    cursor: pointer;
}

.hv-tabs-arrow:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-tabs-arrow .hv-i {
    width: 1rem;
    height: 1rem;
}

.hv-tabs-arrow.is-prev .hv-i {
    transform: rotate(180deg);
}

.hv-tabs-frame.can-prev .hv-tabs-arrow.is-prev,
.hv-tabs-frame.can-next .hv-tabs-arrow.is-next {
    display: grid;
}

.hv-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: none;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 0.6rem;
    background: none;
    color: var(--hv-text-2);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hv-tab:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-tab.is-on {
    background: var(--hv-ink);
    color: var(--hv-bone);
    box-shadow: var(--hv-shadow-sm);
}

:root[data-theme="dark"] .hv-tab.is-on {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-tab-count {
    min-width: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.25rem;
    text-align: center;
}

.hv-tab.is-on .hv-tab-count {
    background: rgba(127, 127, 127, 0.22);
    color: inherit;
}

.hv-tab-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--hv-danger);
}

.hv-has-tabs .hv-tab-panel > h2,
.hv-has-tabs .hv-tab-panel > details > summary {
    display: none;
}

.hv-has-tabs fieldset.hv-tab-panel > details > :not(summary) {
    display: revert;
}

.hv-has-tabs .inline-group.hv-tab-panel > .tabular > fieldset.module > h2,
.hv-has-tabs .inline-group.hv-tab-panel > fieldset.module > h2 {
    display: none;
}

.hv-admin fieldset.hv-tab-panel[hidden],
.hv-admin .inline-group.hv-tab-panel[hidden] {
    display: none !important;
}

/* Inlines. */
.hv-admin .inline-group {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}

.hv-admin .inline-group .module {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
}

.hv-admin .inline-group .tabular {
    overflow-x: auto;
}

.hv-admin .inline-group .tabular table {
    width: 100%;
    border-collapse: collapse;
}

.hv-admin .inline-group .tabular thead th,
.hv-admin .inline-group .tabular th.required {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
}

.hv-admin .inline-group .tabular td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--hv-line);
    vertical-align: middle;
}

.hv-admin .inline-group .tabular tr.has_original td {
    padding-top: 1.6rem;
}

.hv-admin .inline-group .tabular td.original p {
    color: var(--hv-muted);
    font-size: 0.75rem;
}

/* Rows are told apart by their borders; stripes would split each record
   from its own name row, which shifts the odd/even count. */
.hv-admin .inline-group .tabular tbody tr {
    background: none;
}

/* A saved row's name, moved by admin.js into a row of its own above it. */
.hv-admin .inline-group .tabular tr.hv-inline-caption td {
    padding: 0.75rem 0.9rem 0;
    border-bottom: 0;
}

.hv-admin .inline-group .tabular tr.hv-inline-caption p {
    position: static;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    color: var(--hv-text-2);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.hv-admin .inline-group .tabular tr.hv-has-caption td {
    padding-top: 0.4rem;
}

.hv-admin .inline-group .tabular tr.hv-has-caption td.original {
    padding: 0;
}

.hv-admin .inline-related h3 {
    margin: 0;
    padding: 0.7rem 1.35rem;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.82rem;
    font-weight: 600;
}

.hv-admin .inline-related h3 b {
    color: var(--hv-text);
}

.hv-admin .inline-group div.add-row,
.hv-admin .inline-group .tabular tr.add-row td {
    padding: 0.75rem 1.35rem;
    border: 0;
    background: var(--hv-surface-2);
}

.hv-admin .inline-group div.add-row a,
.hv-admin .inline-group .tabular tr.add-row td a {
    font-weight: 600;
}

/* Dropdowns drawn by admin.js over each single <select>. The real select
   sits underneath, invisible, still part of the form. */
.hv-select {
    position: relative;
    display: inline-flex;
    min-width: 12rem;
    max-width: 100%;
    vertical-align: middle;
}

.hv-select.hv-field {
    width: 100%;
    max-width: var(--hv-field-width);
}

.hv-select.hv-field-sm {
    max-width: var(--hv-field-width-sm);
    min-width: 0;
}

.hv-admin .hv-select > select.hv-select-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.hv-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    height: var(--hv-control);
    padding: 0 0.6rem 0 0.8rem;
    border: 1px solid var(--hv-line-strong);
    border-radius: 0.6rem;
    background: var(--hv-field-bg);
    color: var(--hv-text);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(16, 32, 26, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.hv-select-trigger:hover {
    border-color: var(--hv-muted);
}

.hv-select-trigger:focus-visible,
.hv-select.is-open .hv-select-trigger {
    border-color: var(--hv-accent);
    box-shadow: 0 0 0 3px var(--hv-focus);
    outline: none;
}

.hv-select-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.hv-select-prefix {
    flex: none;
    color: var(--hv-muted);
    font-weight: 500;
}

.hv-select-prefix::after {
    content: ":";
}

.hv-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-select-caret {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--hv-muted);
    transition: transform 0.15s ease;
}

.hv-select.is-open .hv-select-caret {
    transform: rotate(180deg);
}

.hv-select-pop {
    position: fixed;
    z-index: 120;
    display: flex;
    flex-direction: column;
    max-width: min(26rem, calc(100vw - 16px));
    max-height: min(20rem, 60vh);
    padding: 0.3rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    animation: hv-pop 0.12s ease-out;
    font-family: var(--font-family-primary);
}

.hv-select-pop.is-up {
    animation-name: hv-pop-up;
}

@keyframes hv-pop-up {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.hv-select-pop ul {
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
}

input.hv-select-search {
    flex: none;
    height: 2.2rem;
    margin: 0 0 0.3rem;
    padding: 0 0.65rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface-2);
    color: var(--hv-text);
    font: inherit;
    font-size: 0.84rem;
    outline: none;
}

input.hv-select-search:focus {
    border-color: var(--hv-accent);
}

.hv-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    color: var(--hv-text);
    font-size: 0.86rem;
    line-height: 1.35;
    list-style: none;
    cursor: pointer;
}

.hv-select-option span {
    flex: 1;
}

.hv-select-option.is-active {
    background: var(--hv-surface-2);
}

.hv-select-option[aria-selected="true"] {
    color: var(--hv-accent-text);
    font-weight: 600;
}

.hv-select-option[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}

.hv-select-check {
    width: 1rem;
    height: 1rem;
    opacity: 0;
}

.hv-select-option[aria-selected="true"] .hv-select-check {
    opacity: 1;
}

.hv-select-group {
    padding: 0.55rem 0.65rem 0.25rem;
    color: var(--hv-muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    list-style: none;
}

/* A filter dropdown is a chip: label and value on one pill. */
.hv-select-filter {
    min-width: 0;
}

.hv-select-filter .hv-select-trigger {
    height: 2.15rem;
    padding: 0 0.55rem 0 0.8rem;
    border-color: var(--hv-line);
    border-radius: 999px;
    background: var(--hv-surface);
    font-size: 0.82rem;
    box-shadow: var(--hv-shadow-sm);
}

.hv-select-filter .hv-select-value {
    max-width: 14rem;
    font-weight: 600;
}

.hv-select-filter.is-set .hv-select-trigger {
    border-color: color-mix(in srgb, var(--hv-accent) 45%, transparent);
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-select-filter.is-set .hv-select-prefix,
.hv-select-filter.is-set .hv-select-caret {
    color: var(--hv-accent-text);
}

/* The changelist action picker sits in a dense row. */
.hv-admin #changelist .actions .hv-select {
    min-width: 15rem;
}

.hv-admin #changelist .actions .hv-select-trigger {
    height: 2.1rem;
    font-size: 0.82rem;
}

/* Searchable foreign-key pickers (autocomplete_fields) are select2 widgets
   Django ships; dressed here to match the kit dropdown. */
.hv-admin .select2-container--admin-autocomplete.select2-container {
    min-width: 16rem;
    max-width: var(--hv-field-width);
    width: 100% !important;
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single {
    display: flex;
    align-items: center;
    height: var(--hv-control);
    border: 1px solid var(--hv-line-strong);
    border-radius: 0.6rem;
    background: var(--hv-field-bg);
    box-shadow: inset 0 1px 1px rgba(16, 32, 26, 0.03);
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {
    padding: 0 2.2rem 0 0.8rem;
    color: var(--hv-text);
    font-size: 0.875rem;
    line-height: var(--hv-control);
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__placeholder {
    color: var(--hv-muted);
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 0.5rem;
    height: 100%;
    width: 1.2rem;
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow b {
    width: 0.45rem;
    height: 0.45rem;
    margin: -0.35rem 0 0 -0.25rem;
    border: 0;
    border-right: 1.5px solid var(--hv-muted);
    border-bottom: 1.5px solid var(--hv-muted);
    transform: rotate(45deg);
}

.hv-admin .select2-container--admin-autocomplete.select2-container--open .select2-selection--single .select2-selection__arrow b {
    margin-top: -0.1rem;
    transform: rotate(-135deg);
}

.hv-admin .select2-container--admin-autocomplete .select2-selection--single .select2-selection__clear {
    margin-right: 0.3rem;
    color: var(--hv-muted);
}

.hv-admin .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
.hv-admin .select2-container--admin-autocomplete.select2-container--open .select2-selection {
    border-color: var(--hv-accent);
    box-shadow: 0 0 0 3px var(--hv-focus);
}

.hv-admin .select2-container--admin-autocomplete .select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    color: var(--hv-text);
}

.hv-admin .select2-container--admin-autocomplete.select2-container--open .select2-dropdown--below {
    margin-top: 6px;
}

.hv-admin .select2-container--admin-autocomplete.select2-container--open .select2-dropdown--above {
    margin-top: -6px;
}

.hv-admin .select2-container--admin-autocomplete .select2-search--dropdown {
    padding: 0.35rem;
}

.hv-admin .select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field {
    height: 2.2rem;
    padding: 0 0.65rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .select2-container--admin-autocomplete .select2-results > .select2-results__options {
    max-height: 18rem;
    padding: 0 0.3rem 0.3rem;
}

.hv-admin .select2-container--admin-autocomplete .select2-results__option {
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    color: var(--hv-text);
    font-size: 0.86rem;
}

.hv-admin .select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .select2-container--admin-autocomplete .select2-results__option[aria-selected="true"] {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
    font-weight: 600;
}

/* The small edit / add / view links beside a foreign key. Django draws them
   as coloured clip-art; here they are quiet square buttons that wake on hover. */
.hv-admin .related-widget-wrapper {
    align-items: center;
    gap: 0.35rem;
}

.hv-admin .related-widget-wrapper-link {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface);
    opacity: 1;
}

.hv-admin .related-widget-wrapper-link img {
    width: 0.95rem;
    height: 0.95rem;
    filter: grayscale(1);
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

:root[data-theme="dark"] .hv-admin .related-widget-wrapper-link img {
    filter: grayscale(1) invert(0.9);
}

.hv-admin .related-widget-wrapper-link:hover {
    border-color: var(--hv-line-strong);
    background: var(--hv-surface-2);
}

.hv-admin .related-widget-wrapper-link:hover img {
    opacity: 0.9;
}

.hv-admin .related-widget-wrapper-link:not([href]) {
    display: none;
}

/* The two-column picker for permissions and similar many-to-many fields. */
.hv-admin .selector-available h2,
.hv-admin .selector-chosen h2,
.hv-admin .selector-available-title,
.hv-admin .selector-chosen-title {
    border: 1px solid var(--hv-line);
    border-radius: 0.6rem 0.6rem 0 0;
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .selector-chosen h2,
.hv-admin .selector-chosen-title {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-admin .selector .selector-filter {
    border-color: var(--hv-line);
    background: var(--hv-surface);
}

.hv-admin .selector select {
    border-radius: 0 0 0.6rem 0.6rem;
    background: var(--hv-field-bg);
}

.hv-admin .selector-chooser {
    background: var(--hv-surface-2);
    border-radius: 0.6rem;
}

/* Change list: one card holding search, actions, table and pages; filters in
   a second card on the right that stays in view while the table scrolls. */
.hv-admin #changelist {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.hv-admin #changelist .changelist-form-container {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}

.hv-admin #toolbar {
    margin: 0;
    padding: 0.9rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--hv-line);
    background: none;
    color: var(--hv-muted);
}

.hv-admin #toolbar form > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hv-admin #toolbar label {
    display: none;
}

.hv-admin #toolbar #searchbar {
    flex: 1 1 16rem;
    min-width: 0;
    max-width: 26rem;
    height: var(--hv-control);
    padding-left: 2.3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8682' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.3'/%3E%3Cpath d='m15.5 15.5 4.7 4.7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1rem;
    font-size: 0.875rem;
}

.hv-admin #toolbar form input[type="submit"] {
    height: var(--hv-control);
    padding: 0 1rem;
    border-radius: var(--hv-radius-sm);
    background: var(--hv-surface);
    color: var(--hv-text);
}

.hv-admin #toolbar .quiet,
.hv-admin #changelist-search .help {
    margin-left: 0.4rem;
    color: var(--hv-muted);
    font-size: 0.8rem;
}

.hv-admin .xfull,
.hv-admin #changelist .toplinks {
    margin: 0;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
}

.hv-admin .change-list .toplinks a,
.hv-admin #changelist .toplinks a {
    margin-right: 0.6rem;
    font-size: 0.82rem;
}

.hv-admin #changelist .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.6rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.82rem;
    line-height: 1.4;
}

.hv-admin #changelist .actions label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.hv-admin #changelist .actions select {
    height: 2.1rem;
    min-width: 14rem;
    font-size: 0.82rem;
}

.hv-admin #changelist .actions .button {
    height: 2.1rem;
    padding: 0 0.85rem;
    font-size: 0.8rem;
}

.hv-admin #changelist .actions span.all,
.hv-admin #changelist .actions span.action-counter,
.hv-admin #changelist .actions span.clear,
.hv-admin #changelist .actions span.question {
    font-size: 0.8rem;
    color: var(--hv-muted);
}

.hv-admin #changelist .results {
    overflow-x: auto;
}

.hv-admin #changelist table,
.hv-admin #result_list {
    width: 100%;
    border: 0;
    border-collapse: collapse;
}

.hv-admin #changelist table thead th {
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface);
    color: var(--hv-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
    vertical-align: middle;
}

.hv-admin #changelist table thead th .text,
.hv-admin #changelist table thead th .text a,
.hv-admin #changelist table thead th .text span {
    display: block;
    padding: 0.7rem 0.9rem;
    color: var(--hv-muted);
}

.hv-admin #changelist table thead th.sorted .text a,
.hv-admin #changelist table thead th .text a:hover {
    color: var(--hv-text);
}

.hv-admin #changelist table thead th.sorted {
    background: var(--hv-surface);
}

.hv-admin #changelist table thead th.action-checkbox-column {
    width: 2.75rem;
    padding: 0 0 0 1rem;
}

.hv-admin #changelist table thead .sortoptions {
    padding: 0.7rem 0.6rem 0 0;
}

.hv-admin #changelist table tbody td,
.hv-admin #changelist table tbody th {
    padding: 0.75rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--hv-line);
    color: var(--hv-text);
    font-size: 0.86rem;
    line-height: 1.45;
    vertical-align: middle;
}

.hv-admin #changelist table tbody td.action-checkbox {
    width: 2.75rem;
    padding: 0 0 0 1rem;
}

.hv-admin #changelist table tbody th {
    white-space: nowrap;
}

.hv-admin #changelist table tbody th a {
    color: var(--hv-text);
    font-weight: 600;
}

.hv-admin #changelist table tbody th a:hover {
    color: var(--hv-accent-text);
}

.hv-admin #changelist table tbody tr:last-child td,
.hv-admin #changelist table tbody tr:last-child th {
    border-bottom: 0;
}

.hv-admin #changelist table tbody tr {
    background: none;
    transition: background-color 0.12s ease;
}

.hv-admin #changelist table tbody tr:hover {
    background: var(--hv-surface-2);
}

.hv-admin #changelist tbody tr.selected,
.hv-admin #changelist tbody tr:has(.action-select:checked) {
    background: var(--hv-accent-soft);
}

.hv-admin #changelist table tbody td img[src*="icon-"] {
    width: 1rem;
    height: 1rem;
}

.hv-admin #changelist .paginator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 0;
    border-top: 1px solid var(--hv-line);
    background: none;
    color: var(--hv-muted);
    font-size: 0.82rem;
    line-height: 1;
}

.hv-admin .paginator a,
.hv-admin .paginator .this-page {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.45rem;
    border-radius: 0.5rem;
    background: none;
    color: var(--hv-text-2);
    font-size: 0.82rem;
    font-weight: 550;
}

.hv-admin .paginator a:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .paginator .this-page {
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

.hv-admin .paginator a.showall {
    margin-left: 0.5rem;
    color: var(--hv-accent-text);
}

.hv-admin .paginator input[type="submit"] {
    margin-left: auto;
}

/* Filters: a bar of dropdowns above the list, so the table keeps the
   whole width of the screen. */
.hv-admin #changelist-filter {
    position: static;
    flex: none;
    order: -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: none;
    box-shadow: none;
}

.hv-admin #changelist-filter h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0.25rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hv-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.hv-admin #changelist-filter h2::before {
    content: "";
    width: 1rem;
    height: 1rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h16l-6.2 7.3v5.5l-3.6 1.8v-7.3z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h16l-6.2 7.3v5.5l-3.6 1.8v-7.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hv-filter {
    display: inline-flex;
}

.hv-admin #changelist-filter #changelist-filter-extra-actions {
    order: 99;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
}

.hv-admin #changelist-filter #changelist-filter-extra-actions h3 {
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.hv-admin #changelist-filter #changelist-filter-extra-actions a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    background-image: none;
    color: var(--hv-accent-text);
}

.hv-admin #changelist-filter #changelist-filter-extra-actions a:hover {
    background: var(--hv-accent-soft);
}

/* Plain tables elsewhere in the admin: history, delete summaries. */
.hv-admin #change-history,
.hv-admin .module table {
    width: 100%;
    border-collapse: collapse;
}

.hv-admin #change-history th,
.hv-admin #change-history td {
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--hv-line);
    font-size: 0.85rem;
}

.hv-admin #change-history thead th {
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.78rem;
}

.hv-admin .delete-confirmation #content-main,
.hv-admin .delete-selected-confirmation #content-main {
    max-width: 52rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-admin .delete-confirmation #content-main ul,
.hv-admin .delete-selected-confirmation #content-main ul {
    padding-left: 1.2rem;
}

.hv-admin .delete-confirmation form,
.hv-admin .delete-selected-confirmation form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.hv-admin .delete-confirmation form > div,
.hv-admin .delete-selected-confirmation form > div {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hv-admin .delete-selected-confirmation input[type="submit"] {
    border-color: transparent;
    background: var(--hv-danger);
    color: var(--hv-danger-ink);
}

/* Shared page pieces: headers, cards, chips, empty states. */
.hv-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hv-eyebrow {
    margin: 0 0 0.3rem;
    color: var(--hv-accent-text);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hv-lead {
    max-width: 68ch;
    margin: 0.35rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.92rem;
}

.hv-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin: 0 0 0.25rem;
}

.hv-page-head h1,
.hv-hero h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

#content > .hv-page-head {
    margin-bottom: 1.5rem;
}

.hv-page-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.hv-card {
    padding: 1.15rem 1.35rem 1.35rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    min-width: 0;
}

.hv-card-flush {
    padding: 0;
    overflow: hidden;
}

.hv-card-flush > .hv-card-head {
    padding: 1.15rem 1.35rem 0.9rem;
    margin: 0;
}

.hv-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
}

.hv-card-head h2 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.35;
}

.hv-card-sub {
    margin: 0.15rem 0 0;
    color: var(--hv-muted);
    font-size: 0.8rem;
}

.hv-card-foot {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--hv-line);
    color: var(--hv-muted);
    font-size: 0.8rem;
}

.hv-card-foot:empty,
.hv-card-foot:has(> :empty:only-child) {
    display: none;
}

.hv-chip,
.hv-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--hv-quiet-bg);
    color: var(--hv-quiet-fg);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.hv-chip::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.hv-tag::before {
    display: none;
}

.hv-chip-small {
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
}

.hv-chip-quiet {
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    box-shadow: inset 0 0 0 1px var(--hv-line);
}

.hv-chip-quiet::before {
    display: none;
}

.hv-chip-pending,
.hv-tone-warn {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-chip-approved,
.hv-tone-good {
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-chip-rejected,
.hv-tone-bad {
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-tone-info {
    background: var(--hv-info-bg);
    color: var(--hv-info-fg);
}

.hv-tone-live {
    background: var(--hv-live-bg);
    color: var(--hv-live-fg);
}

.hv-tone-quiet {
    background: var(--hv-quiet-bg);
    color: var(--hv-quiet-fg);
}

.hv-muted {
    color: var(--hv-muted);
}

.hv-text-warn,
.hv-overdue {
    color: var(--hv-warn-fg);
}

.hv-text-bad {
    color: var(--hv-bad-fg);
}

.hv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.25rem 1rem;
    color: var(--hv-muted);
    text-align: center;
}

.hv-empty .hv-i {
    width: 1.8rem;
    height: 1.8rem;
    opacity: 0.6;
}

.hv-empty p {
    margin: 0;
}

.hv-empty-sm {
    padding: 1rem;
}

.hv-table-wrap {
    overflow-x: auto;
}

.hv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.hv-table th {
    padding: 0.6rem 1.35rem 0.6rem 0;
    border-bottom: 1px solid var(--hv-line);
    background: none;
    color: var(--hv-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
}

.hv-table td {
    padding: 0.7rem 1.35rem 0.7rem 0;
    border-bottom: 1px solid var(--hv-line);
    color: var(--hv-text);
    vertical-align: middle;
}

.hv-table th:first-child,
.hv-table td:first-child {
    padding-left: 1.35rem;
}

.hv-table tbody tr:last-child td {
    border-bottom: 0;
}

.hv-table tbody tr:hover td {
    background: var(--hv-surface-2);
}

.hv-table .hv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-table td.hv-num:first-child {
    text-align: left;
}

.hv-cell-sub {
    display: block;
    color: var(--hv-muted);
    font-size: 0.76rem;
}

.hv-code {
    font-family: var(--font-family-monospace);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Overview. */
.hv-hero {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.75rem 1.85rem;
    border-radius: 1.2rem;
    background:
        url("../img/contours.b42680d62194.svg") right -4rem bottom -9rem / 34rem no-repeat,
        linear-gradient(135deg, #0a1a15 0%, #0e3a31 55%, #167a68 100%);
    color: var(--hv-bone);
    box-shadow: var(--hv-shadow-lg);
    overflow: hidden;
}

.hv-hero::after {
    content: "";
    position: absolute;
    right: -6rem;
    top: -8rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(159, 211, 191, 0.22), transparent 65%);
    pointer-events: none;
}

.hv-hero-text,
.hv-hero-actions {
    position: relative;
    z-index: 1;
}

.hv-admin .hv-hero h1 {
    color: #f7f7f3;
    font-size: 1.85rem;
}

.hv-hero .hv-eyebrow {
    color: var(--hv-lavender);
}

.hv-hero .hv-lead {
    color: rgba(244, 243, 239, 0.78);
}

.hv-hero .hv-lead strong {
    color: #fff;
}

.hv-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hv-admin .hv-hero a.hv-btn-ghost {
    border-color: rgba(244, 243, 239, 0.24);
    background: rgba(14, 31, 32, 0.55);
    backdrop-filter: blur(6px);
    color: var(--hv-bone);
    box-shadow: none;
}

.hv-admin .hv-hero a.hv-btn-ghost:hover {
    background: rgba(244, 243, 239, 0.12);
    color: #fff;
}

.hv-admin .hv-hero .hv-btn-primary,
.hv-admin .hv-hero a.hv-btn-primary:hover {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-admin .hv-hero .hv-btn-primary:hover {
    background: #bfe4d4;
}

.hv-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 0.65rem;
}

.hv-section-head h2 {
    margin: 0;
    font-size: 1rem;
}

.hv-todo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.75rem;
}

.hv-admin a.hv-todo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    color: var(--hv-text);
    box-shadow: var(--hv-shadow);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hv-admin a.hv-todo:hover {
    transform: translateY(-1px);
    border-color: var(--hv-line-strong);
    color: var(--hv-text);
}

.hv-todo-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-todo-icon .hv-i {
    width: 1.2rem;
    height: 1.2rem;
}

.hv-todo.is-urgent {
    border-color: var(--hv-warn-line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--hv-warn-bg) 55%, var(--hv-surface)), var(--hv-surface));
}

.hv-todo.is-urgent .hv-todo-icon {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-todo.is-urgent .hv-todo-note {
    color: var(--hv-warn-fg);
}

.hv-todo.is-clear .hv-todo-icon {
    background: var(--hv-surface-2);
    color: var(--hv-muted);
}

.hv-todo.is-clear .hv-todo-count {
    color: var(--hv-muted);
}

.hv-todo-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.hv-todo-label {
    font-weight: 600;
    font-size: 0.87rem;
    line-height: 1.35;
}

.hv-todo-note {
    color: var(--hv-muted);
    font-size: 0.76rem;
}

.hv-todo-count {
    font-size: 1.55rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1;
}

.hv-todo-go {
    color: var(--hv-muted);
    width: 1rem;
    height: 1rem;
}

.hv-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 0.75rem;
}

@media (min-width: 1180px) {
    .hv-dash .hv-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hv-stat {
    padding: 1rem 1.15rem 1.05rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    min-width: 0;
}

.hv-stat-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--hv-text-2);
    font-size: 0.79rem;
    font-weight: 550;
}

.hv-stat-label .hv-i {
    color: var(--hv-accent-text);
    width: 1rem;
    height: 1rem;
}

.hv-stat-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0.45rem 0 0.2rem;
    color: var(--hv-text);
    font-size: 1.85rem;
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hv-stat-value small {
    margin-left: -0.3rem;
    color: var(--hv-muted);
    font-size: 0.9rem;
    font-weight: 550;
    letter-spacing: 0;
}

.hv-stat-note {
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.hv-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.4;
    vertical-align: middle;
}

.hv-delta .hv-i {
    width: 0.85rem;
    height: 0.85rem;
}

.hv-delta-up {
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-delta-down {
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-delta-flat {
    background: var(--hv-quiet-bg);
    color: var(--hv-quiet-fg);
}

.hv-dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 1.25rem;
    align-items: start;
}

.hv-dash-main,
.hv-dash-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

@media (max-width: 1180px) {
    .hv-dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-health {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-health li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--hv-line);
    font-size: 0.84rem;
    list-style: none;
}

.hv-health li:last-child {
    border-bottom: 0;
}

.hv-health li > .hv-i {
    color: var(--hv-muted);
}

.hv-health li span:not(.hv-health-dot) {
    flex: 1;
}

.hv-health em {
    color: var(--hv-muted);
    font-size: 0.76rem;
    font-style: normal;
}

.hv-health-dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: none;
    border-radius: 50%;
    background: var(--hv-line-strong);
}

.hv-health li[data-state="healthy"] .hv-health-dot {
    background: #4f9a6a;
    box-shadow: 0 0 0 3px color-mix(in srgb, #4f9a6a 22%, transparent);
}

.hv-health li[data-state="unhealthy"] .hv-health-dot {
    background: var(--hv-danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hv-danger) 25%, transparent);
    animation: hv-pulse 1.6s ease-in-out infinite;
}

.hv-health li[data-state="unhealthy"] em {
    color: var(--hv-bad-fg);
    font-weight: 600;
}

.hv-health li[data-state="checking"] .hv-health-dot {
    animation: hv-pulse 1s ease-in-out infinite;
}

@keyframes hv-pulse {
    50% {
        opacity: 0.35;
    }
}

.hv-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.hv-mini-stats-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hv-mini-stats-wide {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.hv-mini-stats > div {
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    background: var(--hv-surface-2);
}

.hv-mini-stats dt {
    color: var(--hv-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.hv-mini-stats dd {
    margin: 0.2rem 0 0;
    color: var(--hv-text);
    font-size: 1.3rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.hv-mini-stats span {
    display: block;
    margin-top: 0.1rem;
    color: var(--hv-muted);
    font-size: 0.74rem;
}

.hv-feed {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-feed li {
    display: flex;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--hv-line);
    list-style: none;
}

.hv-feed li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.hv-feed-mark {
    flex: none;
    align-self: flex-start;
    margin-top: 0.1rem;
    padding: 0.1rem 0.45rem;
    border-radius: 0.4rem;
    font-size: 0.68rem;
    font-weight: 650;
}

.hv-feed-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.4;
}

.hv-feed-body a,
.hv-feed-body > span:first-child {
    color: var(--hv-text);
    font-weight: 550;
    overflow-wrap: anywhere;
}

.hv-feed-meta {
    color: var(--hv-muted);
    font-size: 0.74rem;
}

/* Column chart, drawn in CSS from core/admin_charts.py. */
.hv-chart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 12rem auto;
    column-gap: 0.6rem;
}

.hv-chart-axis {
    position: relative;
    min-width: 2.25rem;
    color: var(--hv-muted);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.hv-chart-axis span {
    position: absolute;
    right: 0;
    transform: translateY(50%);
    white-space: nowrap;
}

.hv-chart-plot {
    position: relative;
    border-bottom: 1px solid var(--hv-line-strong);
}

.hv-chart-rule {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hv-chart-rule);
}

.hv-chart-cols {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.hv-col {
    position: relative;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: default;
    outline: none;
}

.hv-col-bar {
    display: block;
    width: min(100%, 1.5rem);
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: var(--hv-chart);
    transition: opacity 0.12s ease, filter 0.12s ease;
}

.hv-col-bar.is-zero {
    background: var(--hv-chart-zero);
}

.hv-chart-cols:hover .hv-col-bar {
    opacity: 0.45;
}

.hv-chart-cols:hover .hv-col:hover .hv-col-bar,
.hv-col:focus-visible .hv-col-bar {
    opacity: 1;
}

.hv-col::after {
    content: attr(data-tip);
    display: none;
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: 50%;
    z-index: 5;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    background: var(--hv-ink);
    color: var(--hv-bone);
    font-size: 0.74rem;
    font-weight: 550;
    white-space: nowrap;
    box-shadow: var(--hv-shadow-lg);
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
}

:root[data-theme="dark"] .hv-col::after {
    background: var(--hv-bone);
    color: var(--hv-ink);
}

.hv-col:first-child::after {
    left: 0;
    transform: translate(0, 4px);
}

.hv-col:last-child::after {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

.hv-col:hover::after,
.hv-col:focus-visible::after {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
}

.hv-col:first-child:hover::after,
.hv-col:first-child:focus-visible::after,
.hv-col:last-child:hover::after,
.hv-col:last-child:focus-visible::after {
    transform: none;
}

.hv-chart-labels {
    grid-column: 2;
    display: flex;
    gap: 2px;
    padding-top: 0.4rem;
    color: var(--hv-muted);
    font-size: 0.68rem;
}

.hv-chart-labels span {
    flex: 1 1 0;
    min-width: 0;
    overflow: visible;
    text-align: center;
    white-space: nowrap;
}

.hv-chart-labels {
    overflow: hidden;
}

.hv-chart-labels span:first-child {
    text-align: left;
}

.hv-chart-labels span:last-child {
    text-align: right;
}

.hv-chart-plot,
.hv-chart-cols {
    min-width: 0;
}

.hv-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.82rem;
}

/* Reports. */
.hv-segment {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.75rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-sm);
}

.hv-admin .hv-segment a {
    padding: 0.4rem 0.8rem;
    border-radius: 0.55rem;
    color: var(--hv-text-2);
    font-size: 0.8rem;
    font-weight: 550;
    white-space: nowrap;
}

.hv-admin .hv-segment a:hover {
    color: var(--hv-text);
    background: var(--hv-surface-2);
}

.hv-admin .hv-segment a.is-on {
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

@media (max-width: 760px) {
    .hv-segment {
        width: 100%;
        overflow-x: auto;
    }
}

.hv-stats-4 {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.hv-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.hv-report-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hv-report-grid:empty {
    display: none;
}

@media (max-width: 1280px) {
    .hv-report-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .hv-report-grid,
    .hv-report-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-bars li {
    display: grid;
    grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    font-size: 0.83rem;
}

.hv-bars-stacked li {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.3rem;
}

.hv-bars-stacked .hv-bars-track {
    grid-column: 1 / -1;
    grid-row: 2;
}

.hv-bars-compact li {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
}

.hv-bars-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    color: var(--hv-text);
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-bars-stacked .hv-bars-label {
    flex-wrap: wrap;
    gap: 0 0.5rem;
    font-weight: 550;
}

.hv-bars-label small {
    color: var(--hv-muted);
    font-size: 0.73rem;
    font-weight: 400;
}

.hv-bars-track {
    position: relative;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--hv-surface-3);
    overflow: hidden;
}

.hv-bars-track > span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
    background: var(--hv-chart);
}

.hv-bars-track > span.hv-tone-good {
    background: #4f8a55;
}

.hv-bars-track > span.hv-tone-info {
    background: #4e8487;
}

.hv-bars-track > span.hv-tone-bad {
    background: var(--hv-danger);
}

.hv-bars-track > span.hv-tone-warn {
    background: #c48a28;
}

.hv-bars-track > span.hv-tone-quiet {
    background: var(--hv-mist);
}

.hv-swatch {
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 3px;
}

.hv-swatch.hv-tone-good {
    background: #4f8a55;
}

.hv-swatch.hv-tone-info {
    background: #4e8487;
}

.hv-swatch.hv-tone-bad {
    background: var(--hv-danger);
}

.hv-swatch.hv-tone-warn {
    background: #c48a28;
}

.hv-swatch.hv-tone-quiet {
    background: var(--hv-mist);
}

.hv-bars-value {
    color: var(--hv-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.hv-bars-value em {
    margin-left: 0.4rem;
    color: var(--hv-muted);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 500;
}

.hv-i-star {
    width: 0.85rem;
    height: 0.85rem;
    margin-right: 0.2rem;
    color: #c48a28;
    fill: currentColor;
}

.hv-data-table {
    padding: 0;
}

.hv-data-table summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.35rem;
    color: var(--hv-text-2);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.hv-data-table summary::-webkit-details-marker {
    display: none;
}

.hv-data-table[open] summary {
    border-bottom: 1px solid var(--hv-line);
}

.hv-data-table .hv-table-wrap {
    max-height: 26rem;
    overflow-y: auto;
}

/* Staff profile. */
.hv-profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.6rem;
    border: 1px solid var(--hv-line);
    border-radius: 1.2rem;
    background:
        url("../img/contours.b42680d62194.svg") right -6rem bottom -12rem / 32rem no-repeat,
        var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-avatar-lg {
    width: 4.25rem;
    height: 4.25rem;
    font-size: 1.35rem;
    box-shadow: 0 0 0 4px var(--hv-surface), 0 0 0 5px var(--hv-line);
}

.hv-profile-who {
    flex: 1;
    min-width: 14rem;
}

.hv-admin .hv-profile-who h1 {
    margin: 0;
    font-size: 1.6rem;
}

.hv-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    margin: 0.4rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.82rem;
}

.hv-profile-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hv-profile-meta .hv-i {
    color: var(--hv-muted);
}

.hv-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hv-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.hv-profile-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (max-width: 960px) {
    .hv-profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-profile-role {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--hv-line);
}

.hv-profile-role:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.hv-profile-role strong {
    font-size: 0.9rem;
}

.hv-profile-role p {
    margin: 0.15rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.82rem;
}

/* App index: the tables of one app. */
.hv-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
}

.hv-tile {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-tile h2 {
    margin: 0;
    font-size: 0.98rem;
}

.hv-tile h2 a {
    color: var(--hv-text);
}

.hv-tile-actions {
    display: flex;
    gap: 0.4rem;
}

/* KYC and notification desks. */
.hv-kyc {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hv-kyc-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hv-kyc-tabs {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-sm);
    max-width: 100%;
    overflow-x: auto;
}

.hv-admin a.hv-kyc-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.6rem;
    color: var(--hv-text-2);
    font-size: 0.84rem;
    font-weight: 550;
    white-space: nowrap;
}

.hv-admin a.hv-kyc-tab:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin a.hv-kyc-tab-on,
.hv-admin a.hv-kyc-tab-on:hover {
    background: var(--hv-ink);
    color: var(--hv-bone);
}

:root[data-theme="dark"] .hv-admin a.hv-kyc-tab-on {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-kyc-count {
    min-width: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35rem;
    text-align: center;
}

.hv-kyc-tab-on .hv-kyc-count {
    background: rgba(244, 243, 239, 0.16);
    color: inherit;
}

.hv-kyc-search {
    display: flex;
    flex: 1 1 22rem;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hv-kyc-search .hv-field {
    flex: 1 1 16rem;
    min-width: 0;
    max-width: 24rem;
}

.hv-kyc-summary {
    margin: 0;
    color: var(--hv-text-2);
    font-size: 0.86rem;
}

.hv-kyc-card {
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}

.hv-kyc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hv-line);
}




.hv-kyc-name {
    margin: 0;
    font-size: 1.05rem;
}

.hv-kyc-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.9rem;
    margin: 0.15rem 0 0;
    color: var(--hv-muted);
    font-size: 0.8rem;
}

.hv-kyc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hv-kyc-chips .hv-overdue {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
    box-shadow: none;
}

.hv-kyc-decided {
    margin: 0;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.84rem;
}

.hv-kyc-warnings {
    margin: 0;
    padding: 0.75rem 1.25rem 0.75rem 2.6rem;
    border-bottom: 1px solid var(--hv-warn-line);
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
    font-size: 0.84rem;
    font-weight: 500;
}

.hv-kyc-warnings li {
    margin: 0.1rem 0;
}

.hv-kyc-body {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

@media (max-width: 960px) {
    .hv-kyc-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-kyc-panel {
    padding: 1rem 1.25rem 1.15rem;
    min-width: 0;
}

.hv-kyc-panel + .hv-kyc-panel {
    border-left: 1px solid var(--hv-line);
}

@media (max-width: 960px) {
    .hv-kyc-panel + .hv-kyc-panel {
        border-left: 0;
        border-top: 1px solid var(--hv-line);
    }
}

.hv-admin .hv-kyc-panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    color: var(--hv-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.hv-kyc-panel-title .hv-muted {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.hv-kyc-facts {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.5rem 1rem;
    margin: 0;
    font-size: 0.86rem;
}

.hv-kyc-facts dt {
    color: var(--hv-muted);
    font-weight: 500;
}

.hv-kyc-facts dd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
    color: var(--hv-text);
}

.hv-kyc-fee {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.hv-tag {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-kyc-docs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.hv-doc {
    display: flex;
    gap: 0.75rem;
    margin: 0;
    padding: 0.6rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface-2);
    min-width: 0;
}

.hv-doc-expired {
    border-color: var(--hv-warn-line);
    background: var(--hv-warn-bg);
}

.hv-doc-thumb {
    display: grid;
    place-items: center;
    flex: none;
    width: 5.5rem;
    height: 7rem;
    border-radius: 0.55rem;
    background: var(--hv-surface-3);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--hv-line);
}

.hv-doc-thumb img {
    color: var(--hv-muted);
    font-size: 0.68rem;
    line-height: 1.3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

a.hv-doc-thumb:hover img {
    transform: scale(1.04);
}

.hv-doc-file {
    color: var(--hv-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.hv-doc-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--hv-text-2);
}

.hv-doc-meta strong {
    color: var(--hv-text);
    font-size: 0.86rem;
}

.hv-doc-meta .hv-chip {
    align-self: flex-start;
    margin: 0.15rem 0;
}

.hv-doc-key,
.hv-preview-key {
    display: block;
    margin-top: 0.25rem;
    padding: 0.3rem 0.45rem;
    border-radius: 0.4rem;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.hv-kyc-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem 1.15rem;
    border-top: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
}

.hv-kyc-reason-label {
    display: block;
    color: var(--hv-text);
    font-size: 0.82rem;
    font-weight: 600;
}

.hv-kyc-reason-label .hv-muted {
    font-weight: 400;
}

.hv-kyc-actions .hv-field,
.hv-kyc-supplement-actions .hv-field {
    max-width: none;
}

.hv-kyc-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hv-kyc-open {
    margin-left: auto;
}

.hv-kyc-hint {
    font-size: 0.8rem;
}

.hv-kyc-supplements {
    border-color: var(--hv-warn-line);
}

.hv-kyc-supplements > .hv-muted {
    margin: 0;
    padding: 0.6rem 1.25rem 0;
    font-size: 0.8rem;
}

.hv-kyc-supplement-list {
    display: flex;
    flex-direction: column;
}

.hv-kyc-supplement {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--hv-line);
}

.hv-kyc-supplement:first-child {
    border-top: 0;
}

@media (max-width: 960px) {
    .hv-kyc-supplement {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-kyc-supplement-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hv-kyc-empty {
    padding: 3rem 1.5rem;
    border: 1px dashed var(--hv-line-strong);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    color: var(--hv-text-2);
    text-align: center;
}

.hv-kyc-empty p {
    margin: 0.2rem 0;
}

.hv-kyc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.84rem;
}

.hv-actions-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hv-ann-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 760px) {
    .hv-ann-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-ann-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-ann-stat-label {
    color: var(--hv-text-2);
    font-size: 0.79rem;
    font-weight: 550;
}

.hv-ann-stat-value {
    font-size: 1.7rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hv-ann-stat-note {
    font-size: 0.76rem;
}

.hv-ann-activity {
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
}

.hv-ann-activity summary {
    padding: 0.85rem 1.15rem;
    color: var(--hv-text-2);
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
}

.hv-ann-bars {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
    padding: 0.25rem 1.15rem 1.1rem;
    list-style: none;
}

.hv-ann-bars li {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    list-style: none;
}

.hv-ann-bar {
    height: 0.45rem;
    border-radius: 999px;
    background: var(--hv-surface-3);
    overflow: hidden;
}

.hv-ann-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--hv-chart);
}

.hv-ann-bar-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-ann-table {
    margin-left: auto;
}

.hv-ann-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1180px) {
    .hv-ann-compose {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-ann-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.hv-ann-step {
    padding: 1.15rem 1.35rem 1.35rem;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
}

.hv-ann-step-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.9rem;
    font-size: 1rem;
}

.hv-ann-step-title span {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: var(--hv-ink);
    color: var(--hv-lavender);
    font-size: 0.78rem;
    font-weight: 700;
}

:root[data-theme="dark"] .hv-ann-step-title span {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-ann-group {
    margin: 0.75rem 0 0.4rem;
    color: var(--hv-muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hv-ann-group:first-of-type {
    margin-top: 0;
}

.hv-ann-audiences {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.5rem;
}

.hv-ann-audience {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hv-ann-audience:hover {
    border-color: var(--hv-line-strong);
}

.hv-ann-audience:has(input:checked) {
    border-color: var(--hv-accent);
    background: var(--hv-accent-soft);
    box-shadow: 0 0 0 1px var(--hv-accent);
}

.hv-ann-audience input {
    margin-top: 0.2rem;
}

.hv-ann-audience-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    font-size: 0.78rem;
}

.hv-ann-audience-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
}

.hv-ann-email {
    margin-top: 0.9rem;
}

.hv-ann-langs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 900px) {
    .hv-ann-langs {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-ann-lang {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0.9rem 1rem 1rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface-2);
    min-width: 0;
}

.hv-ann-lang legend {
    padding: 0 0.35rem;
    color: var(--hv-text);
    font-size: 0.86rem;
    font-weight: 650;
}

.hv-ann-lang legend .hv-muted {
    font-weight: 400;
    font-size: 0.76rem;
}

.hv-ann-lang .hv-field {
    max-width: none;
}

.hv-ann-lang label {
    margin-top: 0.35rem;
}

.hv-ann-note {
    margin: 0.2rem 0 0;
    font-size: 0.76rem;
}

.hv-ann-error {
    margin: 0.2rem 0 0;
    color: var(--hv-bad-fg);
    font-size: 0.8rem;
    font-weight: 500;
}

.hv-ann-switch {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.hv-ann-switch input {
    margin-top: 0.2rem;
}

.hv-ann-switch > span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.84rem;
}

.hv-ann-actions {
    position: sticky;
    bottom: 0.75rem;
    z-index: 10;
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: color-mix(in srgb, var(--hv-surface) 90%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: var(--hv-shadow-lg);
}

.hv-ann-preview {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hv-ann-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hv-ann-lang-toggle {
    display: inline-flex;
    padding: 0.15rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface);
}

.hv-ann-lang-toggle button {
    padding: 0.2rem 0.6rem;
    border: 0;
    border-radius: 0.4rem;
    background: none;
    color: var(--hv-text-2);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
}

.hv-ann-lang-toggle button.hv-on {
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

.hv-ann-phone {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.4rem 1rem 1.6rem;
    border: 8px solid #10201a;
    border-radius: 2.2rem;
    background:
        radial-gradient(120% 70% at 30% 0%, rgba(159, 211, 191, 0.55), transparent 60%),
        linear-gradient(170deg, #167a68, #0e2a23 70%);
    box-shadow: var(--hv-shadow-lg);
    color: #fff;
}

.hv-ann-phone-caption {
    margin: 0.3rem 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
}

.hv-ann-push {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
    border-radius: 1rem;
    background: rgba(250, 249, 246, 0.82);
    color: #10201a;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
}

.hv-ann-push-head {
    display: flex;
    justify-content: space-between;
    color: #5a5866;
    font-size: 0.68rem;
}

.hv-ann-push-app {
    font-weight: 700;
    letter-spacing: 0.06em;
}

.hv-ann-push-off {
    margin: 0;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.76rem;
    text-align: center;
}

.hv-ann-row {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: #ffffff;
    color: #10201a;
    font-size: 0.8rem;
}

.hv-ann-row-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.7rem;
    background: #d8e6df;
    color: #0a4439;
}

.hv-ann-row-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.hv-ann-row-text .hv-muted {
    color: #6b756f;
    font-size: 0.7rem;
}

.hv-ann-phone .hv-ann-note {
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.hv-ann-copy {
    padding: 1rem 1.25rem;
    color: var(--hv-text);
    font-size: 0.88rem;
}

.hv-ann-copy p {
    margin: 0;
}

.hv-ann-copy-en {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--hv-line-strong);
    color: var(--hv-text-2);
}

/* KYC desk: the queue on the left, one application on the right. */
.hv-kyc-search-box {
    position: relative;
    display: flex;
    flex: 1 1 16rem;
    min-width: 0;
    max-width: 24rem;
}

.hv-kyc-search-box > .hv-i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hv-muted);
    pointer-events: none;
}

.hv-admin .hv-kyc-search-box input.hv-field {
    max-width: none;
    padding-left: 2.25rem;
}

.hv-kyc-layout {
    display: grid;
    grid-template-columns: 19.5rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1080px) {
    .hv-kyc-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hv-kyc-queue {
    position: sticky;
    top: 4.75rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 6rem);
    border: 1px solid var(--hv-line);
    border-radius: var(--hv-radius);
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}

@media (max-width: 1080px) {
    .hv-kyc-queue {
        position: static;
        max-height: 22rem;
    }
}

.hv-kyc-queue-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid var(--hv-line);
    color: var(--hv-text);
    font-size: 0.86rem;
    font-weight: 650;
}

.hv-kyc-queue-title span {
    min-width: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 0.72rem;
    line-height: 1.4rem;
    text-align: center;
}

.hv-kyc-queue ul {
    flex: 1;
    margin: 0;
    padding: 0.35rem;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
}

.hv-kyc-queue li {
    list-style: none;
    padding: 0;
}

.hv-admin a.hv-kyc-qitem {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.65rem;
    border-radius: 0.7rem;
    color: var(--hv-text);
    transition: background-color 0.12s ease;
}

.hv-admin a.hv-kyc-qitem:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-admin .is-single a.hv-kyc-qitem.is-on {
    background: var(--hv-accent-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hv-accent) 30%, transparent);
}

.hv-kyc-qavatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 0.9rem;
    font-weight: 650;
    object-fit: cover;
}

.hv-kyc-qavatar-icon {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-kyc-qbody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.hv-kyc-qbody strong {
    overflow: hidden;
    font-size: 0.86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-kyc-qbody small {
    overflow: hidden;
    color: var(--hv-muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-kyc-qmeta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex: none;
}

.hv-kyc-qmeta em {
    color: var(--hv-muted);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 550;
    white-space: nowrap;
}

.hv-kyc-qmeta em.is-late {
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-kyc-qwarn {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: var(--hv-warn-fg);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 650;
}

.hv-kyc-qwarn .hv-i {
    width: 0.8rem;
    height: 0.8rem;
}

.hv-kyc-queue .hv-kyc-pagination {
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--hv-line);
    font-size: 0.78rem;
}

.hv-kyc-stage {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.hv-kyc-case {
    border: 1px solid var(--hv-line);
    border-radius: 1.1rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}

.hv-kyc-case[hidden] {
    display: none;
}

.hv-kyc-hero {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.15rem;
    padding: 1.35rem 1.5rem;
    background:
        url("../img/contours.b42680d62194.svg") right -5rem top -9rem / 26rem no-repeat,
        linear-gradient(180deg, var(--hv-surface-2), var(--hv-surface));
    border-bottom: 1px solid var(--hv-line);
}

.hv-kyc-portrait {
    display: grid;
    place-items: center;
    flex: none;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.1rem;
    background: var(--hv-surface-3);
    color: var(--hv-text-2);
    font-size: 1.5rem;
    font-weight: 650;
    overflow: hidden;
    box-shadow: 0 0 0 3px var(--hv-surface), 0 0 0 4px var(--hv-line), var(--hv-shadow);
}

.hv-kyc-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv-kyc-portrait-icon {
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-kyc-portrait-icon .hv-i {
    width: 1.8rem;
    height: 1.8rem;
}

.hv-kyc-hero-text {
    flex: 1;
    min-width: 14rem;
}

.hv-admin .hv-kyc-case .hv-kyc-name {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.015em;
}

.hv-kyc-case .hv-kyc-contact {
    gap: 0.25rem 1rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--hv-text-2);
}

.hv-kyc-case .hv-kyc-contact span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hv-kyc-case .hv-kyc-contact .hv-i {
    color: var(--hv-muted);
}

.hv-kyc-case .hv-kyc-chips .hv-chip {
    padding: 0.3rem 0.7rem;
    font-size: 0.76rem;
}

.hv-kyc-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-bottom: 1px solid var(--hv-line);
}

@media (max-width: 760px) {
    .hv-kyc-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hv-kyc-strip > div {
    padding: 0.85rem 1.5rem;
    border-left: 1px solid var(--hv-line);
}

.hv-kyc-strip > div:first-child {
    border-left: 0;
}

.hv-kyc-strip dt {
    color: var(--hv-muted);
    font-size: 0.74rem;
    font-weight: 500;
}

.hv-kyc-strip dd {
    margin: 0.15rem 0 0;
    color: var(--hv-text);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.hv-kyc-case .hv-kyc-decided {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
}

.hv-kyc-case .hv-kyc-decided .hv-i {
    margin-top: 0.15rem;
    color: var(--hv-muted);
}

.hv-kyc-check {
    margin: 1.15rem 1.5rem 0;
    padding: 0.8rem 1rem;
    border: 1px solid color-mix(in srgb, var(--hv-accent) 25%, transparent);
    border-radius: 0.85rem;
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-kyc-check.has-warnings {
    border-color: var(--hv-warn-line);
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
}

.hv-kyc-check-title {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.hv-kyc-check-title .hv-i {
    margin-top: 0.12rem;
}

.hv-kyc-case .hv-kyc-warnings {
    margin: 0.4rem 0 0;
    padding: 0 0 0 1.65rem;
    border: 0;
    background: none;
    color: inherit;
    font-size: 0.83rem;
    font-weight: 450;
}

.hv-kyc-case .hv-kyc-body {
    gap: 0;
}

.hv-kyc-case .hv-kyc-panel {
    padding: 1.15rem 1.5rem 1.35rem;
}

.hv-kyc-case .hv-kyc-facts {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.6rem 1rem;
}

.hv-kyc-bio {
    position: relative;
    margin: 1rem 0 0;
    padding: 0.8rem 1rem 0.8rem 1.15rem;
    border-left: 3px solid var(--hv-lavender);
    border-radius: 0 0.6rem 0.6rem 0;
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.84rem;
    line-height: 1.6;
}

.hv-kyc-case .hv-kyc-docs {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}

.hv-kyc-case .hv-doc {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem;
    border-radius: 0.9rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-sm);
}

.hv-kyc-case .hv-doc-thumb {
    width: 100%;
    height: 9.5rem;
    border-radius: 0.6rem;
}

.hv-kyc-case .hv-doc-meta {
    padding: 0 0.35rem 0.3rem;
}

.hv-kyc-case .hv-kyc-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 1rem 1.5rem;
    background: color-mix(in srgb, var(--hv-surface-2) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hv-kyc-reason {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 22rem;
    min-width: 0;
}

.hv-kyc-reason textarea.hv-field {
    min-height: 2.6rem;
    max-width: none;
}

.hv-kyc-case .hv-kyc-buttons {
    flex: 0 0 auto;
    margin-left: auto;
}

.hv-kyc-case .hv-kyc-open {
    margin-left: 0;
}

.hv-kyc-note {
    margin: 0;
    padding: 0.75rem 1.5rem;
    color: var(--hv-muted);
    font-size: 0.82rem;
}

.hv-kyc-case.hv-kyc-supplements .hv-kyc-supplement {
    border-top: 1px solid var(--hv-line);
}

.hv-kyc-case.hv-kyc-supplements .hv-doc {
    flex-direction: row;
}

.hv-kyc-case.hv-kyc-supplements .hv-doc-thumb {
    width: 6.5rem;
    height: 8rem;
}

.hv-kyc-case.hv-kyc-supplements .hv-kyc-buttons {
    margin-left: 0;
    justify-content: flex-end;
}

.hv-kyc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.hv-kyc-empty-mark {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-kyc-empty-mark .hv-i {
    width: 1.5rem;
    height: 1.5rem;
}

/* Media previews on change pages, and the password panel. */
.hv-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.hv-preview-frame {
    display: block;
    max-width: 20rem;
    border-radius: 0.7rem;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--hv-line), var(--hv-shadow);
}

.hv-preview-image {
    display: block;
    max-width: 100%;
    max-height: 18rem;
    object-fit: contain;
    background: var(--hv-surface-2);
}

.hv-preview-link {
    font-size: 0.8rem;
    font-weight: 600;
}

.hv-preview-note,
.hv-preview-empty {
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-catalogue-art {
    border-radius: 0.5rem;
    object-fit: cover;
    background: var(--hv-surface-2);
    box-shadow: 0 0 0 1px var(--hv-line);
}

.hv-password-summary {
    max-width: 34rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.8rem;
    background: var(--hv-surface-2);
}

.hv-password-summary__state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--hv-good-fg);
    font-weight: 600;
}

.hv-password-summary__state--empty {
    color: var(--hv-warn-fg);
}

.hv-password-summary__note {
    margin: 0.3rem 0 0.75rem;
    color: var(--hv-text-2);
    font-size: 0.8rem;
}

/* Confirmation dialog (notification desk) and document lightbox. */
.hv-dialog-open {
    overflow: hidden;
}

.hv-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: var(--hv-scrim);
    backdrop-filter: blur(3px);
}

.hv-dialog {
    width: min(28rem, 100%);
    padding: 1.5rem;
    border: 1px solid var(--hv-line);
    border-radius: 1.1rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    animation: hv-pop 0.16s ease-out;
}

.hv-dialog-mark {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.9rem;
    border-radius: 0.85rem;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-dialog-danger .hv-dialog-mark {
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-dialog-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.hv-dialog-body {
    margin: 0;
    color: var(--hv-text-2);
    font-size: 0.88rem;
}

.hv-dialog-facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem 1rem;
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: var(--hv-surface-2);
    font-size: 0.84rem;
}

.hv-dialog-facts dt {
    color: var(--hv-muted);
}

.hv-dialog-facts dd {
    margin: 0;
    color: var(--hv-text);
    font-weight: 600;
}

.hv-dialog-warning {
    margin: 0.85rem 0 0;
    color: var(--hv-warn-fg);
    font-size: 0.82rem;
    font-weight: 550;
}

.hv-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.35rem;
}

.hv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: rgba(5, 12, 13, 0.88);
    backdrop-filter: blur(4px);
}

.hv-lightbox img {
    max-width: 92vw;
    max-height: 84vh;
    border-radius: 0.6rem;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    background: #fff;
}

.hv-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.hv-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.hv-lightbox-caption {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.84rem;
}

/* Sign-in and signed-out pages. One screen high and never taller: an alert
   takes the lead line's fixed slot in the card and the Caps Lock notice sits
   inside its field, so nothing that appears while signing in can move the
   form or push the page into a scroll. */
body.hv-login {
    background: var(--hv-bg);
    background-image: none;
}

.hv-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 37.5rem;
}

@media (max-width: 960px) {
    .hv-login-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-login-art {
        display: none !important;
    }
}

.hv-login-art {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem 2.25rem;
    background: #10201a;
    color: var(--hv-bone);
    overflow: hidden;
    isolation: isolate;
}

/* The photo sits under two washes: ink from the left, where the copy is,
   fading out before the faces on the right, and a deep accent tone from the
   bottom so the feature chips read over the counter. */
.hv-login-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% center;
}

.hv-login-art::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(16, 32, 26, 0.9) 0%, rgba(16, 32, 26, 0.62) 42%, rgba(16, 32, 26, 0.08) 72%),
        linear-gradient(180deg, rgba(16, 32, 26, 0.45) 0%, transparent 32%, transparent 58%, rgba(10, 26, 21, 0.9) 100%);
    content: "";
}

.hv-login-brand img {
    height: 3.4rem;
    width: auto;
}

.hv-login-copy {
    max-width: 22rem;
    margin-top: clamp(2rem, 9vh, 5.5rem);
}

.hv-login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    color: var(--hv-lavender);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hv-login-eyebrow::before {
    width: 1.5rem;
    height: 1px;
    background: currentColor;
    content: "";
}

.hv-admin .hv-login-copy h2 {
    margin: 0;
    color: #fbfaf6;
    font-size: clamp(1.5rem, 2vw, 1.95rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hv-login-tagline {
    margin: 1.1rem 0 0;
    color: rgba(244, 243, 239, 0.72);
    font-size: 0.95rem;
    font-style: italic;
}

.hv-login-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.hv-login-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-login-points li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(244, 243, 239, 0.18);
    border-radius: 999px;
    background: rgba(16, 32, 26, 0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f5f1ea;
    font-size: 0.8rem;
    font-weight: 550;
    list-style: none;
}

.hv-login-points .hv-i {
    width: 1rem;
    height: 1rem;
    color: var(--hv-lavender);
}

.hv-login-credit {
    margin: 0;
    color: rgba(244, 243, 239, 0.5);
    font-size: 0.68rem;
    white-space: nowrap;
}

.hv-login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.5rem 2rem;
    background:
        radial-gradient(60% 45% at 100% 0%, color-mix(in srgb, var(--hv-lavender) 30%, transparent), transparent 70%),
        radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--hv-accent) 10%, transparent), transparent 70%),
        var(--hv-bg);
    overflow: hidden;
}

.hv-login-single .hv-login-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

/* The pages after the password (code, setup, reset, signed out) have no
   photo: the panel is the whole page, and the wash moves to the body so it
   covers the full width rather than drawing a box around the column. */
body.hv-login-single {
    background:
        radial-gradient(50% 45% at 100% 0%, color-mix(in srgb, var(--hv-lavender) 30%, transparent), transparent 70%),
        radial-gradient(45% 40% at 0% 100%, color-mix(in srgb, var(--hv-accent) 10%, transparent), transparent 70%),
        var(--hv-bg);
    background-attachment: fixed;
}

.hv-login-single .hv-login-panel {
    width: 100%;
    max-width: 34rem;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background: transparent;
    overflow: visible;
}

.hv-login-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.hv-login-mobile-logo {
    display: none;
    height: 2.6rem;
    width: auto;
    margin-right: auto;
}

@media (max-width: 960px) {
    .hv-login-mobile-logo {
        display: block;
    }
}

.hv-login-single .hv-login-mobile-logo {
    display: block;
}

:root[data-theme="dark"] .hv-login-mobile-logo.hv-show-light,
:root[data-theme="light"] .hv-login-mobile-logo.hv-show-dark {
    display: none;
}

.hv-login-card {
    width: min(26rem, 100%);
    margin: auto;
    padding: 2.25rem 2.25rem 2rem;
    border: 1px solid var(--hv-line);
    border-radius: 1.5rem;
    background: color-mix(in srgb, var(--hv-surface) 92%, transparent);
    box-shadow: var(--hv-shadow-lg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 480px) {
    .hv-login-panel {
        padding: 1.25rem 1rem;
    }

    .hv-login-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 1.25rem;
    }

    /* The reason wraps to three lines on a phone. Scoped to the card so it
       outranks the base rule further down. */
    .hv-login-card .hv-login-status {
        min-height: 4.75rem;
    }
}

/* A short laptop screen: a tighter card. */
@media (max-height: 760px) {
    .hv-login-card {
        padding: 1.6rem 2rem 1.4rem;
    }

    .hv-login-card .hv-login-status {
        margin-bottom: 1rem;
    }

    .hv-login-form {
        gap: 1.05rem;
    }

    .hv-login-help {
        margin-top: 0.9rem;
    }
}

.hv-login-kicker {
    margin: 0 0 0.35rem;
    color: var(--hv-accent-text);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hv-admin .hv-login-card h1 {
    margin: 0;
    font-size: 1.85rem;
    letter-spacing: -0.025em;
}

.hv-login-lead {
    margin: 0.4rem 0 1.6rem;
    color: var(--hv-text-2);
    font-size: 0.88rem;
}

/* The lead line or, after a failed attempt, the reason, in the same room:
   tall enough for a two-line alert, so the form starts at the same height
   either way. */
.hv-login-status {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    min-height: 3.9rem;
    margin: 0.35rem 0 1.25rem;
}

.hv-login-status .hv-login-lead {
    margin: 0;
}

.hv-admin .hv-login-status .hv-alert {
    align-items: center;
    margin: 0;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-left: 3px solid currentColor;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
    animation: hv-pop 0.2s ease-out;
}

.hv-login-status .hv-alert .hv-i {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.hv-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hv-login-field {
    position: relative;
}

.hv-login-field label {
    display: block;
    margin: 0 0 0.4rem;
    color: var(--hv-text);
    font-size: 0.84rem;
    font-weight: 600;
}

.hv-input-icon {
    position: relative;
    display: block;
}

.hv-input-icon > .hv-i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hv-muted);
    pointer-events: none;
}

.hv-admin .hv-input-icon input {
    width: 100%;
    height: 2.95rem;
    padding: 0 2.9rem 0 2.6rem;
    border-radius: 0.8rem;
    font-size: 0.95rem;
}

.hv-admin .hv-input-icon input[aria-invalid="true"] {
    border-color: var(--hv-bad-fg);
}

.hv-reveal {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 0;
    border-radius: 0.55rem;
    background: none;
    color: var(--hv-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.hv-reveal:hover,
.hv-reveal[aria-pressed="true"] {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

/* Under its field without taking a line of the form: the gap between fields
   is its room, so an error does not move the button. */
.hv-field-error {
    margin: 0.35rem 0 0;
    color: var(--hv-bad-fg);
    font-size: 0.8rem;
}

.hv-login-field .hv-field-error {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0.2rem 0 0;
    font-size: 0.74rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Caps Lock: a pill inside the password field, not a line under it. */
.hv-caps {
    position: absolute;
    right: 2.85rem;
    top: 50%;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--hv-warn-bg);
    color: var(--hv-warn-fg);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transform: translateY(-50%);
    animation: hv-pop 0.16s ease-out;
}

.hv-caps .hv-i {
    width: 0.85rem;
    height: 0.85rem;
}

.hv-admin .hv-input-icon:has(.hv-caps:not([hidden])) input {
    padding-right: 11.5rem;
}

.hv-login-form .hv-btn-block {
    height: 2.95rem;
    margin-top: 0.35rem;
    border-radius: 0.8rem;
}

.hv-login-help {
    margin: 1.3rem 0 0;
    color: var(--hv-muted);
    font-size: 0.8rem;
    text-align: center;
}

.hv-login-help a,
.hv-otp-out a {
    color: var(--hv-accent-text);
    font-weight: 600;
}

.hv-login-foot {
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.75rem;
    text-align: center;
}

.hv-login-done {
    text-align: center;
}

.hv-login-done-mark {
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-login-done-mark .hv-i {
    width: 1.6rem;
    height: 1.6rem;
}

/* Second sign-in step: authenticator setup, code entry, backup codes. */
.hv-otp .hv-login-card {
    width: min(27rem, 100%);
}

/* The bar above a one-column page is as wide as the card under it, so the
   logo and the theme toggle line up with its two edges. */
.hv-login-single .hv-login-top {
    width: min(26rem, 100%);
    margin: 0 auto;
}

.hv-otp .hv-login-top {
    width: min(27rem, 100%);
}

.hv-otp-mark {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.9rem;
    border-radius: 0.9rem;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-otp-mark .hv-i {
    width: 1.4rem;
    height: 1.4rem;
}

.hv-otp-mark-good {
    border-radius: 50%;
    background: var(--hv-good-bg);
    color: var(--hv-good-fg);
}

.hv-otp .hv-alert {
    margin-bottom: 1rem;
}

.hv-admin .hv-otp-input {
    width: 100%;
    height: 3.2rem;
    padding: 0 1rem;
    border-radius: 0.75rem;
    font-family: var(--font-family-monospace);
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    text-align: center;
}

.hv-admin .hv-otp-input-backup {
    font-size: 1.15rem;
    letter-spacing: 0.15em;
}

.hv-otp-steps {
    margin: 0 0 1.25rem;
    padding-left: 1.2rem;
    color: var(--hv-text);
    font-size: 0.88rem;
    line-height: 1.55;
}

.hv-otp-steps li + li {
    margin-top: 0.35rem;
}

.hv-otp-qr {
    margin: 0 0 1rem;
    text-align: center;
}

/* The code itself stays dark on white in both themes: cameras read it best. */
.hv-otp-qr svg {
    display: block;
    width: min(13.5rem, 100%);
    height: auto;
    margin: 0 auto;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: var(--hv-shadow-sm);
}

.hv-otp-qr figcaption {
    margin-top: 0.6rem;
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-otp-key {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
}

.hv-otp-key summary {
    color: var(--hv-accent-text);
    font-weight: 600;
    cursor: pointer;
}

.hv-otp-key p {
    margin: 0.5rem 0;
    color: var(--hv-muted);
}

.hv-otp-key code,
.hv-otp-codes code {
    font-family: var(--font-family-monospace);
    overflow-wrap: anywhere;
}

.hv-otp-key code {
    display: block;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.6rem;
    background: var(--hv-field-bg);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.hv-otp-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.9rem;
    border: 1px dashed var(--hv-line-strong);
    border-radius: 0.75rem;
    list-style: none;
}

.hv-otp-codes code {
    display: block;
    padding: 0.35rem 0;
    color: var(--hv-text);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.hv-otp-done {
    margin-top: 0.75rem;
}

.hv-otp-alt {
    margin-top: 1.25rem;
    font-size: 0.84rem;
    text-align: center;
}

.hv-otp-alt a {
    color: var(--hv-accent-text);
    font-weight: 600;
}

.hv-otp-alt p,
.hv-otp-note {
    margin: 0.6rem 0 0;
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-otp-out {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hv-line);
    color: var(--hv-muted);
    font-size: 0.8rem;
}

.hv-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hv-accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Hồ sơ của tôi: signed-in devices and backup codes. */
.hv-devices {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-devices li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--hv-line);
}

.hv-devices li:first-child {
    border-top: 0;
}

.hv-devices-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.hv-devices-body strong {
    font-size: 0.88rem;
}

.hv-backup-left {
    margin: 0 0 0.9rem;
    font-size: 0.88rem;
}

.hv-backup-new label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.hv-backup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.hv-admin .hv-backup-row .hv-otp-input {
    flex: 1 1 9rem;
    width: auto;
    height: 2.4rem;
    font-size: 1.1rem;
}

/* Audit log (/admin/audit/). */
.hv-audit-stats {
    margin: 1.25rem 0 1rem;
}

.hv-admin a.hv-stat {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hv-admin a.hv-stat:hover {
    border-color: var(--hv-line-strong);
    box-shadow: var(--hv-shadow-sm), var(--hv-shadow);
    transform: translateY(-1px);
}

.hv-admin a.hv-stat:focus-visible {
    outline: 3px solid var(--hv-focus);
    outline-offset: 2px;
}

.hv-audit-stat-warn {
    border-color: var(--hv-warn-line);
}

.hv-audit-stat-warn .hv-stat-value,
.hv-audit-stat-warn .hv-stat-label .hv-i {
    color: var(--hv-warn-fg);
}

.hv-audit-toolbar {
    container-type: inline-size;
    margin-bottom: 1rem;
}

.hv-audit-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

/* A fixed grid, not auto-fill: every control keeps its column at every width, so nothing is squeezed beside the button. */
.hv-audit-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem 0.85rem;
    align-items: start;
}

@container (min-width: 34rem) {
    .hv-audit-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hv-audit-search,
    .hv-audit-form-actions {
        grid-column: 1 / -1;
    }
}

@container (min-width: 54rem) {
    .hv-audit-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hv-audit-search {
        grid-column: span 2;
    }

    .hv-audit-form-actions {
        grid-column: -2 / -1;
    }
}

.hv-audit-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    margin: 0;
}

.hv-audit-field > span:first-child {
    color: var(--hv-text-2);
    font-size: 0.76rem;
    font-weight: 600;
}

.hv-admin .hv-audit-field select,
.hv-admin .hv-audit-field .hv-field,
.hv-audit-field .hv-select,
.hv-audit-field .hv-kyc-search-box {
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* The KYC search box grows along a row; in this column it would grow downwards. */
.hv-audit-field .hv-kyc-search-box {
    flex: none;
}

/* Django gives inputs a 2px margin that selects do not have; it put the boxes out of line. */
.hv-admin .hv-audit-field input {
    margin: 0;
}

.hv-audit-form-actions {
    display: flex;
    align-self: end;
    justify-content: flex-end;
}

.hv-audit-form-actions .hv-btn {
    min-width: 8.5rem;
    justify-content: center;
}

.hv-audit-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--hv-line);
}

.hv-admin a.hv-audit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.28rem 0.5rem 0.28rem 0.7rem;
    border-radius: 999px;
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.hv-admin a.hv-audit-pill:hover {
    background: var(--hv-lavender);
    color: var(--hv-ink);
}

.hv-audit-pill .hv-i {
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
}

.hv-audit-results > .hv-card-head {
    padding-bottom: 0.75rem;
}

.hv-audit-table td {
    vertical-align: top;
}

.hv-audit-day th {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    background: var(--hv-surface-2);
    color: var(--hv-text-2);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.hv-table tbody tr.hv-audit-day:hover th {
    background: var(--hv-surface-2);
}

.hv-audit-time {
    color: var(--hv-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-audit-who {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 10rem;
}

.hv-audit-who-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hv-audit-who-text strong {
    font-weight: 600;
}

.hv-audit-avatar-unknown,
:root[data-theme="dark"] .hv-audit-avatar-unknown {
    background: var(--hv-surface-3);
    color: var(--hv-muted);
}

.hv-audit-action {
    white-space: nowrap;
}

.hv-audit-target {
    min-width: 11rem;
}

.hv-audit-target .hv-cell-sub {
    margin-bottom: 0.1rem;
}

.hv-audit-detail {
    min-width: 14rem;
    max-width: 26rem;
    color: var(--hv-text-2);
    font-size: 0.82rem;
    overflow-wrap: break-word;
}

.hv-audit-origin {
    margin-top: 0.2rem;
}

.hv-audit-origin .hv-code {
    font-size: 0.76rem;
}

.hv-audit-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.35rem;
    border-top: 1px solid var(--hv-line);
    font-size: 0.82rem;
}

.hv-audit-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.hv-admin a.hv-audit-page,
.hv-audit-page,
.hv-audit-gap {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.4rem;
    border-radius: 0.55rem;
    color: var(--hv-text-2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.hv-admin a.hv-audit-page:hover {
    background: var(--hv-surface-2);
    color: var(--hv-text);
}

.hv-audit-page.is-on {
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

.hv-audit-gap {
    color: var(--hv-muted);
}

/* Phones: each line becomes a small card instead of a table that scrolls sideways. */
@media (max-width: 720px) {
    .hv-audit-table thead {
        display: none;
    }

    .hv-audit-table,
    .hv-audit-table tbody,
    .hv-audit-day,
    .hv-audit-day th {
        display: block;
    }

    .hv-audit-table tbody tr:not(.hv-audit-day) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "who time" "action action" "target target" "detail detail";
        gap: 0.5rem 0.75rem;
        padding: 0.9rem 1rem;
        border-bottom: 1px solid var(--hv-line);
    }

    .hv-audit-table tbody tr:last-child {
        border-bottom: 0;
    }

    .hv-audit-table td,
    .hv-audit-table td:first-child {
        min-width: 0;
        max-width: none;
        padding: 0;
        border: 0;
    }

    .hv-audit-day th,
    .hv-table .hv-audit-day th:first-child {
        padding: 0.5rem 1rem;
    }

    .hv-audit-time {
        grid-area: time;
        align-self: center;
    }

    .hv-audit-who {
        grid-area: who;
    }

    .hv-audit-action {
        grid-area: action;
    }

    .hv-audit-target {
        grid-area: target;
    }

    .hv-audit-target:has(> .hv-muted:only-child) {
        display: none;
    }

    .hv-audit-detail {
        grid-area: detail;
    }

    .hv-audit-detail:has(> .hv-muted:only-child) {
        display: none;
    }

    .hv-audit-pager {
        padding: 0.85rem 1rem;
    }
}

/* Closing a user account (/admin/accounts/account/<id>/close/). */
.hv-admin .object-tools a.hv-closelink {
    border-color: var(--hv-line-strong);
    background: var(--hv-surface);
    color: var(--hv-bad-fg);
}

.hv-admin .object-tools a.hv-closelink:hover {
    border-color: var(--hv-bad-fg);
    background: var(--hv-bad-bg);
    color: var(--hv-bad-fg);
}

.hv-close-layout {
    display: grid;
    gap: 1rem;
    max-width: 52rem;
    margin-top: 1.25rem;
}

.hv-close-effects {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.hv-close-effects li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    color: var(--hv-text-2);
    font-size: 0.86rem;
    line-height: 1.5;
}

.hv-close-effects .hv-i {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    color: var(--hv-accent-text);
}

.hv-close-reason {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
}

.hv-admin .hv-close-reason textarea.hv-field {
    max-width: none;
    margin: 0;
    font-weight: 400;
}

/* Extra tabs appended after a record's own form (related summaries, timetables).
   A fieldset is never narrower than its content unless told: the tables would
   push the whole page sideways instead of scrolling inside the card. */
.hv-admin #content-main fieldset.module.hv-panel {
    min-width: 0;
}

.hv-admin #content-main fieldset.module.hv-panel > :not(h2) {
    margin: 1.15rem 1.35rem 1.35rem;
}

.hv-panel h3 {
    margin: 0 0 0.6rem;
    color: var(--hv-text-2);
    font-size: 0.82rem;
    font-weight: 650;
}

/* The week: a grid of half hours, one lane a day, blocks placed by row and column. */
.hv-tt {
    --hv-tt-row: 1.55rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
}

.hv-tt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
}

.hv-tt-week {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
}

.hv-tt-back {
    transform: rotate(180deg);
}

.hv-tt-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin: 0;
    color: var(--hv-text-2);
    font-size: 0.8rem;
}

.hv-tt-scroll {
    overflow-x: auto;
    border: 1px solid var(--hv-line);
    border-radius: 0.75rem;
}

.hv-tt-grid {
    display: grid;
    grid-template-columns: 3.4rem repeat(7, minmax(5.6rem, 1fr));
    column-gap: 2px;
    min-width: 43rem;
    padding: 0 0.4rem 0.4rem 0;
    background: var(--hv-surface);
}

.hv-tt-corner,
.hv-tt-day {
    background: var(--hv-surface);
    border-bottom: 1px solid var(--hv-line);
}

.hv-tt-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    padding: 0.5rem 0.2rem 0.45rem;
    color: var(--hv-text-2);
    font-size: 0.74rem;
}

.hv-tt-day strong {
    color: var(--hv-text);
    font-size: 0.86rem;
}

.hv-tt-day.is-today {
    color: var(--hv-accent-text);
}

.hv-tt-day.is-today strong {
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

/* Each day's background: a line at every whole hour (two rows). */
.hv-tt-lane {
    position: relative;
    z-index: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--hv-tt-row) * 2 - 1px),
            var(--hv-line) calc(var(--hv-tt-row) * 2 - 1px),
            var(--hv-line) calc(var(--hv-tt-row) * 2)
        ),
        var(--hv-surface-2);
}

.hv-tt-lane.is-today {
    box-shadow: inset 0 0 0 1.5px var(--hv-accent);
}

.hv-tt-hour {
    align-self: start;
    padding: 0.1rem 0.45rem 0 0;
    color: var(--hv-muted);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.hv-tt-block {
    position: relative;
    min-width: 0;
    margin: 1px 2px;
    overflow: hidden;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    line-height: 1.25;
}

.hv-tt-block.is-work {
    z-index: 1;
    margin: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--hv-good-bg) 85%, transparent);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--hv-good-fg) 55%, transparent);
}

/* Days off: red with stripes, so they read without relying on colour alone. */
.hv-tt-block.is-off {
    z-index: 2;
    margin: 0;
    border-radius: 0;
    background: repeating-linear-gradient(
        135deg,
        var(--hv-bad-bg) 0 6px,
        color-mix(in srgb, var(--hv-bad-fg) 20%, var(--hv-bad-bg)) 6px 12px
    );
    box-shadow: inset 3px 0 0 var(--hv-bad-fg);
    color: var(--hv-bad-fg);
}

.hv-tt-block.is-off span {
    display: block;
    padding: 0.15rem 0.4rem;
    font-weight: 650;
}

/* A visit is a card on top of the green, its left edge in the colour of its status. */
.hv-tt-block.is-visit {
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0 0.3rem;
    padding: 0.15rem 0.35rem 0.15rem 0.45rem;
    border: 1px solid var(--hv-line-strong);
    border-left: 3px solid currentColor;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow);
    text-decoration: none;
}

.hv-tt-block.is-visit strong,
.hv-tt-block.is-visit span {
    color: var(--hv-text);
}

.hv-admin a.hv-tt-block.is-visit:hover {
    filter: brightness(0.96);
    box-shadow: 0 0 0 2px var(--hv-focus);
}

.hv-tt-block.is-visit small {
    flex-basis: 100%;
    opacity: 0.85;
}

.hv-tt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--hv-text-2);
    font-size: 0.78rem;
}

.hv-tt-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

.hv-tt-swatch {
    width: 1rem;
    height: 0.8rem;
    border: 1px solid var(--hv-line-strong);
    border-radius: 0.2rem;
    background: var(--hv-surface-2);
}

.hv-tt-swatch.is-work {
    background: var(--hv-good-bg);
}

.hv-tt-swatch.is-off {
    background: repeating-linear-gradient(135deg, var(--hv-bad-bg) 0 3px, color-mix(in srgb, var(--hv-bad-fg) 30%, var(--hv-bad-bg)) 3px 6px);
}

.hv-tt-swatch.is-visit {
    border-left: 3px solid var(--hv-info-fg);
    background: var(--hv-surface);
}

.hv-tt-note {
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.76rem;
}

/* Summary tabs: counts, two short lists, the way to the full list. */
.hv-sum {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.hv-sum > *,
.hv-sum-lists > *,
.hv-tt > * {
    min-width: 0;
}

.hv-sum-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    gap: 0.6rem;
}

.hv-sum-count {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.75rem;
    background: var(--hv-surface-2);
}

.hv-sum-count strong {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1;
}

.hv-sum-lists {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.hv-sum-table th:first-child,
.hv-sum-table td:first-child {
    padding-left: 0;
}

.hv-sum-when {
    color: var(--hv-text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-sum-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--hv-line);
    font-size: 0.82rem;
}

.hv-sum-note {
    margin: 0;
}

.hv-sum-rating {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 1.25rem 2rem;
    align-items: start;
}

.hv-sum-score strong {
    font-size: 2.4rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1;
}

.hv-sum-score > span {
    margin-left: 0.35rem;
    color: var(--hv-muted);
    font-size: 0.9rem;
}

.hv-sum-score p {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
}

.hv-sum-spread {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-sum-spread li {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) 2.5rem;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
}

.hv-sum-bar {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--hv-surface-3);
}

.hv-sum-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #c48a28;
}

.hv-sum-reviews {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Django gives lists inside a form a bullet and an indent; these have neither. */
.hv-admin .hv-panel ul.hv-sum-reviews,
.hv-admin .hv-panel ul.hv-sum-spread,
.hv-admin .hv-panel ul.hv-tt-legend {
    margin: 0;
    padding: 0;
}

.hv-sum-reviews li,
.hv-sum-spread li,
.hv-tt-legend li {
    list-style: none;
}

.hv-sum-reviews li {
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--hv-line);
}

.hv-sum-reviews li:first-child {
    padding-top: 0;
}

.hv-admin a.hv-sum-review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    color: inherit;
    font-size: 0.8rem;
    text-decoration: none;
}

.hv-sum-stars {
    color: #c48a28;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.hv-sum-stars .is-empty {
    color: var(--hv-line-strong);
}

.hv-sum-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.45rem 0 0;
}

.hv-sum-comment {
    margin: 0.45rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.84rem;
    line-height: 1.5;
}

@media (max-width: 767px) {
    .hv-admin #content-main fieldset.module.hv-panel > :not(h2) {
        margin: 1rem;
    }

    .hv-sum-rating {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Popups opened from a related-object field. */
.popup .hv-content {
    padding: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .hv-admin *,
    .hv-admin *::before,
    .hv-admin *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Narrow screens: labels above fields, single column everywhere. */
@media (max-width: 767px) {
    .hv-admin .flex-container > .hv-date-echo {
        margin-left: 0;
    }

    .hv-stats,
    .hv-dash .hv-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hv-stat-value {
        font-size: 1.45rem;
    }

    .hv-admin .aligned label {
        width: auto;
        min-width: 0;
        padding: 0 0 0.35rem;
    }

    .hv-admin .aligned div.help,
    .hv-admin .aligned p.help,
    .hv-admin form .aligned div.help {
        margin-left: 0;
    }

    .hv-admin .form-row {
        padding: 0.75rem 1rem;
    }

    .hv-hero {
        padding: 1.35rem 1.25rem;
    }

    .hv-admin .hv-hero h1 {
        font-size: 1.45rem;
    }

    .hv-kyc-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.1rem;
    }

    .hv-kyc-facts dd {
        margin-bottom: 0.45rem;
    }

    .hv-bars li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hv-bars li .hv-bars-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .hv-ann-bars li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hv-ann-bars li .hv-ann-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* Phones and narrow windows.

   Django's responsive.css sizes each form row to the screen
   (`width: calc(100vw - 30px)`), which assumed fields sat on the bare page.
   Inside a padded card that is wider than the card, so every input ran
   about 20px past its edge. Rows follow their card here instead, controls
   never ask for more than the width they are given, and long words, codes
   and buttons wrap rather than push the page sideways. */
@media (max-width: 767px) {
    .hv-admin .aligned .form-row,
    .hv-admin .aligned .form-row > div {
        width: auto;
        max-width: 100%;
    }

    .hv-admin .form-row .flex-container,
    .hv-admin .form-row .flex-container > * {
        min-width: 0;
        max-width: 100%;
    }

    .hv-admin .aligned .form-row input:not([type="checkbox"]):not([type="radio"]),
    .hv-admin .aligned .form-row textarea,
    .hv-select,
    .hv-select.hv-field,
    .hv-admin .select2-container--admin-autocomplete.select2-container {
        min-width: 0;
        max-width: 100%;
    }

    .hv-admin .aligned .form-row .hv-select {
        width: 100%;
    }

    .hv-admin .aligned .form-row .hv-select.hv-field-sm {
        max-width: var(--hv-field-width-sm);
    }

    .hv-admin .related-widget-wrapper {
        flex-wrap: wrap;
    }

    .hv-admin .readonly,
    .hv-admin .help,
    .hv-admin div.help,
    .hv-admin .hv-preview-key,
    .hv-admin .hv-doc-key,
    .hv-admin .hv-doc-meta,
    .hv-admin .hv-feed-body,
    .hv-admin .hv-kyc-contact,
    .hv-admin .hv-profile-meta,
    .hv-admin ul.messagelist li,
    .hv-admin .errornote {
        overflow-wrap: anywhere;
    }

    .hv-btn,
    .hv-admin .button,
    .hv-admin input[type="submit"],
    .hv-admin input[type="button"],
    .hv-admin .submit-row input,
    .hv-admin a.button,
    .hv-admin .submit-row a.deletelink,
    .hv-admin .submit-row a.closelink,
    .hv-admin a.cancel-link {
        height: auto;
        min-height: var(--hv-control);
        padding: 0.55rem 0.9rem;
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }

    /* The save bar stops floating over the form and becomes a tidy grid:
       Lưu across the top, the two other saves side by side, delete last. */
    .hv-admin .submit-row {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
        box-shadow: var(--hv-shadow);
    }

    .hv-admin .submit-row input.default {
        order: -1;
        grid-column: 1 / -1;
    }

    .hv-admin .submit-row a.deletelink,
    .hv-admin .submit-row a.closelink {
        order: 9;
        grid-column: 1 / -1;
        margin: 0;
    }

    .hv-admin .submit-row input,
    .hv-admin .submit-row a {
        width: 100%;
        margin: 0;
    }

    .hv-admin .submit-row > :only-child {
        grid-column: 1 / -1;
    }

    /* Change list. */
    .hv-admin #toolbar {
        padding: 0.75rem;
    }

    .hv-admin #toolbar form > div {
        flex-wrap: wrap;
    }

    .hv-admin #toolbar #searchbar {
        flex: 1 1 10rem;
        width: auto !important;
        max-width: none;
    }

    .hv-admin #changelist .actions {
        padding: 0.6rem 0.75rem;
    }

    .hv-admin #changelist .actions label {
        display: flex;
        flex: 1 1 100%;
        flex-wrap: wrap;
        min-width: 0;
    }

    .hv-admin #changelist .actions .hv-select {
        flex: 1 1 10rem;
        min-width: 0;
    }

    .hv-admin #changelist .actions span {
        flex: 1 1 100%;
    }

    .hv-admin #changelist table tbody td,
    .hv-admin #changelist table tbody th,
    .hv-admin #changelist table thead th .text a,
    .hv-admin #changelist table thead th .text span {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .hv-admin .paginator {
        justify-content: center;
    }

    .hv-select-filter .hv-select-value {
        max-width: 8.5rem;
    }

    .hv-admin #changelist-filter #changelist-filter-extra-actions {
        margin-left: 0;
    }

    .hv-admin .xfull,
    .hv-admin #changelist .toplinks {
        padding: 0.6rem 0.75rem;
    }

    /* Pages and desks. */
    .hv-admin #content > h1 {
        font-size: 1.35rem;
    }

    .hv-page-head h1,
    .hv-admin .hv-hero h1 {
        font-size: 1.35rem;
    }

    .hv-page-tools,
    .hv-hero-actions {
        width: 100%;
    }

    .hv-hero-actions .hv-btn {
        flex: 1 1 auto;
    }

    .hv-card,
    .hv-ann-step {
        padding: 1rem;
    }

    .hv-card-flush > .hv-card-head {
        padding: 1rem 1rem 0.75rem;
    }

    .hv-table th:first-child,
    .hv-table td:first-child {
        padding-left: 1rem;
    }

    .hv-card-head {
        flex-wrap: wrap;
    }

    .hv-mini-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hv-todo-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-kyc-bar,
    .hv-kyc-search {
        flex-wrap: wrap;
    }

    .hv-kyc-tabs {
        width: 100%;
    }

    .hv-kyc-search-box {
        max-width: none;
    }

    .hv-kyc-hero,
    .hv-kyc-case .hv-kyc-panel,
    .hv-kyc-case .hv-kyc-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hv-kyc-check {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .hv-kyc-strip > div {
        padding: 0.7rem 1rem;
    }

    .hv-kyc-strip > div:nth-child(3) {
        border-left: 0;
    }

    .hv-kyc-strip > div:nth-child(n + 3) {
        border-top: 1px solid var(--hv-line);
    }

    .hv-kyc-case .hv-kyc-buttons {
        width: 100%;
        margin-left: 0;
    }

    .hv-kyc-case .hv-kyc-buttons .hv-btn {
        flex: 1 1 auto;
    }

    .hv-kyc-case .hv-kyc-docs {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-kyc-case.hv-kyc-supplements .hv-doc {
        flex-direction: column;
    }

    .hv-kyc-case.hv-kyc-supplements .hv-doc-thumb {
        width: 100%;
    }

    .hv-ann-audiences {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-ann-preview {
        position: static;
    }

    .hv-profile-head {
        padding: 1.1rem;
    }

    .hv-profile-actions {
        width: 100%;
    }

    .hv-profile-actions .hv-btn {
        flex: 1 1 auto;
    }

    .hv-dialog-buttons {
        flex-wrap: wrap;
    }

    .hv-dialog-buttons .hv-btn {
        flex: 1 1 auto;
    }

    .hv-tabs-frame {
        top: 3.85rem;
    }
}

/* Printing a report or the overview for a meeting: the page alone, in ink
   on paper, charts kept in colour. */
@media print {
    :root[data-theme] {
        --hv-bg: #ffffff;
        --hv-surface: #ffffff;
        --hv-shadow: none;
        --hv-shadow-sm: none;
        --hv-shadow-lg: none;
    }

    body.hv-admin {
        background: #ffffff;
        color: #10201a;
    }

    .hv-sidebar,
    .hv-topbar,
    .hv-scrim,
    .hv-palette,
    .hv-footer,
    .hv-page-tools,
    .hv-hero-actions,
    .hv-health,
    [data-hv-health],
    .object-tools,
    .submit-row,
    .hv-tabs-frame,
    #changelist-filter,
    #toolbar,
    #changelist .actions,
    .skip-to-content-link {
        display: none !important;
    }

    .hv-content {
        padding: 0;
    }

    .hv-admin #content {
        max-width: none;
    }

    .hv-card,
    .hv-stat,
    .hv-todo,
    .hv-kyc-case,
    .module {
        break-inside: avoid;
        box-shadow: none;
    }

    .hv-hero {
        background: none;
        color: #10201a;
        box-shadow: none;
        border: 1px solid #d3d0c6;
    }

    .hv-admin .hv-hero h1,
    .hv-hero .hv-lead,
    .hv-hero .hv-eyebrow {
        color: #10201a;
    }

    .hv-col-bar,
    .hv-bars-track > span,
    .hv-chip,
    .hv-delta {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .hv-admin fieldset.hv-tab-panel[hidden],
    .hv-admin .inline-group.hv-tab-panel[hidden] {
        display: block !important;
    }
}


/* Sign-in art without a photo (the kit ships none): a soft accent glow and
   the contour lines, so the dark panel is not a flat block. Drop a
   <img class="hv-login-photo"> into login.html to bring the photo back. */
.hv-login-art:not(:has(.hv-login-photo)) {
    background:
        radial-gradient(900px 520px at 85% 110%, rgba(14, 90, 78, 0.55), transparent 60%),
        radial-gradient(700px 420px at -10% -10%, rgba(159, 211, 191, 0.18), transparent 55%),
        url("../img/contours.b42680d62194.svg") right -6rem bottom -10rem / 36rem no-repeat,
        #10201a;
}


/* ====================================================================
   Halyt additions (2026-10-30): date widgets inline, bigger permission
   picker, calendar popup in the kit's palette, readable tables and
   read-only text, empty states, the profile page.
   ==================================================================== */

/* Date and time boxes: "Ngày: [box] Hôm nay | calendar" and "Giờ: [box]
   Bây giờ | clock". Django wraps the widget in <p class="date|time|datetime">
   and inserts <span class="datetimeshortcuts"> after each input; admin.js
   groups each label + box + shortcuts into .hv-dt-part so a row that has to
   break does so between the two halves, never inside one. */
.hv-admin .aligned p.date,
.hv-admin .aligned p.time,
.hv-admin .aligned p.datetime,
.hv-admin p.date,
.hv-admin p.time,
.hv-admin p.datetime {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    color: var(--hv-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.hv-dt-part {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.hv-dt-label {
    min-width: 2.6rem;
    color: var(--hv-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.hv-admin p.datetime br {
    display: none;
}

.hv-admin .aligned p.date input.vDateField,
.hv-admin .aligned p.datetime input.vDateField,
.hv-admin .aligned input[type="text"].vDateField,
.hv-admin input.vDateField {
    width: 9.5rem;
    max-width: 9.5rem;
    flex: none;
    color: var(--hv-text);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.hv-admin .aligned p.datetime input.vTimeField,
.hv-admin .aligned input[type="text"].vTimeField,
.hv-admin input.vTimeField {
    width: 6.5rem;
    max-width: 6.5rem;
    flex: none;
    color: var(--hv-text);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.hv-admin .datetimeshortcuts {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.1rem;
    font-size: 0; /* swallows the "|" text node Django puts between the two links */
    white-space: nowrap;
    vertical-align: middle;
}

.hv-admin .datetimeshortcuts a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.1rem;
    padding: 0 0.6rem;
    border: 1px solid var(--hv-line);
    border-radius: 0.55rem;
    background: var(--hv-surface);
    color: var(--hv-accent-text);
    font-size: 0.8rem;
    font-weight: 550;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.hv-admin .datetimeshortcuts a:hover {
    border-color: var(--hv-line-strong);
    background: var(--hv-accent-soft);
}

.hv-admin .datetimeshortcuts a:has(.date-icon),
.hv-admin .datetimeshortcuts a:has(.clock-icon) {
    width: 2.1rem;
    padding: 0;
    justify-content: center;
}

.hv-admin .datetimeshortcuts .date-icon,
.hv-admin .datetimeshortcuts .clock-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.75;
}

:root[data-theme="dark"] .hv-admin .datetimeshortcuts .date-icon,
:root[data-theme="dark"] .hv-admin .datetimeshortcuts .clock-icon {
    filter: invert(0.9);
}

/* Inside a tabular inline the cell is narrow: stack the two halves. */
.hv-admin .inline-group .tabular td.field-happened_at,
.hv-admin .inline-group .tabular td:has(> p.datetime) {
    min-width: 19rem;
}

.hv-admin .inline-group .tabular p.datetime {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.hv-admin .timezonewarning {
    margin: 0.3rem 0 0;
    color: var(--hv-muted);
    font-size: 0.76rem;
}

/* The calendar and clock pop-ups Django draws with the grey 2008 palette. */
.hv-admin .calendarbox,
.hv-admin .clockbox {
    z-index: 1100;
    width: 17rem;
    margin: 0.35rem 0 0;
    padding: 0;
    border: 1px solid var(--hv-line);
    border-radius: 0.9rem;
    background: var(--hv-surface);
    box-shadow: var(--hv-shadow-lg);
    overflow: hidden;
    font-size: 0.84rem;
}

.hv-admin .calendarbox h2,
.hv-admin .clockbox h2 {
    margin: 0;
    padding: 0.7rem 2.5rem;
    border: 0;
    border-bottom: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: var(--hv-text);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

.hv-admin .calendarnav-previous,
.hv-admin .calendarnav-next {
    top: 0.55rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.45rem;
    background-color: transparent;
    background-size: 0.9rem;
    opacity: 0.7;
}

.hv-admin .calendarnav-previous {
    left: 0.6rem;
}

.hv-admin .calendarnav-next {
    right: 0.6rem;
}

.hv-admin .calendarnav-previous:hover,
.hv-admin .calendarnav-next:hover {
    background-color: var(--hv-surface-3);
    opacity: 1;
}

:root[data-theme="dark"] .hv-admin .calendarnav-previous,
:root[data-theme="dark"] .hv-admin .calendarnav-next {
    filter: invert(0.9);
}

.hv-admin .calendar {
    margin: 0;
    width: 100%;
}

.hv-admin .calendar table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0.15rem;
    padding: 0.5rem;
}

.hv-admin .calendar caption {
    display: none;
}

.hv-admin .calendar th {
    padding: 0.3rem 0;
    border: 0;
    background: none;
    color: var(--hv-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

.hv-admin .calendar td {
    padding: 0;
    border: 0;
    text-align: center;
}

.hv-admin .calendar td a {
    display: grid;
    place-items: center;
    height: 2rem;
    border-radius: 0.5rem;
    background: none;
    color: var(--hv-text);
    font-weight: 500;
    text-decoration: none;
}

.hv-admin .calendar td a:hover,
.hv-admin .calendar td a:focus {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-admin .calendar td.today a {
    box-shadow: inset 0 0 0 1px var(--hv-accent);
    color: var(--hv-accent-text);
}

.hv-admin .calendar td.selected a {
    background: var(--hv-accent);
    color: var(--hv-accent-ink);
}

.hv-admin .calendar td.nonday {
    background: none;
}

.hv-admin .calendar-shortcuts {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-top: 1px solid var(--hv-line);
    background: var(--hv-surface-2);
    color: transparent; /* hides the "|" separators */
    font-size: 0;
}

.hv-admin .calendar-shortcuts a,
.hv-admin .calendar-cancel a {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 0.45rem;
    color: var(--hv-accent-text);
    font-size: 0.8rem;
    font-weight: 550;
    text-decoration: none;
}

.hv-admin .calendar-shortcuts a:hover,
.hv-admin .calendar-cancel a:hover {
    background: var(--hv-accent-soft);
}

.hv-admin .calendar-cancel {
    margin: 0;
    padding: 0.35rem;
    border: 0;
    border-top: 1px solid var(--hv-line);
    background: var(--hv-surface);
    text-align: center;
}

.hv-admin .calendar-cancel a {
    color: var(--hv-muted);
}

.hv-admin .clockbox .timelist {
    margin: 0;
    padding: 0.5rem;
    list-style: none;
}

.hv-admin .clockbox .timelist a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--hv-text);
    font-weight: 500;
    text-decoration: none;
}

.hv-admin .clockbox .timelist a:hover {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

/* Permission picker: full width of the card, label on top, tall lists so a
   whole app's permissions are visible without scrolling. */
.hv-admin .form-row.field-permissions > div,
.hv-admin .form-row.field-user_permissions > div,
.hv-admin .form-row.field-groups > div,
.hv-admin .form-row.field-permissions .flex-container,
.hv-admin .form-row.field-user_permissions .flex-container,
.hv-admin .form-row.field-groups .flex-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.hv-admin .form-row.field-permissions .aligned label,
.hv-admin .form-row.field-user_permissions .aligned label,
.hv-admin .form-row.field-groups .aligned label,
.hv-admin .form-row.field-permissions > div > label,
.hv-admin .form-row.field-user_permissions > div > label,
.hv-admin .form-row.field-groups > div > label,
.hv-admin .form-row.field-permissions .flex-container > label,
.hv-admin .form-row.field-user_permissions .flex-container > label,
.hv-admin .form-row.field-groups .flex-container > label {
    width: auto;
    min-width: 0;
    padding: 0;
    color: var(--hv-text);
    font-weight: 600;
}

.hv-admin .form-row.field-permissions div.help,
.hv-admin .form-row.field-user_permissions div.help,
.hv-admin .form-row.field-groups div.help {
    margin-left: 0;
}

.hv-admin .selector {
    width: 100%;
    max-width: none;
    gap: 0 0.85rem;
}

.hv-admin .selector-available,
.hv-admin .selector-chosen {
    flex: 1 1 0;
    min-width: 0;
}

.hv-admin .selector-available h2,
.hv-admin .selector-chosen h2,
.hv-admin .selector-available-title,
.hv-admin .selector-chosen-title {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.hv-admin .selector-available-title label,
.hv-admin .selector-chosen-title label {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    color: inherit;
    font: inherit;
}

.hv-admin .selector .helptext {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.8;
}

.hv-admin .selector .selector-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-width: 0 1px;
}

.hv-admin .selector .selector-filter label {
    float: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    opacity: 0.6;
}

.hv-admin .selector .selector-filter input {
    width: 100%;
    height: 2.1rem;
    padding: 0 0.6rem;
    font-size: 0.84rem;
}

.hv-admin .selector select {
    height: 30rem;
    padding: 0.3rem;
    border-color: var(--hv-line);
    font-size: 0.84rem;
    line-height: 1.5;
}

.hv-admin .selector .selector-chosen--with-filtered select {
    height: 26.5rem;
}

.hv-admin .selector select option {
    padding: 0.3rem 0.5rem;
    border-radius: 0.35rem;
}

.hv-admin .selector select option:checked {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-admin .selector-chosen .list-footer-display {
    border-color: var(--hv-line);
    border-radius: 0 0 0.6rem 0.6rem;
    background: var(--hv-surface-2);
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-admin .selector-chosen .list-footer-display__clear {
    color: var(--hv-accent-text);
}

.hv-admin .selector ul.selector-chooser {
    width: 2.4rem;
    padding: 0.3rem 0;
    background: var(--hv-surface-2);
    border: 1px solid var(--hv-line);
}

.hv-admin .selector-chooser li {
    padding: 0.2rem;
}

.hv-admin .selector-add,
.hv-admin .selector-remove {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.45rem;
    opacity: 0.55;
}

.hv-admin .selector-add:hover,
.hv-admin .selector-remove:hover {
    background-color: var(--hv-accent-soft);
    opacity: 1;
}

.hv-admin a.selector-chooseall,
.hv-admin a.selector-clearall {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0.35rem 0.6rem;
    border-radius: 0.45rem;
    color: var(--hv-accent-text);
    font-size: 0.8rem;
    font-weight: 550;
}

.hv-admin a.selector-chooseall:hover,
.hv-admin a.selector-clearall:hover {
    background: var(--hv-accent-soft);
}

:root[data-theme="dark"] .hv-admin .selector-add,
:root[data-theme="dark"] .hv-admin .selector-remove,
:root[data-theme="dark"] .hv-admin a.selector-chooseall,
:root[data-theme="dark"] .hv-admin a.selector-clearall,
:root[data-theme="dark"] .hv-admin .selector .selector-filter label {
    filter: invert(0.9) hue-rotate(180deg);
}

@media (max-width: 900px) {
    .hv-admin .selector {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hv-admin .selector ul.selector-chooser {
        flex-direction: row;
        display: flex;
        width: auto;
        align-self: center;
    }

    .hv-admin .selector select {
        height: 16rem;
    }
}

/* Change lists: two-line cells, quiet notes, money and dates that line up,
   zebra rows so a wide table can be read across. */
.hv-admin #changelist table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--hv-surface-2) 55%, transparent);
}

.hv-admin #changelist table tbody tr:nth-child(even):hover,
.hv-admin #changelist table tbody tr:hover {
    background: var(--hv-surface-2);
}

.hv-admin #changelist table tbody td {
    max-width: 30rem;
    overflow-wrap: anywhere;
}

.hv-admin #changelist table tbody td:has(> .hv-chip),
.hv-admin #changelist table tbody td:has(> .hv-cell-money),
.hv-admin #changelist table tbody td:has(> img) {
    white-space: nowrap;
}

.hv-admin #changelist table tbody td[class*="_at"],
.hv-admin #changelist table tbody td[class*="_on"],
.hv-admin #changelist table tbody td[class*="_date"],
.hv-admin #changelist table tbody td.field-last_login,
.hv-admin #changelist table tbody td.field-created_at,
.hv-admin #changelist table tbody th.field-created_at,
.hv-admin #changelist table tbody th.field-paid_on {
    white-space: nowrap;
    color: var(--hv-text-2);
    font-variant-numeric: tabular-nums;
}

.hv-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    line-height: 1.35;
}

.hv-cell > strong {
    font-weight: 600;
    color: var(--hv-text);
}

.hv-cell-sub {
    display: block;
    max-width: 18rem;
    overflow: hidden;
    color: var(--hv-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-cell-note {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 34rem;
    color: var(--hv-text-2);
    font-size: 0.82rem;
    line-height: 1.45;
}

.hv-cell-money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.hv-thumb {
    display: block;
    max-width: 7rem;
    max-height: 3.5rem;
    border-radius: 0.45rem;
    border: 1px solid var(--hv-line);
    object-fit: cover;
}

.hv-chip-info,
.hv-chip-info.hv-chip {
    background: var(--hv-accent-soft);
    color: var(--hv-accent-text);
}

.hv-admin #changelist table tbody td .hv-chip {
    vertical-align: middle;
}

/* Boolean icons: a tick or a cross is read faster in colour. */
.hv-admin #changelist table tbody td img[src*="icon-yes"] {
    filter: hue-rotate(0deg) saturate(1.2);
}

/* Empty list card. */
.hv-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.hv-empty-state::before {
    content: "";
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--hv-accent-soft);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5 12 3l8 4.5v9L12 21l-8-4.5z'/%3E%3Cpath d='M4 7.5 12 12l8-4.5M12 12v9'/%3E%3C/svg%3E") center / 55% no-repeat, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5 12 3l8 4.5v9L12 21l-8-4.5z'/%3E%3Cpath d='M4 7.5 12 12l8-4.5M12 12v9'/%3E%3C/svg%3E") center / 55% no-repeat, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.hv-empty-title {
    margin: 0;
    color: var(--hv-text);
    font-size: 0.95rem;
    font-weight: 600;
}

.hv-empty-title::first-letter {
    text-transform: uppercase;
}

.hv-empty-hint {
    margin: 0;
    color: var(--hv-muted);
    font-size: 0.84rem;
}

/* Read-only values on a change form: a quiet box, long text keeps its lines.
   Django's `.aligned label + div.readonly` zeroes the side padding (also at
   <768px), so the selector here must outrank it. */
.hv-admin .aligned label + div.readonly,
.hv-admin .readonly {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.4rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.6rem 1rem;
    border: 1px dashed var(--hv-line-strong);
    border-radius: 0.6rem;
    background: var(--hv-surface-2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: var(--hv-field-width);
    box-sizing: border-box;
}

.hv-admin .readonly img[src*="icon-"] {
    width: 1.1rem;
    height: 1.1rem;
}

.hv-admin .readonly:has(> .hv-chip),
.hv-admin .readonly:has(> img),
.hv-admin .readonly:has(> a:only-child) {
    white-space: normal;
}

.hv-admin .readonly .hv-chip {
    margin: 0.1rem 0.2rem 0.1rem 0;
}

.hv-admin .aligned textarea {
    min-height: 7rem;
    line-height: 1.55;
}

/* Profile page. */
.hv-profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
}

.hv-avatar-xl,
.hv-admin .hv-avatar.hv-avatar-xl {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.45rem;
    font-weight: 700;
    border-radius: 1.25rem;
}

.hv-profile-id {
    flex: 1 1 18rem;
    min-width: 0;
}

.hv-profile-id h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.hv-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    margin: 0.3rem 0 0.65rem;
    color: var(--hv-muted);
    font-size: 0.86rem;
}

.hv-profile-meta span + span::before {
    content: "·";
    margin: 0 0.6rem;
    opacity: 0.6;
}

.hv-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.hv-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.hv-profile-side {
    display: grid;
    gap: 1.25rem;
}

@media (max-width: 960px) {
    .hv-profile-grid {
        grid-template-columns: 1fr;
    }
}

.hv-form {
    padding: 1.25rem 1.35rem 1.35rem;
}

.hv-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

@media (max-width: 640px) {
    .hv-form-grid {
        grid-template-columns: 1fr;
    }
}

.hv-span-2 {
    grid-column: 1 / -1;
}

.hv-form-field label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--hv-text-2);
    font-size: 0.84rem;
    font-weight: 500;
}

.hv-form-field .hv-req {
    color: var(--hv-danger);
}

.hv-form-field .hv-field,
.hv-admin #content-main .hv-form-field .hv-field {
    max-width: none;
}

.hv-form-field.has-error .hv-field {
    border-color: var(--hv-danger);
}

.hv-field-help {
    margin: 0.3rem 0 0;
    color: var(--hv-muted);
    font-size: 0.78rem;
}

.hv-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hv-line);
}

.hv-dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem 1.25rem;
    margin: 0;
    padding: 1rem 1.35rem;
    font-size: 0.86rem;
}

.hv-dl dt {
    color: var(--hv-muted);
}

.hv-dl dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.hv-list {
    margin: 0;
    padding: 0.25rem 1.35rem;
    list-style: none;
}

.hv-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--hv-line);
    font-size: 0.88rem;
}

.hv-list li:last-child {
    border-bottom: 0;
}

.hv-list p {
    margin: 0.3rem 0 0;
    color: var(--hv-text-2);
    font-size: 0.84rem;
    line-height: 1.55;
}

.hv-table-group td {
    padding: 0.45rem 1.1rem;
    background: var(--hv-surface-2);
    color: var(--hv-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hv-perm-table td .hv-chip {
    margin: 0.1rem 0.15rem 0.1rem 0;
}

.hv-timeline {
    margin: 0;
    padding: 0.25rem 1.35rem;
    list-style: none;
}

.hv-timeline li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--hv-line);
    font-size: 0.86rem;
}

.hv-timeline li:last-child {
    border-bottom: 0;
}

.hv-timeline time {
    min-width: 7.5rem;
    color: var(--hv-muted);
    font-variant-numeric: tabular-nums;
}

.hv-timeline strong {
    font-weight: 600;
}

/* Account menu: the profile entry sits first, with a divider before sign-out. */
.hv-menu form#logout-form {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--hv-line);
}

/* Password hash on the user form: Django lists algorithm, salt, cost…; one
   sentence and the reset button are all a manager needs. */
.hv-admin .field-password #id_password > p:first-of-type {
    display: none;
}

.hv-admin .field-password #id_password::before {
    content: "Mật khẩu đã được băm, không xem lại được. Dùng nút bên dưới để đặt mật khẩu mới.";
    display: block;
    padding: 0.5rem 0;
    color: var(--hv-muted);
    font-size: 0.84rem;
}

.hv-admin .field-password #id_password > p {
    margin: 0;
}

/* "Chưa có" where a value is missing, instead of a dash that reads as a bug. */
.hv-cell-empty {
    color: var(--hv-muted);
    font-size: 0.8rem;
    font-style: italic;
    font-weight: 400;
}

.hv-admin #changelist table tbody td .hv-cell-empty,
.hv-admin .readonly .hv-cell-empty {
    font-size: 0.82rem;
}

.hv-admin #changelist table tbody td img[alt="-"],
.hv-admin .readonly img[alt="-"] {
    opacity: 0.35;
}

/* Breathing room: the page never touches the window edge. */
.hv-admin .hv-content {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
}

@media (max-width: 767px) {
    .hv-admin .hv-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hv-admin .form-row {
        padding: 0.75rem 1rem;
    }

    .hv-admin .aligned label {
        width: auto;
        min-width: 0;
        padding: 0 0 0.35rem;
    }

    .hv-admin .flex-container {
        flex-direction: column;
        align-items: stretch;
    }

    .hv-admin .aligned div.help,
    .hv-admin form .aligned div.help {
        margin-left: 0;
    }

    .hv-admin .submit-row {
        bottom: 0.5rem;
    }
}
