/* ============================================================
   Horizon design system, on top of Bootstrap 5.3.
   Colours are tokens (--hz-*) with a light and a dark set; Bootstrap's own variables point at them,
   so Bootstrap components follow the theme. The theme is set on <html data-bs-theme> (see App.razor).
   ============================================================ */

:root,
[data-bs-theme=light] {
    --hz-bg: #f5f6fa;
    --hz-surface: #ffffff;
    --hz-surface-2: #f1f3f8;
    --hz-border: #e3e6ee;
    --hz-border-strong: #cfd4df;
    --hz-text: #111827;
    --hz-text-2: #374151;
    --hz-muted: #6b7280;
    --hz-axis: #c3c8d2;
    --hz-primary: #4f46e5;
    --hz-primary-rgb: 79, 70, 229;
    --hz-primary-hover: #4338ca;
    --hz-primary-text: #4338ca;
    --hz-primary-soft: rgba(79, 70, 229, .09);
    --hz-ring: rgba(79, 70, 229, .22);
    --hz-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --hz-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
    --hz-glass: rgba(255, 255, 255, .86);
    --hz-gradient: linear-gradient(150deg, #6366f1 0%, #a855f7 50%, #f97316 100%);
}

:root[data-bs-theme=dark] {
    --hz-bg: #0e1015;
    --hz-surface: #171a21;
    --hz-surface-2: #1f232c;
    --hz-border: #2a2f3a;
    --hz-border-strong: #3a404d;
    --hz-text: #e7e9ee;
    --hz-text-2: #c4c9d4;
    --hz-muted: #969eae;
    --hz-axis: #4a5160;
    --hz-primary: #6366f1;
    --hz-primary-rgb: 99, 102, 241;
    --hz-primary-hover: #7c7ff5;
    --hz-primary-text: #a5b4fc;
    --hz-primary-soft: rgba(129, 140, 248, .14);
    --hz-ring: rgba(129, 140, 248, .35);
    --hz-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --hz-shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6);
    --hz-glass: rgba(23, 26, 33, .86);
}

/* Bootstrap variables mapped to the tokens. */
:root,
:root[data-bs-theme=light],
:root[data-bs-theme=dark] {
    --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-bg: var(--hz-bg);
    --bs-body-color: var(--hz-text);
    --bs-emphasis-color: var(--hz-text);
    --bs-secondary-color: var(--hz-muted);
    --bs-secondary-bg: var(--hz-surface-2);
    --bs-tertiary-bg: var(--hz-surface-2);
    --bs-border-color: var(--hz-border);
    --bs-border-radius: .625rem;
    --bs-border-radius-sm: .5rem;
    --bs-border-radius-lg: .875rem;
    --bs-primary: var(--hz-primary);
    --bs-primary-rgb: var(--hz-primary-rgb);
    --bs-link-color: var(--hz-primary-text);
    --bs-link-color-rgb: var(--hz-primary-rgb);
    --bs-link-hover-color: var(--hz-primary-hover);
    --bs-heading-color: var(--hz-text);
    --bs-focus-ring-color: var(--hz-ring);
}

:root[data-bs-theme=dark] { --bs-link-color-rgb: 165, 180, 252; }

html, body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--hz-bg);
    color: var(--hz-text);
    font-feature-settings: "cv11", "ss01";
}

a { text-underline-offset: .2em; text-decoration-thickness: 1px; }

h1, .h1 { font-size: clamp(1.5rem, 1.25rem + .9vw, 1.875rem); font-weight: 700; letter-spacing: -.022em; }
h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; letter-spacing: -.01em; }
h1:focus { outline: none; }

code { color: var(--hz-primary-text); }
pre { background: var(--hz-surface-2); border: 1px solid var(--hz-border); border-radius: var(--bs-border-radius); padding: .6rem .8rem; }
pre code { color: inherit; }

.text-muted { color: var(--hz-muted) !important; }
.font-monospace { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- App shell: sidebar on wide screens, top bar + bottom tabs on phones ---------- */

.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; }
.content { max-width: 1200px; margin: 0 auto; padding: 2rem 2.5rem 3.5rem; }

.sidebar {
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--hz-surface);
    border-right: 1px solid var(--hz-border);
    z-index: 1030;
}

