/* ── Inter — self-hosted (body + display) ────────────────────────────────── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-700.woff2') format('woff2');
}

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
    /* Backgrounds — dark with subtle purple warmth, drawn from the shield */
    --hi-bg:          #0d0b10;
    --hi-surface:     #141118;
    --hi-surface-2:   #1c1825;
    --hi-surface-3:   #241f2e;
    --hi-border:      rgba(201, 162, 39, 0.11);
    --hi-border-med:  rgba(201, 162, 39, 0.22);

    /* Gold — shield border colour */
    --hi-accent:      #c9a227;
    --hi-accent-dim:  rgba(201, 162, 39, 0.13);
    --hi-accent-hover:#e0bb40;

    /* Purple — heraldic HI letterforms */
    --hi-purple:      #7d3fa0;
    --hi-purple-dim:  rgba(125, 63, 160, 0.12);
    --hi-purple-hover:#9655bc;

    /* Text */
    --hi-text:        #ede9f8;
    --hi-muted:       #a89fc0;

    /* Shape */
    --hi-radius:      6px;

    /* Typography */
    --hi-font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --hi-font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;

    /* Bootstrap variable overrides */
    --bs-body-bg:                    var(--hi-bg);
    --bs-body-color:                 var(--hi-text);
    --bs-secondary-color:            var(--hi-muted);
    --bs-border-color:               var(--hi-border);
    --bs-border-color-translucent:   var(--hi-border);
    --bs-card-bg:                    var(--hi-surface);
    --bs-card-border-color:          var(--hi-border);
    --bs-card-cap-bg:                var(--hi-surface-2);
    --bs-link-color:                 var(--hi-accent);
    --bs-link-hover-color:           var(--hi-accent-hover);
    --bs-table-color:                var(--hi-text);
    --bs-table-bg:                   transparent;
    --bs-table-border-color:         var(--hi-border);
    --bs-table-striped-bg:           rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg:             rgba(201, 162, 39, 0.05);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html, body {
    font-family: var(--hi-font-body);
    background-color: var(--hi-bg);
    color: var(--hi-text);
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient atmosphere — purple and gold glows pinned to viewport corners */
body {
    background-image:
        radial-gradient(ellipse 60% 45% at 10% 5%,  rgba(125, 63, 160, 0.08) 0%, transparent 100%),
        radial-gradient(ellipse 55% 40% at 92% 95%, rgba(201, 162, 39, 0.06)  0%, transparent 100%);
    background-attachment: fixed;
}

a { color: var(--hi-accent); text-decoration: none; }
a:hover { color: var(--hi-accent-hover); text-decoration: underline; }

/* Never underline anything inside the navbar */
.navbar a, .navbar a:hover, .navbar a:focus { text-decoration: none; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--hi-font-display);
    letter-spacing: 0.03em;
}

h1 {
    color: var(--hi-accent);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
h1:focus { outline: none; }
h2, h3 { font-size: 1.4rem; }
h4, h5  { font-size: 1.05rem; }
h2, h3, h4, h5, h6 { color: var(--hi-text); }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.site-navbar {
    background: linear-gradient(180deg, #0a0810 0%, #0d0b12 100%) !important;
    border-bottom: none;
    min-height: 56px;
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
}

/* Decorative heraldic divider line — purple › gold › purple */
.site-navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent                    0%,
        rgba(125, 63, 160, 0.45)      15%,
        rgba(201, 162, 39, 0.70)      50%,
        rgba(125, 63, 160, 0.45)      85%,
        transparent                  100%
    );
}