.sidebar-head {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .75rem 0 1.25rem;
}

.sidebar-head-actions { display: flex; gap: .25rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--hz-text);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -.02em;
    text-decoration: none;
}
.brand:hover { color: var(--hz-text); }

/* A sun on the horizon. */
.brand-mark {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--hz-gradient);
    box-shadow: 0 2px 6px rgba(99, 102, 241, .35);
    overflow: hidden;
}
.brand-mark::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: #fff;
    opacity: .95;
}
.brand-mark::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 9px;
    background: rgba(17, 24, 39, .28);
    border-top: 2px solid #fff;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hz-muted);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--hz-surface-2); color: var(--hz-text); }

[data-bs-theme=dark] .theme-icon-dark,
[data-bs-theme=light] .theme-icon-light { display: none; }

.nav-toggle, .nav-toggle-btn { display: none; }
.nav-toggle-btn .when-open { display: none; }
.sidebar:has(.nav-toggle:checked) .nav-toggle-btn .when-open { display: block; }
.sidebar:has(.nav-toggle:checked) .nav-toggle-btn .when-closed { display: none; }

.side-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .5rem .75rem 1rem;
    overflow-y: auto;
}

.side-section {
    padding: 1.1rem .75rem .4rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hz-muted);
}

.side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hz-text-2);
    font-size: .9375rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.side-link .icon { color: var(--hz-muted); flex-shrink: 0; transition: color .15s; }
.side-link:hover { background: var(--hz-surface-2); color: var(--hz-text); }
.side-link.active { background: var(--hz-primary-soft); color: var(--hz-primary-text); }
.side-link.active .icon { color: var(--hz-primary-text); }

.side-footer {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid var(--hz-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.side-footer form { margin: 0; }
.side-user { min-width: 0; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--hz-gradient);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

.tabbar { display: none; }

@media (max-width: 767.98px) {
    .app-shell { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--hz-border);
        background: var(--hz-glass);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
    }

    .sidebar-head { height: 56px; padding: 0 .5rem 0 1rem; }
    .nav-toggle-btn { display: inline-flex; }

    .side-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 56px);
        background: var(--hz-surface);
        border-bottom: 1px solid var(--hz-border);
        box-shadow: var(--hz-shadow-lg);
    }
    .nav-toggle:checked ~ .side-nav { display: flex; }

    .content { padding: 1.25rem 1rem calc(96px + env(safe-area-inset-bottom)); }

    .tabbar {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: var(--hz-glass);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--hz-border);
    }

    .tabbar-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 4px 0;
        color: var(--hz-muted);
        font-size: .6875rem;
        font-weight: 500;
        text-decoration: none;
    }
    .tabbar-link.active { color: var(--hz-primary-text); }

    .tabbar-new {
        display: grid;
        place-items: center;
        width: 50px;
        height: 50px;
        margin: 0 .25rem;
        border-radius: 16px;
        background: var(--hz-gradient);
        color: #fff;
        box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .55);
    }
    .tabbar-new:hover { color: #fff; }
}

/* ---------- Page header ---------- */

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }
.page-lead { color: var(--hz-muted); margin-top: -.75rem; margin-bottom: 1.5rem; max-width: 46rem; }

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

.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-border-radius: .625rem;
    --bs-btn-focus-box-shadow: 0 0 0 .25rem var(--hz-ring);
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .3rem; --bs-btn-border-radius: .5rem; --bs-btn-font-size: .8125rem; }

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--hz-primary);
    --bs-btn-border-color: var(--hz-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--hz-primary-hover);
    --bs-btn-hover-border-color: var(--hz-primary-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--hz-primary-hover);
    --bs-btn-active-border-color: var(--hz-primary-hover);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--hz-primary);
    --bs-btn-disabled-border-color: var(--hz-primary);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-outline-primary {
    --bs-btn-color: var(--hz-primary-text);
    --bs-btn-bg: var(--hz-surface);
    --bs-btn-border-color: var(--hz-border-strong);
    --bs-btn-hover-color: var(--hz-primary-text);
    --bs-btn-hover-bg: var(--hz-primary-soft);
    --bs-btn-hover-border-color: var(--hz-primary);
    --bs-btn-active-color: var(--hz-primary-text);
    --bs-btn-active-bg: var(--hz-primary-soft);
    --bs-btn-active-border-color: var(--hz-primary);
    --bs-btn-disabled-color: var(--hz-primary-text);
    --bs-btn-disabled-bg: var(--hz-surface);
    --bs-btn-disabled-border-color: var(--hz-border);
}

.btn-outline-secondary {
    --bs-btn-color: var(--hz-text-2);
    --bs-btn-bg: var(--hz-surface);
    --bs-btn-border-color: var(--hz-border-strong);
    --bs-btn-hover-color: var(--hz-text);
    --bs-btn-hover-bg: var(--hz-surface-2);
    --bs-btn-hover-border-color: var(--hz-border-strong);
    --bs-btn-active-color: var(--hz-text);
    --bs-btn-active-bg: var(--hz-surface-2);
    --bs-btn-active-border-color: var(--hz-border-strong);
    --bs-btn-disabled-color: var(--hz-muted);
    --bs-btn-disabled-bg: var(--hz-surface);
    --bs-btn-disabled-border-color: var(--hz-border);
}

.btn-outline-danger, .btn-outline-success, .btn-outline-warning, .btn-outline-info { --bs-btn-bg: var(--hz-surface); }

/* Button groups of filters (btn-secondary = chosen) become segmented controls. */
.btn-group:has(> .btn-outline-secondary, > .btn-secondary) {
    gap: 2px;
    padding: 3px;
    border-radius: .7rem;
    background: var(--hz-surface-2);
    border: 1px solid var(--hz-border);
}
.btn-group > .btn.btn-outline-secondary,
.btn-group > .btn.btn-secondary {
    border: 0;
    border-radius: .5rem !important;
    margin: 0 !important;
    white-space: nowrap;
    box-shadow: none;
}
.btn-group > .btn.btn-outline-secondary { --bs-btn-bg: transparent; --bs-btn-color: var(--hz-muted); --bs-btn-hover-bg: rgba(127, 127, 127, .08); }
.btn-group > .btn.btn-secondary {
    --bs-btn-bg: var(--hz-surface);
    --bs-btn-color: var(--hz-text);
    --bs-btn-hover-bg: var(--hz-surface);
    --bs-btn-hover-color: var(--hz-text);
    --bs-btn-active-bg: var(--hz-surface);
    --bs-btn-active-color: var(--hz-text);
    box-shadow: var(--hz-shadow-sm);
}
[data-bs-theme=dark] .btn-group > .btn.btn-secondary { --bs-btn-bg: var(--hz-border-strong); --bs-btn-hover-bg: var(--hz-border-strong); --bs-btn-active-bg: var(--hz-border-strong); }

/* A long row of filters scrolls sideways on a phone instead of wrapping into a block. */
@media (max-width: 767.98px) {
    .btn-group.flex-wrap { flex-wrap: nowrap !important; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .btn-group.flex-wrap::-webkit-scrollbar { display: none; }
}

/* ---------- Surfaces: cards, tables, lists ---------- */

.card {
    --bs-card-bg: var(--hz-surface);
    --bs-card-border-color: var(--hz-border);
    --bs-card-border-radius: var(--bs-border-radius-lg);
    --bs-card-inner-border-radius: calc(var(--bs-border-radius-lg) - 1px);
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.1rem;
    --bs-card-cap-bg: transparent;
    box-shadow: var(--hz-shadow-sm);
}
.card-title { font-weight: 600; }

.stat-tile {
    height: 100%;
    padding: .9rem 1.1rem;
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--hz-shadow-sm);
}
.stat-tile .stat-label { font-size: .8125rem; color: var(--hz-muted); font-weight: 500; }
.stat-tile .stat-value { font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--hz-text);
    --bs-table-border-color: var(--hz-border);
    --bs-table-hover-bg: var(--hz-surface-2);
    --bs-table-hover-color: var(--hz-text);
}
.table > :not(caption) > * > * { padding: .7rem .85rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .75rem; }
.table > thead > tr > th {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--hz-muted);
    white-space: nowrap;
    background: var(--hz-surface-2);
}
.table > tbody > tr:last-child > *, .table > tfoot > tr:last-child > * { border-bottom: 0; }
.table > tfoot > tr > * { font-weight: 600; }
.table a:not(.btn) { color: var(--hz-text); font-weight: 500; text-decoration: none; }
.table a:not(.btn):hover { color: var(--hz-primary-text); text-decoration: underline; }