.site-navbar .navbar-brand {
    color: var(--hi-accent) !important;
    font-family: var(--hi-font-display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.site-navbar .navbar-brand:hover {
    color: var(--hi-accent-hover) !important;
    text-decoration: none;
}

.site-navbar .nav-link {
    font-family: var(--hi-font-display);
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hi-muted) !important;
    padding-top: 1.125rem !important;
    padding-bottom: 1.125rem !important;
    transition: color 0.15s ease;
}
.site-navbar .nav-link:hover {
    color: var(--hi-text) !important;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { border-radius: calc(var(--hi-radius) - 2px); font-weight: 500; }

.btn-primary {
    background-color: var(--hi-accent);
    border-color: var(--hi-accent);
    color: #0d0b10;
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus-visible {
    background-color: var(--hi-accent-hover);
    border-color: var(--hi-accent-hover);
    color: #0d0b10;
    box-shadow: 0 0 0 0.2rem var(--hi-accent-dim);
}
.btn-primary:active {
    background-color: #b89020;
    border-color: #b89020;
    color: #0d0b10;
}

.btn-outline-primary {
    color: var(--hi-accent);
    border-color: var(--hi-accent);
}
.btn-outline-primary:hover {
    background-color: var(--hi-accent-dim);
    color: var(--hi-accent);
    border-color: var(--hi-accent);
}

.btn-success {
    background-color: #1a6640;
    border-color: #1a6640;
    color: #d4f5e4;
}
.btn-success:hover {
    background-color: #1f7a4c;
    border-color: #1f7a4c;
    color: #d4f5e4;
}

.btn-secondary {
    background-color: var(--hi-surface-2);
    border-color: var(--hi-border-med);
    color: var(--hi-text);
}
.btn-secondary:hover {
    background-color: var(--hi-surface-3);
    border-color: var(--hi-border-med);
    color: var(--hi-text);
}

.btn-outline-secondary {
    color: var(--hi-muted);
    border-color: var(--hi-border-med);
}
.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--hi-text);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-outline-light {
    color: var(--hi-muted);
    border-color: var(--hi-border-med);
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--hi-text);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-outline-danger {
    color: #e05252;
    border-color: rgba(224, 82, 82, 0.35);
}
.btn-outline-danger:hover {
    background-color: rgba(224, 82, 82, 0.1);
    color: #e05252;
    border-color: rgba(224, 82, 82, 0.5);
}

.btn-dark {
    background-color: var(--hi-surface-2);
    border-color: var(--hi-border-med);
    color: var(--hi-text);
}
.btn-dark:hover {
    background-color: var(--hi-surface-3);
    border-color: var(--hi-border-med);
    color: var(--hi-text);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem var(--hi-accent-dim);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(158deg, var(--hi-surface) 0%, #16121f 100%);
    border: 1px solid var(--hi-border) !important;
    border-radius: var(--hi-radius) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(201, 162, 39, 0.05);
}
.card-header {
    background-color: rgba(28, 24, 37, 0.9) !important;
    border-bottom: 1px solid var(--hi-border) !important;
    color: var(--hi-text);
    font-family: var(--hi-font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
}
.card-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--hi-border) !important;
}

/* Coloured card borders */
.border-primary { border-color: rgba(201, 162, 39, 0.4) !important; }
.border-success  { border-color: rgba(26, 102, 64, 0.5) !important; }
.border-danger   { border-color: rgba(224, 82, 82, 0.4) !important; }

/* Status helpers */
.bg-success.bg-opacity-10 { background-color: rgba(26, 102, 64, 0.15) !important; }
.text-success { color: #6fcf97 !important; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table {
    color: var(--hi-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(201, 162, 39, 0.05);
    --bs-table-color: var(--hi-text);
    --bs-table-border-color: var(--hi-border);
}
.table > :not(caption) > * > * {
    background-color: var(--bs-table-bg);
    color: var(--hi-text);
    border-bottom-color: var(--hi-border);
}
.table thead > tr > th {
    font-family: var(--hi-font-display);
    color: var(--hi-muted);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-bottom: 1px solid rgba(201, 162, 39, 0.22);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.table-light {
    --bs-table-bg: var(--hi-surface-2);
    background-color: var(--hi-surface-2) !important;
}
.table-light th {
    color: var(--hi-muted) !important;
    background-color: var(--hi-surface-2) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.015);
}
.table-hover > tbody > tr:hover > * {
    background-color: rgba(201, 162, 39, 0.05);
}
.align-middle td, .align-middle th { vertical-align: middle; }

/* Slightly looser table rows */
.table td, .table th { padding: 0.6rem 0.75rem; }
.table-sm td, .table-sm th { padding: 0.4rem 0.65rem; }

/* Prevent detail text from becoming unreadably tiny */
.small, small { font-size: 0.875rem; }

/* Fixed-width slot for the clan rank icon in participant tables, so
   account type badges stay aligned even when the rank is unknown */
.rank-icon-slot {
    display: inline-flex;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    background-color: var(--hi-surface-2);
    border: 1px solid var(--hi-border);
    color: var(--hi-text);
    border-radius: calc(var(--hi-radius) - 2px);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--hi-surface-2);
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow: 0 0 0 0.2rem var(--hi-accent-dim);
    color: var(--hi-text);
}
.form-control::placeholder { color: var(--hi-muted); opacity: 0.6; }
.form-control:disabled,
.form-select:disabled {
    background-color: var(--hi-surface);
    color: var(--hi-muted);
    opacity: 0.5;
}
.form-label {
    font-family: var(--hi-font-display);
    color: var(--hi-muted);
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}
.form-check-input {
    background-color: var(--hi-surface-2);
    border-color: rgba(255, 255, 255, 0.2);
}
.form-check-input:checked {
    background-color: var(--hi-accent);
    border-color: var(--hi-accent);
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--hi-accent-dim);
    border-color: var(--hi-accent);
}
textarea.form-control { resize: vertical; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    font-family: var(--hi-font-display);
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.74em;
    padding: 0.32em 0.6em;
}

.bg-primary   { background-color: var(--hi-accent)    !important; color: #0d0b10           !important; }
.bg-success   { background-color: #1a3d28              !important; color: #6fcf97           !important; }
.bg-danger    { background-color: #3d1a1a              !important; color: #e05252           !important; }
.bg-secondary { background-color: var(--hi-surface-2) !important; color: var(--hi-muted)   !important; border: 1px solid var(--hi-border); }
.bg-dark      { background-color: #0f0c14              !important; color: var(--hi-muted)   !important; }

.bg-warning.text-dark { background-color: rgba(201, 162, 39, 0.18) !important; color: var(--hi-accent) !important; }
.bg-info.text-dark    { background-color: rgba(100, 180, 240, 0.15) !important; color: #64c8f0 !important; }

.text-bg-secondary { background-color: var(--hi-surface-2) !important; color: var(--hi-muted) !important; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--hi-radius); }

.alert-success {
    background-color: rgba(26, 102, 64, 0.16);
    border-color: rgba(26, 102, 64, 0.35);
    color: #6fcf97;
}
.alert-info {
    background-color: var(--hi-accent-dim);
    border-color: rgba(201, 162, 39, 0.28);
    color: var(--hi-accent);
}
.alert-danger {
    background-color: rgba(224, 82, 82, 0.12);
    border-color: rgba(224, 82, 82, 0.3);
    color: #e05252;
}
.alert-warning {
    background-color: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.26);
    color: var(--hi-accent);
}
.alert-dismissible .btn-close { filter: invert(1) opacity(0.5); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.page-link {
    background-color: var(--hi-surface);
    border-color: var(--hi-border);
    color: var(--hi-muted);
    transition: all 0.15s ease;
}
.page-link:hover {
    background-color: var(--hi-surface-2);
    border-color: var(--hi-border-med);
    color: var(--hi-text);
}
.page-item.active .page-link {
    background-color: var(--hi-accent);
    border-color: var(--hi-accent);
    color: #0d0b10;
    font-weight: 600;
}
.page-item.disabled .page-link {
    background-color: var(--hi-surface);
    border-color: var(--hi-border);
    color: var(--hi-muted);
    opacity: 0.4;
}

/* ── Dropdowns ───────────────────────────────────────────────────────────── */
.dropdown-menu {
    background-color: var(--hi-surface);
    border: 1px solid var(--hi-border);
    border-radius: var(--hi-radius);
}
.dropdown-item { color: var(--hi-text); }
.dropdown-item:hover {
    background-color: var(--hi-surface-2);
    color: var(--hi-text);
}
.dropdown-divider { border-top-color: var(--hi-border); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner-border { color: var(--hi-accent); }

/* ── Utility overrides ───────────────────────────────────────────────────── */
.text-muted   { color: var(--hi-muted)   !important; }
.text-warning { color: var(--hi-accent)  !important; }
.bg-light     { background-color: var(--hi-surface-2) !important; color: var(--hi-text) !important; }
.border       { border-color: var(--hi-border) !important; }
.btn-link     { color: var(--hi-accent); }
.btn-link:hover { color: var(--hi-accent-hover); }

/* ── Small button ────────────────────────────────────────────────────────── */
.btn-xs { padding: 0.15rem 0.4rem; font-size: 0.75rem; }

/* ── List groups ─────────────────────────────────────────────────────────── */
.list-group-item {
    background-color: var(--hi-surface);
    border-color: var(--hi-border);
    color: var(--hi-text);
}
.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: var(--hi-surface-2);
    color: var(--hi-text);
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-content {
    background-color: var(--hi-surface);
    border: 1px solid var(--hi-border-med);
    color: var(--hi-text);
}
.modal-header {
    border-bottom-color: var(--hi-border);
}
.modal-header .btn-close {
    filter: invert(1) opacity(0.5);
}
.modal-footer {
    border-top-color: var(--hi-border);
}

/* ── Table-dark thead override ───────────────────────────────────────────── */
.table-dark,
.table-dark th {
    --bs-table-bg: var(--hi-surface-2);
    background-color: var(--hi-surface-2) !important;
    color: var(--hi-muted) !important;
    border-color: var(--hi-border) !important;
}

/* ── Validation ──────────────────────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #1a6640; }
.invalid { outline: 1px solid #e05252; }
.validation-message { color: #e05252; }

/* ── Blazor error boundary ───────────────────────────────────────────────── */
.blazor-error-boundary {
    background: rgba(40, 15, 15, 0.97);
    padding: 1rem 1.25rem;
    color: #e05252;
    border-top: 1px solid rgba(224, 82, 82, 0.3);
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── Form floating placeholders ──────────────────────────────────────────── */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--hi-muted);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Rank Summary Card ──────────────────────────────────────────────────── */
.rank-summary-card {
    background: linear-gradient(135deg, var(--hi-surface) 0%, var(--hi-surface-2) 60%, rgba(201, 162, 39, 0.06) 100%);
    border: 1px solid var(--hi-border-med);
    border-radius: var(--hi-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(201, 162, 39, 0.08);
}
.rank-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.rank-summary-points {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}
.rank-summary-earned {
    font-family: var(--hi-font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--hi-accent);
    line-height: 1;
}
.rank-summary-sep {
    color: var(--hi-muted);
    font-size: 1.25rem;
}
.rank-summary-max {
    color: var(--hi-muted);
    font-size: 1rem;
}
.rank-summary-rank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--hi-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hi-text);
}
/* ── Rank icon pair (a rank and its mod equivalent) ─────────────────────── */
.rank-icon-pair {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.rank-icon-pair-primary,
.rank-icon-pair-secondary {
    object-fit: contain;
}
/* The ladder the viewer isn't on — present for comparison, not competing. */
.rank-icon-pair-secondary {
    opacity: 0.5;
}

/* ── Rank Progress Bar ──────────────────────────────────────────────────── */
.rank-progress-section {
    margin-bottom: 1rem;
}
.rank-progress-bar {
    height: 8px;
    background: var(--hi-surface-3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.rank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hi-purple) 0%, var(--hi-accent) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.rank-progress-label {
    font-size: 0.82rem;
    color: var(--hi-muted);
}

/* ── Category Point Pills ───────────────────────────────────────────────── */
.rank-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rank-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--hi-border);
    background: var(--hi-surface-2);
    color: var(--hi-muted);
    white-space: nowrap;
}
.rank-cat-pill.pts-maxed {
    border-color: rgba(111, 207, 151, 0.4);
    color: #6fcf97;
}
.rank-cat-pill.pts-partial {
    border-color: rgba(201, 162, 39, 0.4);
    color: var(--hi-accent);
}
.rank-cat-pill-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}
.rank-cat-pill-pts {
    font-weight: 600;
}

/* ── Rank Badges Row ───────────────────────────────────────────────────── */
.rank-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hi-border);
}
.rank-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--hi-radius);
    border: 1px solid var(--hi-border);
    background: var(--hi-surface);
    opacity: 0.4;
    min-width: 72px;
    text-align: center;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
.rank-badge.achieved {
    opacity: 1;
    border-color: var(--hi-border-med);
}
.rank-badge.current {
    opacity: 1;
    border-color: var(--hi-accent);
    background: linear-gradient(135deg, var(--hi-surface-2) 0%, rgba(201, 162, 39, 0.08) 100%);
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.15);
}
.rank-badge .badge-name {
    font-family: var(--hi-font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--hi-text);
    white-space: nowrap;
}
.rank-badge .badge-pts {
    font-size: 0.65rem;
    color: var(--hi-muted);
}
.rank-badge .badge-evt {
    font-size: 0.6rem;
    color: var(--hi-purple);
    font-weight: 600;
}