/* Every table in a .table-responsive wrapper sits on a card. */
.table-responsive {
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--hz-shadow-sm);
    margin-bottom: 1rem;
}
.table-responsive > .table { margin-bottom: 0; }
.table-responsive > .table > thead > tr:first-child > th:first-child { border-top-left-radius: calc(var(--bs-border-radius-lg) - 1px); }
.table-responsive > .table > thead > tr:first-child > th:last-child { border-top-right-radius: calc(var(--bs-border-radius-lg) - 1px); }

.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: .5rem; background: var(--hz-surface-2); }
.thumb-sm { width: 40px; height: 40px; }
.thumb-empty { display: inline-block; width: 48px; height: 48px; border-radius: .5rem; background: var(--hz-surface-2); border: 1px dashed var(--hz-border-strong); }

.list-group {
    --bs-list-group-bg: var(--hz-surface);
    --bs-list-group-border-color: var(--hz-border);
    --bs-list-group-border-radius: var(--bs-border-radius-lg);
    --bs-list-group-item-padding-x: 1rem;
    --bs-list-group-item-padding-y: .75rem;
    --bs-list-group-color: var(--hz-text);
    box-shadow: var(--hz-shadow-sm);
}
.list-group a:not(.btn) { color: var(--hz-text); font-weight: 500; text-decoration: none; }
.list-group a:not(.btn):hover { color: var(--hz-primary-text); }

.alert { --bs-alert-border-radius: var(--bs-border-radius-lg); --bs-alert-padding-x: 1.1rem; }

details > summary { cursor: pointer; font-weight: 500; }

/* ---------- Badges ---------- */

.badge { font-weight: 600; border-radius: 999px; padding: .32em .7em; letter-spacing: .01em; }