/* ── Section Headings ───────────────────────────────────────────────────── */
.hi-section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    color: var(--hi-accent);
}
.hi-section-heading h2 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--hi-accent);
}
.hi-section-helper {
    font-size: 0.82rem;
    color: var(--hi-muted);
    margin-bottom: 0.75rem;
}

/* ── Accordion ──────────────────────────────────────────────────────────── */
.hi-accordion {
    border: 1px solid var(--hi-border);
    border-radius: var(--hi-radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.hi-accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    background: var(--hi-surface-2);
    color: var(--hi-text);
    cursor: pointer;
    font-family: var(--hi-font-display);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: left;
    transition: background-color 0.15s ease;
}
.hi-accordion-header:hover {
    background: var(--hi-surface-3);
}
.hi-accordion-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.hi-accordion-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}
.hi-accordion-chevron {
    flex-shrink: 0;
    color: var(--hi-muted);
    transition: transform 0.2s ease;
}
.hi-accordion-header.expanded .hi-accordion-chevron {
    transform: rotate(180deg);
}
.hi-accordion-body {
    padding: 0;
    background: var(--hi-surface);
}

/* ── Achievement Rows ───────────────────────────────────────────────────── */
.hi-ach-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    min-height: 2.75rem;
    border-bottom: 1px solid var(--hi-border);
}
.hi-ach-row .form-check {
    margin-bottom: 0;
}
.hi-ach-row:last-child {
    border-bottom: none;
}
.hi-ach-control {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}
.hi-ach-label {
    font-size: 0.88rem;
    color: var(--hi-text);
    white-space: nowrap;
    margin: 0;
}
.hi-ach-auto {
    opacity: 0.65;
}
.hi-auto-source {
    color: var(--hi-muted);
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

/* Chips next to an achievement: an optional prominent alert on top of the
   expandable note (e.g. "not saved yet" above the auto-verified event list). */
.hi-note-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
    margin-left: 0.35rem;
}

.hi-note-alert {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border: 1px solid rgba(201, 162, 39, 0.65);
    border-radius: 12px;
    background: rgba(201, 162, 39, 0.1);
    color: var(--hi-accent);
    font-weight: 600;
    line-height: 1.35;
}

/* Expandable note next to an achievement (e.g. auto-verified event list).
   Rendered as a subtle chip so the disclosure arrow reads as its own control
   instead of blending into the adjacent input. */
.hi-note-details {
    min-width: 0;
}
.hi-note-details summary {
    display: inline-block;
    cursor: pointer;
    padding: 0.2rem 0.65rem;
    border: 1px dashed var(--hi-border-med);
    border-radius: 12px;
    line-height: 1.35;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
/* Custom caret — the native marker is dropped by inline-block display */
.hi-note-details summary {
    list-style: none;
}
.hi-note-details summary::-webkit-details-marker {
    display: none;
}
.hi-note-details summary::before {
    content: '▸';
    display: inline-block;
    color: var(--hi-accent);
    margin-right: 0.45rem;
    transition: transform 0.15s ease;
}
.hi-note-details[open] summary::before {
    transform: rotate(90deg);
}
.hi-note-details summary:hover {
    color: var(--hi-text) !important;
    border-color: var(--hi-accent);
    background: rgba(201, 162, 39, 0.06);
}
.hi-note-details[open] summary {
    margin-bottom: 0.25rem;
    border-style: solid;
}
.hi-note-details ul {
    padding-left: 1.6rem;
}

/* ── Point Badges & Indicators ──────────────────────────────────────────── */
.hi-pts-badge {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--hi-surface);
    border: 1px solid var(--hi-border);
    color: var(--hi-muted);
}
.hi-pts-badge.pts-maxed {
    background: rgba(111, 207, 151, 0.1);
    border-color: rgba(111, 207, 151, 0.3);
    color: #6fcf97;
}
.hi-pts-badge.pts-partial {
    background: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.3);
    color: var(--hi-accent);
}
.hi-ach-pts {
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--hi-muted);
}
.hi-ach-pts.pts-maxed {
    color: #6fcf97;
}
.hi-ach-pts.pts-partial {
    color: var(--hi-accent);
}