.state-badge {
    --c: #64748b;
    display: inline-flex;
    align-items: center;
    gap: .4em;
    padding: .3em .7em;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
}
.state-badge::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
.state-draft, .state-deleted { --c: #64748b; }
.state-ready { --c: #0d9488; }
.state-scheduled, .state-publishing { --c: #0284c7; }
.state-listed { --c: #4f46e5; }
.state-failed { --c: #dc2626; }
.state-sold { --c: #059669; }
[data-bs-theme=dark] .state-draft, [data-bs-theme=dark] .state-deleted { --c: #a3adbd; }
[data-bs-theme=dark] .state-ready { --c: #2dd4bf; }
[data-bs-theme=dark] .state-scheduled, [data-bs-theme=dark] .state-publishing { --c: #38bdf8; }
[data-bs-theme=dark] .state-listed { --c: #a5b4fc; }
[data-bs-theme=dark] .state-failed { --c: #f87171; }
[data-bs-theme=dark] .state-sold { --c: #34d399; }
/* Live too long: worth removing from Vinted (see the delist setting). */
.state-delist { --c: #b45309; }
[data-bs-theme=dark] .state-delist { --c: #fbbf24; }
.btn-delist {
    --c: #b45309;
    --bs-btn-color: var(--c); --bs-btn-border-color: color-mix(in srgb, var(--c) 45%, transparent); --bs-btn-bg: var(--hz-surface);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--c); --bs-btn-hover-border-color: var(--c);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--c); --bs-btn-active-border-color: var(--c);
}
[data-bs-theme=dark] .btn-delist { --c: #d97706; }
.location-chip { font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */

.form-label { font-weight: 500; font-size: .875rem; color: var(--hz-text-2); margin-bottom: .35rem; }

.form-control, .form-select {
    background-color: var(--hz-surface);
    border-color: var(--hz-border-strong);
    color: var(--hz-text);
    border-radius: .625rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control-sm, .form-select-sm { border-radius: .5rem; padding-top: .3rem; padding-bottom: .3rem; }
.form-control:focus, .form-select:focus {
    background-color: var(--hz-surface);
    color: var(--hz-text);
    border-color: var(--hz-primary);
    box-shadow: 0 0 0 .25rem var(--hz-ring);
}
.form-control:disabled, .form-select:disabled, fieldset:disabled .form-control, fieldset:disabled .form-select { background-color: var(--hz-surface-2); }
.form-control::placeholder { color: var(--hz-muted); opacity: .8; }

.form-check-input { border-color: var(--hz-border-strong); background-color: var(--hz-surface); }
.form-check-input:checked { background-color: var(--hz-primary); border-color: var(--hz-primary); }
.form-check-input:focus { border-color: var(--hz-primary); box-shadow: 0 0 0 .25rem var(--hz-ring); }

.input-group-text { background: var(--hz-surface-2); border-color: var(--hz-border-strong); color: var(--hz-muted); }

.search-input {
    padding-left: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: .8rem center;
}

.valid.modified:not([type=checkbox]) { outline: 1px solid #22a060; }
.invalid { outline: 1px solid #e5484d; }
.validation-message { color: #e5484d; font-size: .875rem; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Home ---------- */

.home-hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 1.1rem;
    background: var(--hz-gradient);
    color: #fff;
    box-shadow: 0 10px 30px -12px rgba(99, 102, 241, .6);
}
.home-hero h1 { color: #fff; margin-bottom: .35rem; }
.home-hero p { margin: 0; opacity: .9; max-width: 36rem; }
.home-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -120px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.quick-link {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--hz-shadow-sm);
    color: var(--hz-text);
    text-decoration: none;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quick-link:hover { color: var(--hz-text); border-color: var(--hz-primary); transform: translateY(-1px); box-shadow: var(--hz-shadow-lg); }
.quick-link .ql-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--hz-primary-soft); color: var(--hz-primary-text); }
.quick-link .ql-title { font-weight: 600; }
.quick-link .ql-text { font-size: .8125rem; color: var(--hz-muted); }

/* ---------- Blazor ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8db;
    color: #3b2f00;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


@media print {
    body { background: #fff; color: #000; }
}

/* A form on a card. */
.form-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--hz-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--hz-shadow-sm);
}
@media (max-width: 767.98px) { .form-card { padding: 1rem; } }

/* A neutral badge, e.g. a label code or a chosen category. */
.badge-soft { background: var(--hz-surface-2); color: var(--hz-text-2); border: 1px solid var(--hz-border); }

.nav-pills { --bs-nav-pills-link-active-bg: var(--hz-primary); --bs-nav-pills-border-radius: .625rem; }

/* ---------- What's new ---------- */

.version-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem; border-radius: 999px;
    background: var(--hz-primary-soft); color: var(--hz-primary-text);
    font-weight: 600; font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.version-build { font-weight: 500; opacity: .8; font-family: var(--bs-font-monospace); font-size: .8125rem; }

.changelog { list-style: none; margin: 0; padding: 0 0 0 1.25rem; max-width: 46rem; position: relative; }
.changelog::before {
    content: ""; position: absolute; left: .3rem; top: .75rem; bottom: .75rem;
    width: 2px; background: var(--hz-border); border-radius: 1px;
}
.release {
    position: relative; margin-bottom: 1rem; padding: 1.1rem 1.25rem;
    background: var(--hz-surface); border: 1px solid var(--hz-border);
    border-radius: var(--bs-border-radius-lg); box-shadow: var(--hz-shadow-sm);
}
.release::before {
    content: ""; position: absolute; left: calc(-1.25rem + .3rem - 4px); top: 1.45rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--hz-surface); border: 2px solid var(--hz-border-strong);
}
.release-current { border-color: color-mix(in srgb, var(--hz-primary) 40%, var(--hz-border)); }
.release-current::before { background: var(--hz-primary); border-color: var(--hz-primary); box-shadow: 0 0 0 4px var(--hz-ring); }
.release-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; }
.release-version { margin: 0; font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.release-date { margin-left: auto; color: var(--hz-muted); font-size: .8125rem; white-space: nowrap; }
.release-summary { margin: .35rem 0 0; color: var(--hz-text-2); }
.release-section { margin-top: .85rem; }
.release-section ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.release-section li { margin-bottom: .25rem; }
.release-section li::marker { color: var(--hz-muted); }

.change-kind {
    --c: #64748b;
    display: inline-block; padding: .15em .6em; border-radius: 6px;
    font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
}
.kind-new { --c: #4f46e5; }
.kind-improved { --c: #0284c7; }
.kind-fixed { --c: #059669; }
[data-bs-theme=dark] .kind-new { --c: #a5b4fc; }
[data-bs-theme=dark] .kind-improved { --c: #38bdf8; }
[data-bs-theme=dark] .kind-fixed { --c: #34d399; }
[data-bs-theme=dark] .kind-other { --c: #a3adbd; }

@media (max-width: 767.98px) {
    .changelog { padding-left: 0; }
    .changelog::before, .release::before { display: none; }
    .release { padding: 1rem; }
    .release-date { margin-left: 0; width: 100%; order: 3; }
}

/* The version line in the sidebar. */
.side-version { padding: .25rem .75rem 0; font-size: .75rem; color: var(--hz-muted); text-decoration: none; font-variant-numeric: tabular-nums; }
.side-version:hover { color: var(--hz-primary-text); }

/* ---------- Photo viewer (lightbox.js) ---------- */
[data-lightbox] { cursor: zoom-in; }
[data-lightbox]:focus-visible { outline: 2px solid var(--hz-primary); outline-offset: 2px; }
html.lightbox-open, html.lightbox-open body { overflow: hidden; }

.lightbox {
    position: fixed; inset: 0; z-index: 1090;
    display: flex; align-items: center; justify-content: center;
    padding: calc(3.5rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: rgba(8, 10, 14, .9);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    touch-action: pan-y pinch-zoom;
    animation: lightbox-in .15s ease-out;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }

.lightbox-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--hz-shadow-lg); background: var(--hz-surface-2);
    user-select: none; -webkit-user-drag: none;
}
.lightbox-bar {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(.5rem + env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left));
}
.lightbox-counter { color: #fff; font-variant-numeric: tabular-nums; font-weight: 500; opacity: .85; }
.lightbox-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; border-radius: 999px;
    color: var(--hz-text); background: var(--hz-glass);
    border: 1px solid var(--hz-border); box-shadow: var(--hz-shadow-sm);
}
.lightbox-btn:hover { color: var(--hz-primary-text); border-color: var(--hz-border-strong); }
.lightbox-btn:focus-visible { outline: none; box-shadow: 0 0 0 .25rem var(--hz-ring); }
.lightbox-btn[hidden] { display: none; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: max(1rem, env(safe-area-inset-left)); }
.lightbox-next { right: max(1rem, env(safe-area-inset-right)); }
/* Phones: swipe to move, so the arrows sit at the bottom out of the photo's way. */
@media (max-width: 767.98px) {
    .lightbox { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
    .lightbox-nav { top: auto; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: none; }
    .lightbox-prev { left: calc(50% - 3.25rem); }
    .lightbox-next { right: calc(50% - 3.25rem); }
}

/* Who did an activity entry: long emails are cut short; the full one shows on hover. */
.activity-by { display: inline-block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--hz-text); }
@media (max-width: 767.98px) { .activity-meta .activity-by { max-width: 11rem; } }

/* ---------- Scan a label (scan.js) ---------- */

.scanner {
    position: relative;
    max-width: 32rem;
    aspect-ratio: 4 / 3;
    margin-bottom: 1.25rem;
    overflow: hidden;
    border-radius: var(--bs-border-radius-lg);
    background: #0b0b12;
    box-shadow: var(--hz-shadow-sm);
}
.scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-aim {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 30%;
    bottom: 30%;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 12px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
    pointer-events: none;
}
.scanner-aim::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    height: 2px;
    background: #f43f5e;
    opacity: 0;
}
.scanner.is-live .scanner-aim::after { opacity: .85; animation: scanner-line 1.6s ease-in-out infinite; }
@keyframes scanner-line { 0%, 100% { transform: translateY(-1.6rem); } 50% { transform: translateY(1.6rem); } }
@media (prefers-reduced-motion: reduce) { .scanner.is-live .scanner-aim::after { animation: none; } }
.scanner-message {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    color: #fff;
    font-size: .875rem;
    text-align: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.scanner.is-live .scanner-message { display: none; }
.scan-type { max-width: 32rem; }

@media (max-width: 767.98px) {
    .scanner { aspect-ratio: 1 / 1; max-width: none; }
    .scanner-aim { top: 34%; bottom: 34%; left: 6%; right: 6%; }
    .tabbar-new { width: 46px; height: 46px; margin: 0 .125rem; }
}
