:root {
    /* Samlet lys grågrøn palet (B1-retningen) */
    --bg: #F5F6F2;             /* rolig grågrøn sidebaggrund */
    --bg-2: #F5F6F2;
    --panel: #FFFFFF;          /* hvide kort */
    --panel-2: #f0f2ec;        /* indlejrede felter */
    --panel-3: #e4e8dd;        /* hover / betoning */
    --text: #2D3329;           /* mørk grågrøn tekst */
    --muted: #67705F;          /* afdæmpet grågrøn */
    --accent: #4A5240;         /* mørk oliven — primær handling */
    --accent-hover: #5b6450;
    --accent-contrast: #ffffff;
    --accent-2: #8a927e;
    --accent-2-contrast: #2D3329;
    --accent-3: #ffc857;       /* gul — uafgjort/advarsel */
    --danger: #a12731;
    --danger-contrast: #ffffff;
    --border: #DFE4D9;         /* tynd grågrøn kant */
    --border-strong: #c9d1c0;
    --warning: #ffb627;
    --chip-text: #2D3329;
    --chip-bg: #E9EFE4;
    --chip-bg-hover: #dde5d4;
    --shadow-soft: 0 4px 14px rgba(45, 51, 41, 0.05);
    --shadow-card: 0 6px 18px rgba(45, 51, 41, 0.06);
    --shadow-pop: 0 14px 32px rgba(45, 51, 41, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #e9e9e9;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.prefill-panel {
    margin-top: 24px;
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: 0 24px 24px;
}

.courts {
    display: flex;
    gap: 10px;
}

.court-count {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.court-count input[type="number"] {
    width: 4rem;
    flex-shrink: 0;
}

button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.app-header {
    display: grid;
    grid-template-columns: 1fr auto;   /* title takes remaining, controls take what they need */
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.app-header, .grid {
    max-width: 800px;
    margin: 0 auto 20px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    -webkit-background-clip: text;
    background-clip: text;
}

.header-menu {
    position: relative;
}

.menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(45, 49, 66, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: backdropIn 0.15s ease;
}

@keyframes backdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.menu-backdrop.open {
    display: block;
}

.menu-toggle {
    min-width: 52px;
    font-size: 22px;
    line-height: 1;
    padding: 10px 18px;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    display: none;
    z-index: 100;
    transform-origin: top right;
    animation: menuOpen 0.15s ease;
}

@keyframes menuOpen {
    from { opacity: 0; transform: scale(0.95) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.menu-dropdown.open {
    display: block;
}

.menu-dropdown button.menu-item {
    width: 100%;
    text-align: left;
    margin: 0;
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    padding: 11px 14px;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.12s ease;
}

.menu-dropdown button.menu-item:hover {
    background: var(--panel-2);
    opacity: 1;
}

/* Sektionsskille i menuen (fx mellem dagligt brug og konto/administration) */
.menu-dropdown button.menu-item--section {
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    border-radius: 0;
}

/* Danger item gets a separator on top and a subtle red tint on hover */
.menu-dropdown button.menu-item.danger {
    color: var(--danger);
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    border-radius: 0 0 10px 10px;
}

.mini-table td.center,
.mini-table th.center {
    text-align: center;
}

.h-no-m {
    margin: 0;
}

h1, h2, h3 {
    margin: 0 0 16px;
}

.mb {
    margin-bottom: 16px;
}

.mt {
    margin-top: 16px;
}

.subtle {
    color: var(--muted);
    line-height: 1.5;
}

.small-text {
    font-size: 13px;
}



.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
}

.panel + .panel {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .toast {
        top: 12px;
        right: 12px;
        left: 12px;
        min-width: 0;
        max-width: none;
    }
}

label {
    display: block;
    font-weight: bold;
    margin: 10px 0;
}

.settings-panel label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
}

.settings-panel input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
    margin-top: 5px;
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

input,
button,
select {
    font: inherit;
    height: 46px;
}

input,
button,
select,
textarea {
    font: inherit;
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: var(--panel);
    color: var(--text);
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

/* E-mail og adgangskode læses lettest venstrestillet. */
input[type="email"],
input[type="password"] {
    text-align: left;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}


.settings-row {
    margin-top: 16px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.actions input[type="text"] {
    flex: 1 1 220px;
}

.actions.no-top-margin {
    margin-top: 0;
}

button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    opacity: 1;
}

button:active {
    transform: translateY(1px);
}

.primary {
    background: var(--accent);
    color: var(--accent-contrast);
}

.primary:hover {
    background: var(--accent-hover);
}

.secondary {
    background: #ffffff;
    color: var(--accent-2-contrast);
}

.secondary:hover {
    background: #cfcfcf;
}

.danger {
    background: #891720;
    color: var(--danger-contrast);
}

.danger:hover {
    background: #9f1721;
}

.ghost {
    background: #ffffff;
    color: var(--text);
    border: 1px solid #e4e4e4;
}

.ghost:hover {
    background: #eeeeee;
}

.result-card {
    border-radius: 16px;
    padding: 16px;
    background: #00000000;
    margin-bottom: 14px;
    border-bottom: 1px solid #00000012;
    border-radius: 0;
}

select {
    text-align: center;
    text-align-last: center;
}

select option {
    text-align: left;
}

.court-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: bold;
}


.vs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.vs-grid .flex-center {
    justify-content: center;
}
/* Samme indre padding i begge tilstande, så navne/prikker flugter
   lodret mellem kortene — også når man redigerer. */
.vs-grid .team {
    padding: 8px 10px;
}

.team {
    background: var(--panel);
    border: 1px solid #ffffff;
    border-radius: 14px;
    padding: 14px;
}

.team h4 {
    margin: 0 0 8px 0;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-line {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 6px 0;
}


.tag {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(78, 205, 196, 0.18);
    color: var(--accent-2-contrast);
    font-weight: 600;
}

.bench-list, .history-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.6;
}

.warning {
    color: #8a5a06;
    background: rgba(255, 182, 39, 0.18);
    border: 1px solid rgba(255, 182, 39, 0.45);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
}

.player-manager-form {
    display: grid;
    grid-template-columns: 3fr 2fr;   /* 60/40: navn / niveau */
    gap: 10px;
    align-items: end;
    margin-top: 24px;
    margin-bottom: 24px;
}
.player-manager-form > div {
    min-width: 0;
}
.player-manager-form input,
.player-manager-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.lowered {
    font-size: 10px;
    padding: 0;
    margin: 7px 0 0 -6px;
}

.player-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-direction: row !important;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-contrast);
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 500;
    padding: 7px 12px;
    transition: background 0.15s ease, transform 0.05s ease;
}

.player-chip:hover {
    background: var(--accent-hover);
    cursor: pointer;
}

.player-chip:active {
    transform: translateY(1px);
}


.level {
    font-size: 12px;
}

.player-chip button {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mini-table th,
.mini-table td {
    border-bottom: 1px solid var(--border);
    padding: 8px 6px;
    text-align: left;
    vertical-align: top;
}

.mini-table th {
    color: var(--muted);
    font-weight: bold;
}

.table-subtle {
    color: var(--accent);
    font-size: 12px;
    display: inline;
}

.mt24 {
    margin-top: 24px;
}

#newPlayerLevel {
    width: 100%;
    min-width: 0;
}
#newPlayerName {
    width: 100%;
}

.w100 {
    width: 100%;
}

/* ALLE standalone-paneler (Indstillinger, Slet spillere, Login, Admin osv.)
   er skjult som udgangspunkt. showStandAlone() viser præcis ét ad gangen
   via inline style, som overtrumfer denne regel. Én fælles regel — så kan
   et nyt panel aldrig glemmes i en klasseliste igen. */
.standalone {
    display: none;
}

textarea {
    resize: vertical;
}

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

.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.history-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.history-header h2 {
    margin-bottom: 0;
}

.player-manager-list {
    display: grid;
    gap: 12px;
}

.player-row-name-pref {
    display: flex;
    gap: 16px;
}

.player-row.is-inactive {
    opacity: 0.82;
}

.player-row-main {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    height: 40px;
}

.player-row button {
    font-weight: normal;
}


.icon-toggle-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.player-row-main button {
    width: auto;
}

.player-row-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.player-level-badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(78, 205, 196, 0.16);
    color: var(--accent-2-contrast);
    font-weight: 600;
}

.player-row-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;
    flex-direction: row-reverse;
}


.player-row-settings {
    display: grid;
    gap: 12px;
    width: 100%;
}

.prefill-header {
    width: 100%;
    padding: 0;
}

.prefill-header h3 {
    font-size: 16px;
}

.collapse-indicator {
    margin-left: auto; /* ekstra sikkerhed */
}

.prefill-area {
    display: grid;
}

.prefill-card {
    border: none;
    border-radius: 0;
    padding: 20px 20px;
    padding-bottom: 20px;
    display: flex;
    gap: 14px;
    background: none;
    flex-direction: column;
    margin: 0 -18px;
    border-bottom: 1px solid #00000012;
}

prefill-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-direction: row;
    align-items: center;
}

.prefill-format {
    min-width: 140px;
}

.flex-center {
    display: flex;
    align-items: center;
}


.prefill-grid {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: row;
}

.prefill-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prefill-side {
    display: flex;
    gap: 10px;
    border-radius: 12px;
    width: 100%;
    justify-content: space-between;
    flex-direction: column;
}

.prefill-side label {
    margin: 0;
}

.prefill-side label span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
}

.prefill-vs {
    font-weight: 700;
    color: var(--accent);
}

.compact-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.player-row-inline-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.level-select {
    width: 140px;
    min-width: 130px;
}

.player-row-inline-controls select:not(.level-select) {
    width: 150px;
    min-width: 150px;
}

.player-row-name {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-start;
}


.collapsible-toggle {
    width: 100%;
    display: flex;
    height: 50px;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: left;
    background: transparent;
    color: var(--text);
    padding: 0;
    border: none;
    cursor: pointer;
}


.collapsible-toggle:hover {
    opacity: 1;
}

.collapsible-content {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.collapsed .collapsible-content {
    display: none;
}

.collapse-indicator {
    font-size: 30px;
    line-height: 1;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.collapsible-panel:not(.collapsed) .collapse-indicator {
    transform: rotate(90deg);
}

.panel-toggle {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.player-row button.player-row-name {
    font-weight: 500;
}

.player-row button.player-row-name:hover {
    background: var(--panel-3);
    color: var(--muted);
    font-weight: 500;
}

.player-row.is-active button.player-row-name {
    background-color: var(--accent);
    color: var(--accent-contrast);
    border-color: transparent;
    font-weight: 600;
}

.player-row.is-active button.player-row-name:hover {
    background-color: var(--accent-hover);
}

.prefill-actions {
    display: flex;
}

/* Label for settings sections that aren't checkboxes */
.settings-label {
    margin-bottom: 10px;
    opacity: 0.85;
}

/* Inline grid of format-size checkboxes */
.format-sizes-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 30px;
}

.format-size-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}

.settings-sub-row {
    margin-left: 24px;
}

.settings-sub-row--hidden {
    display: none;
}

/* Dims the level-balance settings when skill levels are turned off */
.settings-group-disabled {
    opacity: 0.38;
    pointer-events: none;
    user-select: none;
}

/* Reveal-level button in the player manager list */
.level-reveal-btn {
    font-size: 13px;
    padding: 3px 10px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s;
}

.level-reveal-btn:hover {
    background: var(--panel-3);
}

/* The level select area that appears after reveal */
.level-reveal-area {
    display: none;
}

.level-reveal-area--open {
    display: block;
}

@media (max-width: 980px) {
    .grid,
    .player-row-main {
        flex-direction: column;
        align-items: stretch;
    }



    /* Bottom sheet on mobile */
    .menu-dropdown {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 20px;
        top: auto;
        min-width: 0;
        border-radius: 20px;
        padding: 10px;
        transform-origin: bottom center;
        animation: menuOpenMobile 0.18s ease;
    }

    @keyframes menuOpenMobile {
        from { opacity: 0; transform: scale(0.97) translateY(12px); }
        to   { opacity: 1; transform: scale(1)   translateY(0); }
    }

    .menu-dropdown button.menu-item {
        padding: 15px 18px;
        font-size: 16px;
        border-radius: 12px;
    }

    .menu-dropdown button.menu-item.danger {
        border-radius: 0 0 12px 12px;
    }

    .panel {
        border: none;
        border-radius: 0;
    }

    .container {
        padding: 0;
    }

    .app-header {
        border: none;
        border-radius: 0;
    }

    /* --- ændret del --- */
    .player-row-main.compact-player-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .player-row-name {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .player-row-inline-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        width: auto;
    }

    .level-select {
        width: 128px !important;
        min-width: 118px !important;
        padding-left: 8px;
        padding-right: 8px;
    }

    .player-row-inline-controls select:not(.level-select) {
        width: 96px !important;
        min-width: 96px !important;
    }


    .app-header, .grid {
        max-width: 100%;
    }
    .app-header {
        margin: 0 auto 20px;
    }

}


.retry-row {
    padding-top: 18px;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

.generate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 250, 243, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.generate-overlay--visible {
    display: flex;
}

.generate-overlay__spinner {
    width: 52px;
    height: 52px;
    border: 5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.generate-overlay__text {
    color: var(--text);
    font-size: 16px;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

/* ----- Edit-mode for the current round ----- */

.result-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-actions .ghost.is-active {
    background: var(--accent);
    color: var(--accent-contrast);
}

.result-slot-select {
    width: 100%;
}

.benched-line {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.benched-edit-area {
    padding: 12px;
    margin-top: 14px;
}

.benched-edit-area > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.benched-edit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ----- Team mode: teams panel ----- */

.team-mode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.teams-area {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.team-card {
    padding: 12px;
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.team-card-total {
    font-size: 12px;
    color: var(--muted);
}

.team-card-members {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-card-member {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    font-size: 14px;
}

/* ----- Team super-player display in result ----- */

.result-team-block {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
    padding: 6px 0;
}

.result-team-block:last-child {
    border-bottom: none;
}

.result-team-name {
    margin-bottom: 6px;
}

.result-team-members {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    padding-left: 4px;
}

.team-member-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    padding: 2px 0;
}

.team-member-line .level {
    color: var(--text);
}

/* Reserves space in edit mode so swapping teams of different sizes doesn't
   jump the layout — the placeholder occupies the same row height as a real
   member line but stays invisible. */
.team-member-line--placeholder {
    visibility: hidden;
    pointer-events: none;
}

/* ----- Session transfer (export/import) ----- */

.session-transfer-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 40px;
}

.session-transfer-section h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.session-transfer-section textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    word-break: break-all;
}

/* ----- Setup Wizard ----- */

@media (max-width: 640px) {
}

@media (max-width: 640px) {





}


/* ============================================================
   Settings v3: mode toggle + rule dropdowns + player view controls
   ============================================================ */

/* Visually hide an input while keeping it accessible. Used for the
   real <input id="teamMode"> behind the segmented buttons. */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Segmented "Skiftende makkere / Faste hold" toggle at the top of settings. */
.settings-row--mode-toggle {
    margin-bottom: 18px;
}
.mode-toggle {
    display: inline-flex;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px;
    background: var(--panel-2, #f7f8f5);
    gap: 0;
}
.mode-toggle__option {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;     /* center the label horizontally */
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-align: center;
}
.mode-toggle__option:hover:not(.mode-toggle__option--active) {
    background: rgba(0, 0, 0, 0.04);
}
.mode-toggle__option--active {
    background: var(--accent, #4A5240);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* "Regler" section. */
.settings-section {
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 14px;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text);
    letter-spacing: 0.01em;
}

/* Each rule row: label on the left, select on the right. */
.settings-rule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.settings-rule-row > label {
    flex: 1 1 200px;
    font-weight: 500;
}
.rule-select {
    flex: 1 1 230px;
    box-sizing: border-box;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    line-height: 1.2;
    padding: 0 30px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel, #ffffff);
    color: var(--text);
    font-size: 15px;
    text-align: left;
    text-align-last: left;
    cursor: pointer;
}
.rule-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
/* Same treatment for the sort dropdown in the Spillere header. */
.sort-select {
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    line-height: 1.2;
    text-align: left;
    text-align-last: left;
}
.rule-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}
.rule-toggle-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}
.rule-hint {
    flex: 1 1 100%;
    font-size: 13px;
    color: var(--muted, #666);
    background: var(--panel-2, #f7f8f5);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 2px;
}

/* "Spillere" header actions row: sort select + global eye + add player. */
.player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sort-select {
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel, #ffffff);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}
.sort-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Generic small square icon-only button. */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* Global "show all levels" toggle (eye). aria-pressed=true means levels
   are visible; aria-pressed=false (i.e. --off class) means hidden. */
/* Eye inside the player chip (when a player's level is hidden). */
/* Mobile layout: stack rule rows so the dropdown sits below the label. */
@media (max-width: 640px) {
    .settings-rule-row {
        flex-direction: column;
        align-items: stretch;
    }
    .settings-rule-row > label {
        flex: 0 0 auto;
    }
    .rule-select, .sort-select {
        width: 100%;
    }
    .player-actions {
        gap: 6px;
    }
}


/* Bigger menu for the gear menu, to fit the sort sub-items + delete. */
.actions-dropdown {
    min-width: 270px;
}

/* Section header inside a menu dropdown ("Sortér spillere"). */
.menu-section {
    margin: 6px 0;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.menu-section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted, #777);
    padding: 6px 14px 4px;
}

/* Radio-style menu items with a marker on the left. */
.menu-radio .menu-radio-marker {
    display: inline-block;
    width: 18px;
    text-align: center;
    color: transparent;
    font-size: 12px;
    flex: 0 0 18px;
}
.menu-radio--active .menu-radio-marker {
    color: var(--accent, #4A5240);
}
.menu-radio--active {
    background: rgba(0, 0, 0, 0.04);
}

/* Eye icon with optional "slash" overlay so users can see at a glance
   whether the menu item will hide or show levels. */
.eye-icon {
    display: inline-block;
    position: relative;
    line-height: 1;
    font-size: 17px;
}
.eye-icon--off {
    opacity: 0.55;
}
.eye-icon--off::after {
    content: '';
    position: absolute;
    left: -3px;
    right: -3px;
    top: 50%;
    height: 2px;
    background: currentColor;
    transform: rotate(-22deg) translateY(-50%);
    transform-origin: left center;
    border-radius: 1px;
    pointer-events: none;
}

/* Bulk-delete panel. */
.bulk-delete-panel .bulk-delete-intro {
    margin: 8px 0 16px;
}
.bulk-delete-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.bulk-delete-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    max-height: 60vh;
    overflow-y: auto;
}
.bulk-delete-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #e1e1e1);
    border-radius: 10px;
    cursor: pointer;
    background: var(--panel);
    transition: background 0.12s ease, border-color 0.12s ease;
}
.bulk-delete-row:hover {
    background: var(--panel-2, #f7f8f5);
    border-color: var(--accent, #4A5240);
}
.bulk-delete-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #b91c1c;
    flex: 0 0 18px;
    cursor: pointer;
}
.bulk-delete-name {
    flex: 1 1 auto;
    font-weight: 600;
}
.bulk-delete-level {
    color: var(--muted, #777);
    font-size: 13px;
}
.bulk-delete-actions {
    display: flex;
    justify-content: flex-end;
}
.bulk-delete-actions .danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Make the bulk-delete-panel also display:none by default like the
   other standalones (it's added in HTML alongside them). */


/* Bulletproof header layout: the title and the controls block are two
   independent grid columns (title fills remaining space, controls take only
   what they need). Inside .header-controls, grid-auto-flow:column gives each
   header-menu its own column so they can never overlap. */
.header-controls {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 51;          /* above the sticky header's drop-shadow */
}
.header-controls > .header-menu {
    display: block;
    position: relative;
    /* Guarantee no transforms / absolute pinning can put this on top of its
       sibling — these are grid items, the parent controls their position. */
    inset: auto !important;
}
.header-controls .menu-toggle {
    min-width: 44px;
    padding: 8px 12px;
    font-size: 20px;
}
.app-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hint text under a settings checkbox. */
/* Checkbox label that has a small inline italic hint underneath the main text. */
.checkbox-with-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.checkbox-with-hint__text 

/* ===========================================================
   Login / users / cloud-lists styles
   =========================================================== */

.login-panel .muted,
.users-panel .muted {
    margin-bottom: 16px;
}

.login-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.login-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(185, 28, 28, 0.08);
    border: 1px solid rgba(185, 28, 28, 0.35);
    border-radius: 10px;
    color: #b91c1c;
    font-size: 14px;
}

.lists-section-title {
    margin: 20px 0 10px;
    font-size: 14px;
    color: var(--muted, #777);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lists-section-title:first-child {
    margin-top: 0;
}
.cloud-lists-section {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.user-create-form {
    background: var(--panel-2, #f7f8f5);
    border-radius: 12px;
    padding: 14px 16px 16px;
    margin-bottom: 18px;
}
.user-create-form h3 {
    margin: 0 0 10px;
    font-size: 16px;
}
.users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #e1e1e1);
    border-radius: 10px;
    background: var(--panel);
    flex-wrap: wrap;
}
.user-row-main {
    flex: 1 1 200px;
    min-width: 0;
}
.user-row-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-row-email {
    color: var(--muted, #777);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-role-select {
    width: auto;
    min-width: 90px;
    height: 36px;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: left;
    text-align-last: left;
}
.user-row-pw,
.user-row-delete {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.user-row-delete:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .user-row {
        flex-direction: column;
        align-items: stretch;
    }
    .user-row-pw,
    .user-row-delete {
        align-self: flex-end;
    }
}


/* ===========================================================
   Admin-panel
   =========================================================== */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.admin-stat-card {
    background: var(--panel-2, #f7f8f5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
}
.admin-stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}
.admin-stat-label {
    font-size: 12px;
    color: var(--muted, #777);
    margin-top: 4px;
}

.admin-clubs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-row-usage {
    font-size: 12px;
    color: var(--muted, #777);
}

.admin-activity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--panel);
}
.admin-activity-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid var(--panel-2, #f0f0f0);
    font-size: 14px;
}
.admin-activity-row:last-child {
    border-bottom: none;
}
.admin-activity-time {
    flex: 0 0 auto;
    color: var(--muted, #777);
    font-size: 12px;
    white-space: nowrap;
    min-width: 110px;
}
.admin-activity-text {
    flex: 1 1 auto;
    min-width: 0;
}
.admin-activity-text em {
    color: var(--muted, #555);
}


/* ===========================================================
   Multi-klub: medlemskabschips + invitationer
   =========================================================== */

.user-row-memberships {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.membership-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    background: var(--panel-2, #f7f8f5);
}
.membership-chip em {
    color: var(--muted, #777);
    font-style: normal;
}
.membership-chip-remove {
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted, #777);
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.membership-chip-remove:hover {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.1);
}

.invite-link-box {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--panel-2, #f7f8f5);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    word-break: break-all;
}
.invite-link-box a {
    color: var(--accent, #4A5240);
}


/* ===========================================================
   Klubside
   =========================================================== */

.user-row--clickable {
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.user-row--clickable:hover {
    background: var(--panel-2, #f7f8f5);
    border-color: var(--accent, #4A5240);
}
.user-row-open {
    font-size: 22px;
    color: var(--muted, #777);
    flex: 0 0 auto;
    padding: 0 4px;
}

.club-danger-zone {
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid rgba(185, 28, 28, 0.35);
    border-radius: 12px;
    background: rgba(185, 28, 28, 0.04);
}
.club-danger-zone h3 {
    margin-top: 0;
    color: #b91c1c;
}


/* ===========================================================
   Hold (squads) på klubsiden
   =========================================================== */

/* Luft under opret-hold-rækken, før holdlisten begynder. */
#clubSquadCreateRow {
    margin-bottom: 18px;
}

.squad-row {
    padding: 14px 16px;
    align-items: flex-start;
}
.squad-row .user-row-main {
    min-width: 0;
}
.squad-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.squad-chevron {
    flex: 0 0 auto;
    font-size: 16px;
    color: var(--muted, #777);
    width: 18px;
    text-align: center;
}
.squad-row--open {
    border-color: var(--accent, #4A5240);
    background: var(--panel);
}
.squad-detail {
    margin-top: 12px;
    padding: 12px 0 4px;
    border-top: 1px dashed var(--border);
    cursor: default;
}
.squad-detail .user-row-memberships {
    margin-bottom: 4px;
}
.squad-add-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.squad-add-row select,
.squad-add-row input[type="text"] {
    flex: 1 1 180px;
    height: 40px;
    box-sizing: border-box;
    text-align: left;
    text-align-last: left;
}
.squad-add-row select#squadNewPlayerLevel {
    flex: 0 1 140px;
}
.squad-help {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted, #777);
    font-style: italic;
}

/* "Gem session til klubben" i Lav kampe-panelet. */
.session-share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--panel-2, #f7f8f5);
}
.session-share-row .session-share-hint {
    flex: 1 1 260px;
    font-size: 13px;
    color: var(--muted, #777);
    line-height: 1.4;
}

/* ── Spillerfotos (avatarer) ─────────────────────────────── */

.avatar-btn {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
    flex: 0 0 auto;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    border: 1px solid var(--border);
    background: var(--panel-2);
    flex: 0 0 auto;
}
.avatar--initials {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.5px;
}
.avatar--md {
    width: 42px;
    height: 42px;
}
.avatar--md.avatar--initials {
    font-size: 14px;
}

/* ── Resultatmarkering (valgfri, kun til statistik) ──────── */

.result-mark-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.result-mark {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    min-height: 32px;
}
.result-mark:hover {
    border-color: var(--accent);
    color: var(--text);
}
.result-mark.is-win {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
    font-weight: 600;
}
.result-mark.is-loss {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}
.result-mark.is-draw {
    background: var(--accent-3);
    border-color: var(--accent-3);
    color: #4a3b00;
    font-weight: 600;
}
.result-mark--mini {
    min-height: 26px;
    min-width: 26px;
    padding: 2px 0;
    font-size: 12px;
    line-height: 1;
}
.history-court-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.history-court-line > span:first-child {
    flex: 1 1 auto;
}
.history-result-marks {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
}

/* ── Spillerstatistik-panel ──────────────────────────────── */

.stats-intro {
    margin-top: 10px;
}
.stats-controls {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 14px 0 18px;
}
.stats-controls > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stats-row {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--panel);
    overflow: hidden;
}
.stats-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
}
.stats-row-header:hover {
    background: var(--panel-2);
}
.stats-row-text {
    flex: 1 1 auto;
    min-width: 0;
}
.stats-row-name {
    font-weight: 600;
}
.stats-row-meta {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.subtle-inline {
    color: var(--muted);
    font-style: italic;
}
.wld-win  { color: #2e7d32; font-weight: 600; }
.wld-loss { color: #c62828; font-weight: 600; }
.wld-draw { color: #a07800; font-weight: 600; }

.result-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.result-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot--win  { background: #2e7d32; }
.dot--loss { background: #c62828; }
.dot--draw { background: var(--accent-3); }

.stats-detail {
    padding: 12px 14px 14px;
    border-top: 1px dashed var(--border);
    background: var(--panel-2);
}
.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    text-align: center;
}
.stats-detail-grid > div {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stats-detail-grid strong {
    font-size: 16px;
}
.stats-detail-grid span {
    font-size: 11.5px;
    color: var(--muted);
}
.stats-photo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.stats-danger {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

/* ── Avatar med fjern-knap ───────────────────────────────── */

.avatar-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}
.avatar-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--panel);
    color: var(--muted);
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.avatar-remove:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--danger-contrast);
}

/* ── Niveau-hint i statistikken ──────────────────────────── */

.level-hint {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.level-hint--up {
    background: #e5f2e6;
    color: #2e7d32;
    border: 1px solid #bfe0c1;
}
.level-hint--down {
    background: #fdeaea;
    color: #c62828;
    border: 1px solid #f2c7c7;
}

/* ── Historik: vis alle runder ───────────────────────────── */

.history-showall {
    display: block;
    width: 100%;
    margin-top: 4px;
}

/* ── Statistik-backup ────────────────────────────────────── */

.stats-backup {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

/* ── ⋮-menu pr. spiller i "Alle spillere" ────────────────── */

.level-badge {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 140px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-menu-anchor {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    margin: 0 6px 0 2px;
}
.player-menu-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.player-menu-toggle:hover {
    border-color: var(--accent);
    color: var(--text);
}
.player-row.is-menu-open {
    opacity: 1;
    position: relative;
    z-index: 60;
}

.player-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 190px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-pop);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.player-menu-item {
    width: 100%;
    text-align: left;
    margin: 0;
    background: transparent;
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.player-menu-item:hover {
    background: var(--panel-2);
}

@media (max-width: 980px) {
    .level-badge {
        width: 128px;
    }
}


/* ── Custom-ikoner (SVG-sprite, icons.svg) ───────────────── */

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: -3px;
}
.icon--sm {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}
.collapse-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.collapse-indicator .icon {
    width: 22px;
    height: 22px;
}
.player-menu-toggle .icon,
.menu-toggle .icon {
    width: 20px;
    height: 20px;
}
.eye-icon .icon {
    vertical-align: -4px;
}
.menu-radio-marker .icon {
    display: block;
}

/* ── B1: Dagens spillere (fremmødeliste) ─────────────────── */

.attendance-count {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 10px;
    white-space: nowrap;
}

.attendance-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.attendance-head,
.attendance-row {
    display: grid;
    grid-template-columns: 48px 36px minmax(0, 1fr) 66px 92px 44px;
    column-gap: 13px;
    padding: 0 12px;
}
.attendance-table--no-level .attendance-head,
.attendance-table--no-level .attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 44px;
}

.attendance-head {
    align-items: center;
    padding-top: 2px;
    padding-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
}
.attendance-head-met    { grid-column: 1; text-align: center; }
.attendance-head-player { grid-column: 2 / span 2; }
.attendance-head-level  { grid-column: 4 / span 2; }

.attendance-row {
    align-items: stretch;
    min-height: 64px;
    background: var(--panel);
    border-radius: 10px;
}
.attendance-row:hover {
    background: var(--panel-2);
}
.attendance-row.is-met,
.attendance-row.is-met:hover {
    background: #e9efe4;   /* meget lys grågrøn */
}
.attendance-row.is-menu-open {
    position: relative;
    z-index: 60;
}

/* Label'en er usynlig i layoutet (display: contents) — dens børn bliver
   grid-celler, der strækker sig i hele rækkens højde = stor klikflade. */
.attendance-label {
    display: contents;
}
.attendance-label > * {
    display: flex;
    align-items: center;
    min-width: 0;
    cursor: pointer;
}
.attendance-check-cell {
    justify-content: center;
}
.attendance-check {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.attendance-check:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.avatar--att {
    width: 36px;
    height: 36px;
    align-self: center;
    background: #e3e8dd;   /* diskret lys grågrøn initial-cirkel */
    border-color: transparent;
    color: #5c6653;
    font-size: 13px;
}
.attendance-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    align-self: center;
    line-height: normal;
    padding: 22px 0;
}
.attendance-level {
    font-size: 12px;
    color: #6b7361;   /* afdæmpet grågrøn */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attendance-level-edit {
    grid-column: span 2;
    align-self: center;
    width: 100%;
    min-width: 0;
}

.level-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: center;
}
.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9ded2;   /* lys grågrøn, ikke-udfyldt */
    display: inline-block;
}
.level-dot.is-filled {
    background: var(--accent);
}

/* ⋮-kolonnen: 44×44 klikflade, uden for label'en — ændrer aldrig fremmøde */
.attendance-row .player-menu-anchor {
    margin: 0;
    align-self: center;
    justify-self: center;
}
.attendance-row .player-menu-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 12px;
}
.attendance-row .player-menu-toggle:hover,
.attendance-row .player-menu-toggle:focus-visible {
    background: var(--panel-3);
    color: var(--text);
}

@media (max-width: 640px) {
    .attendance-head,
    .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 50px 72px 44px;
        column-gap: 8px;
        padding: 0 6px;
    }
    .attendance-table--no-level .attendance-head,
    .attendance-table--no-level .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 44px;
    }
    .attendance-row {
        min-height: 56px;
    }
    .attendance-name {
        padding: 18px 0;
    }
    .avatar--att {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .level-dots {
        gap: 4px;
    }
    .level-dot {
        width: 6px;
        height: 6px;
    }
    .attendance-level {
        font-size: 11.5px;
    }
}


/* ── Arbejdsrum: faner, handlingslinje, runde-header ─────── */

.app-title-wrap {
    min-width: 0;
}
.header-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabbar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 12px 4px 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.tab:hover {
    color: var(--text);
}
.tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--panel-3);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tab.is-active .tab-badge {
    background: var(--accent);
    color: var(--accent-contrast);
}

/* Fast handlingslinje nederst — "Lav næste runde" er altid inden for
   rækkevidde. Indholdet ovenfor får bundafstand, så intet dækkes. */
#mainPage {
    padding-bottom: 96px;
}
.actionbar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "info setup"
        "generate generate";
    align-items: center;
    gap: 10px;
    margin: 8px 0 0;
    min-width: 0;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 -8px 24px rgba(45, 51, 41, 0.10);
}
.actionbar-info { grid-area: info; }
.actionbar-setup { grid-area: setup; }
.actionbar-generate { grid-area: generate; }
.actionbar-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}
.actionbar-info input#courtCount {
    width: 52px;
    min-width: 52px;
    padding: 6px 4px;
    text-align: center;
}
.actionbar-setup {
    font-size: 13px;
    padding: 10px 12px;
    justify-self: end;
}
.actionbar-generate {
    width: 100%;
    min-height: 48px;
    font-size: 15.5px;
    font-weight: 700;
}

.round-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.round-header-text {
    min-width: 0;
}
.round-header .result-actions {
    display: inline-flex;
    gap: 8px;
    flex: 0 0 auto;
}

.court-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.court-format {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.prefill-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: 2px;
}

/* Historik: slet runde/kamp */
.history-delete-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.history-delete-btn:hover {
    background: var(--panel-3);
    color: var(--danger);
}
.history-line-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.end-evening-row {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.w100 {
    width: 100%;
}
.small-btn {
    font-size: 13px;
    padding: 8px 12px;
}
.icon--flip {
    transform: scaleX(-1);
}

@media (max-width: 640px) {
    .actionbar-setup {
        padding: 10px 8px;
    }
    .round-header .result-actions {
        width: 100%;
    }
    .round-header .result-actions button {
        flex: 1 1 auto;
    }
}

/* ── Spillerlister: underfaner (samme mønster som forsiden) ── */

.tabbar--sub {
    margin-top: 6px;
    margin-bottom: 16px;
}
.lists-tab > .small-text {
    margin: 0 0 14px;
}


/* Farligt punkt i ⋮-menuen */
.player-menu-item--danger {
    color: var(--danger);
}
.player-menu-item--danger:hover {
    background: #fdeaea;
}


/* ── Tap-vinder på banekortene ───────────────────────────── */

.team--tappable {
    cursor: pointer;
    border-radius: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.team--tappable:hover {
    background: var(--panel-2);
}
.team--tappable:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.team--tappable.is-winner {
    background: var(--chip-bg);
    border-color: var(--accent);
}
.team--tappable.is-loser {
    opacity: 0.7;
}
.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 12px;
    font-weight: 600;
}

/* Niveau-prikker på kampkort (lidt mindre end i fremmødelisten) */
.level-dots--sm {
    gap: 4px;
    margin-left: 8px;
}
.level-dots--sm .level-dot {
    width: 6px;
    height: 6px;
}
.player-line,
.team-member-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── Spillerlister: indeks, detalje og aktiv liste ───────── */

.list-index {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.list-row:hover {
    background: var(--panel-2);
}
.list-row-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-row-meta {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}
.list-create-row {
    margin-top: 14px;
}

.list-detail-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 14px 0 10px;
}
.list-detail-players {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}
.list-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
}
.list-player-row + .list-player-row {
    border-top: 1px solid var(--border);
}
.list-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.list-danger-zone {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.active-list-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 12px;
    background: var(--chip-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text);
}
.active-list-info > span {
    flex: 1 1 auto;
    min-width: 0;
}
.active-list-detach {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
}
.active-list-detach:hover {
    background: var(--panel);
    color: var(--danger);
}

/* ── Banekort: stabil højde + spejl-symmetri omkring VS ──── */

/* Vinder-markeringen er et overlay i hjørnet af holdboksen, så kortets
   højde aldrig ændrer sig, når man markerer/fjerner en vinder. */
.team--tappable {
    position: relative;
}
.winner-badge {
    position: absolute;
    top: -9px;
    right: 10px;
    margin: 0;
    box-shadow: var(--shadow-soft);
    pointer-events: none;
    z-index: 2;
}
/* Højre side: badge i det spejlede hjørne */
.vs-grid .team:last-child .winner-badge {
    right: auto;
    left: 10px;
}

/* Navne må aldrig knække — ellipsis i stedet */
.player-line,
.team-member-line {
    flex-wrap: nowrap;
}
.player-line > span:first-child,
.team-member-line > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.level-dots--sm {
    flex: 0 0 auto;
}

/* VS som spejlingsakse: niveauprikker altid tættest på VS, navne længst
   væk. Venstre side: [Navn … prikker]; højre side: [prikker … Navn]. */
.vs-grid .team:last-child .player-line,
.vs-grid .team:last-child .team-member-line {
    flex-direction: row-reverse;
}
.vs-grid .team:last-child .player-line > span:first-child,
.vs-grid .team:last-child .team-member-line > span:first-child {
    text-align: right;
}
.vs-grid .team:last-child .level-dots--sm {
    margin-left: 0;
    margin-right: 8px;
}
.vs-grid .team:last-child .result-team-name {
    text-align: right;
}

/* ── Banekort: fast kolonne-alignment på tværs af alle kort ── */

/* Holdboksen fylder altid hele sin (lige brede) kolonne. */
.vs-grid > .team {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-self: stretch;
    align-self: stretch;
}
/* Hver spillerlinje: navn skubbes helt ud mod ydersiden, prikker helt ind
   mod VS — samme indre mål på alle linjer, så alt flugter lodret. */
.vs-grid .player-line,
.vs-grid .team-member-line {
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    font-size: inherit;
}
.vs-grid .team:first-child .player-line > span:first-child,
.vs-grid .team:first-child .team-member-line > span:first-child {
    text-align: left;
}
.vs-grid .level-dots--sm {
    margin: 0;
    width: 46px;               /* 5 × 6 px + 4 × 4 px — altid samme bredde */
    justify-content: space-between;
}
.vs-grid .flex-center {
    width: 36px;
    justify-self: center;
}

/* ── Rediger opstilling / Lås pladser: spillere som knapper ── */
/* Knappen har PRÆCIS samme indre boks som den normale spillerlinje
   (samme padding og bredde), så navn og prikker står urørt. Rammen og
   baggrunden tegnes 6 px uden om boksen via negativ margin + outline,
   som ikke fylder i layoutet. */
.slot-btn {
    font: inherit;
    color: inherit;
    background: var(--panel-2);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: inherit;
    outline: 1px dashed var(--border-strong);
    outline-offset: -1px;
    transition: background 0.12s ease, outline-color 0.12s ease;
}
.vs-grid .player-line.slot-btn {
    padding: 6px 6px;
    margin: 0 -6px;
    width: calc(100% + 12px);
}
.result-team-name.slot-btn {
    display: block;
    padding: 4px 6px;
    margin: 0 -6px;
    width: calc(100% + 12px);
}
.slot-btn:hover {
    background: var(--chip-bg);
    outline-color: var(--accent);
}
.slot-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}
.slot-btn--empty {
    justify-content: center !important;
    color: var(--muted);
    gap: 6px;
}
/* Bænken i redigering: samme linje som normalt, men navnene er knapper. */
.benched-line--edit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.benched-edit-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.benched-edit-list .slot-btn {
    width: auto;
    margin: 0;
    padding: 3px 10px;
    gap: 8px;
}
/* Kampformat pr. bane under "Lås pladser": firkantet knap m. bløde hjørner
   (kun når der er flere muligheder — ellers ren tekst via .court-format). */
.format-btn {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.format-btn:hover {
    border-color: var(--accent);
    background: var(--panel-2);
}
.sheet-option.is-active {
    border-color: var(--accent);
    background: var(--chip-bg);
}

/* ── Bottom-sheet: "Udskift med…" ────────────────────────── */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(45, 51, 41, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.sheet-backdrop.hidden {
    display: none;
}
.sheet {
    width: 100%;
    max-width: 640px;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--panel);
    border-radius: 18px 18px 0 0;
    padding: 14px 16px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-pop);
}
.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.sheet-head-text {
    min-width: 0;
}
.sheet-title {
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sheet-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}
.sheet-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 4px 0 8px;
}
.sheet-group {
    margin-bottom: 12px;
}
.sheet-group-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 6px 2px;
}
.sheet-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 6px;
    padding: 12px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}
.sheet-option:hover {
    background: var(--chip-bg);
    border-color: var(--accent);
}
.sheet-option-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sheet-option-meta {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
}
.sheet-option .level-dots--sm {
    margin: 0;
}
.sheet-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
body.sheet-open {
    overflow: hidden;
}

/* ── Aftenen: runder som rigtige banekort ────────────────── */

.history-round {
    margin-bottom: 22px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.history-round:last-of-type {
    border-bottom: none;
}
.history-round-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.history-round-title {
    font-weight: 700;
    font-size: 15px;
}
.history-round-head .history-delete-btn {
    gap: 5px;
    font-size: 12.5px;
}
.history-round .result-card {
    padding: 10px 0;
    margin-bottom: 6px;
    border-bottom: none;
}
.court-title-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Fremmøde: sorterbare kolonner + "Oprettet" ──────────── */

.attendance-head,
.attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 66px 92px 44px 44px;
}
.attendance-table--no-level .attendance-head,
.attendance-table--no-level .attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 44px 44px;
}
.attendance-head-created {
    grid-column: 6;
    justify-content: center;
}
.attendance-table--no-level .attendance-head-created {
    grid-column: 4;
}
.attendance-head-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-align: left;
    min-width: 0;
}
.attendance-head-btn:hover {
    color: var(--text);
}
.attendance-head-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.attendance-head-met {
    justify-content: center;
}
.sort-ind {
    transition: transform 0.15s ease;
}
.sort-ind--up {
    transform: rotate(180deg);
}
.attendance-created {
    justify-content: center;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

@media (max-width: 640px) {
    /* På smalle skærme bærer prikkerne niveauet alene; tekstkolonnen skjules. */
    .attendance-head,
    .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 50px 40px 44px;
    }
    .attendance-table--no-level .attendance-head,
    .attendance-table--no-level .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 40px 44px;
    }
    .attendance-level {
        display: none;
    }
    .attendance-head-level {
        grid-column: 4 / span 1;
    }
    .attendance-head-created {
        grid-column: 5;
    }
    .attendance-table--no-level .attendance-head-created {
        grid-column: 4;
    }
    .attendance-level-edit {
        grid-column: span 1;
    }
}


/* ── Ens linjehøjde i normal- og redigeringsvisning ───────── */
/* Både den almindelige spillerlinje og knap-varianten låses til samme
   højde, så intet flytter sig, når man går ind/ud af redigering. */
.vs-grid .player-line,
.vs-grid .player-line.slot-btn {
    height: 34px;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
    line-height: 1.3;
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: 0;
}
.vs-grid .team-member-line {
    height: 26px;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
    box-sizing: border-box;
}
.result-team-name,
.result-team-name.slot-btn {
    height: 30px;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: 0;
}
.slot-btn {
    appearance: none;
    -webkit-appearance: none;
}
.slot-btn:active {
    transform: none;
}

/* ── Navne: fuld form eller "Fornavn E" (aldrig ombrydning) ─ */
.pname {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pname.is-short {
    cursor: help;
}
.sheet-option-name.pname {
    flex: 1 1 auto;
}

/* ── Aftenen: kampe foldet sammen som standard ───────────── */
.history-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 6px 0;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.history-match-row:hover {
    border-color: var(--accent);
}
.history-match-row.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}
.history-match-row.is-open + .result-card {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.history-match-court {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
}
.history-match-names {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-match-side {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.history-match-vs {
    color: var(--muted);
    font-size: 12px;
    margin: 0 4px;
}
.is-winner-text {
    font-weight: 700;
}
.history-match-chev {
    flex: 0 0 auto;
    transition: transform 0.15s ease;
}
.history-match-row.is-open .history-match-chev {
    transform: rotate(90deg);
}

/* ── Runde-knapper: fast, ens bredde + centreret tekst ───── */
.round-header .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.round-header .result-actions button {
    width: 172px;
    justify-content: center;
    text-align: center;
}
@media (max-width: 640px) {
    .round-header .result-actions button {
        width: 100%;
    }
}

/* ── Udskift-sheet: mini-opstilling (baner + bænk) ────────── */
.sheet-court {
    margin-bottom: 14px;
}
.sheet-vs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}
.sheet-vs-label {
    align-self: center;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.sheet-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.sheet-bench {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sheet-bench .sheet-slot {
    width: auto;
}
.sheet-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    box-sizing: border-box;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
button.sheet-slot:hover {
    background: var(--chip-bg);
    border-color: var(--accent);
}
.sheet-vs .sheet-side:last-child .sheet-slot {
    flex-direction: row-reverse;
}
.sheet-vs .sheet-side:last-child .sheet-slot .pname {
    text-align: right;
}
.sheet-slot .level-dots--sm {
    margin: 0;
    flex: 0 0 auto;
}
.sheet-slot--empty {
    justify-content: center !important;
    gap: 6px;
    color: var(--muted);
    border-style: dashed;
    background: var(--panel-2);
}
.sheet-slot.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
    cursor: default;
}
.sheet-slot.is-selected .level-dot {
    background: rgba(255, 255, 255, 0.35);
}
.sheet-slot.is-selected .level-dot.is-filled {
    background: #fff;
}
.sheet-slot.is-disabled {
    opacity: 0.45;
    cursor: default;
}

/* ── Runde-knapper: garanteret ens bredde (også på mobil) ── */
/* minmax(0, 1fr) i stedet for 1fr: ellers bestemmer tekstens bredde
   kolonnen, og knapperne ændrer størrelse når label skifter. */
.round-header .result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 352px;
    max-width: 100%;
    gap: 8px;
    flex: 0 0 auto;
}
.round-header .result-actions button {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}
@media (max-width: 640px) {
    .round-header .result-actions {
        width: 100%;
    }
}

/* ── Banekort og udskift-vindue: samme geometri ──────────── */
/* Kortene på Kampe-fanen og under "Lås pladser" får samme mål som
   mini-opstillingen i udskift-vinduet, så navne har lige meget plads. */
#resultArea .result-card,
#prefillArea .result-card {
    padding-left: 0;
    padding-right: 0;
}
#resultArea .vs-grid,
#prefillArea .vs-grid,
.sheet-vs {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 8px;
}
#resultArea .vs-grid .flex-center,
#prefillArea .vs-grid .flex-center {
    width: 28px;
}
#resultArea .vs-grid .team,
#prefillArea .vs-grid .team {
    padding-left: 10px;
    padding-right: 10px;
}
#resultArea .player-line,
#prefillArea .player-line,
.sheet-slot {
    font-size: 15px;
}
.sheet {
    padding-left: 20px;
    padding-right: 20px;
}

/* ── Ingen indre sidepadding i holdboksene: mere plads til navne ── */
/* Den ydre container har allerede luft mod skærmkanten. Vinder- og
   hover-markering tegnes med box-shadow uden om boksen, så de ikke
   tager plads fra navnene. */
#resultArea .vs-grid .team,
#prefillArea .vs-grid .team,
#historyArea .vs-grid .team {
    padding-left: 0;
    padding-right: 0;
    border: none;
}
.team--tappable {
    border: none;
    border-radius: 6px;
}
.team--tappable:hover {
    background: var(--panel-2);
    box-shadow: 0 0 0 5px var(--panel-2);
}
.team--tappable.is-winner,
.team--tappable.is-winner:hover {
    background: var(--chip-bg);
    box-shadow: 0 0 0 5px var(--chip-bg), 0 0 0 6px var(--accent);
}
.vs-grid .team:last-child .winner-badge {
    left: 0;
}
.winner-badge {
    right: 0;
}
/* Knap-rammen i redigering lægges 4 px uden om navnet (i stedet for 6),
   så den ikke rører VS-kolonnen. Indholdet står stadig helt urørt. */
.vs-grid .player-line.slot-btn,
.result-team-name.slot-btn {
    padding-left: 4px;
    padding-right: 4px;
    margin-left: -4px;
    margin-right: -4px;
    width: calc(100% + 8px);
}

/* ── Rediger opstilling direkte i kortene ─────────────────── */
.slot-btn.is-selected,
.slot-btn.is-selected:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    outline: 1px solid var(--accent);
}
.slot-btn.is-selected .level-dot {
    background: rgba(255, 255, 255, 0.35);
}
.slot-btn.is-selected .level-dot.is-filled,
.slot-btn.is-selected .level-num {
    background: #fff;
    color: var(--accent);
}
/* Når en spiller er valgt, fremhæves alle mulige mål. */
#resultArea.is-picking .slot-btn:not(.is-selected) {
    outline: 1px solid var(--accent);
}
#resultArea.is-picking .slot-btn--empty:not(.is-selected) {
    color: var(--accent);
    background: var(--chip-bg);
}
.slot-btn--bench {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
}

/* ── Niveau som tal på meget smalle skærme ────────────────── */
.level-num {
    display: none;
}
@media (max-width: 360px) {
    .level-dots .level-dot {
        display: none;
    }
    .level-dots .level-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 5px;
        background: var(--panel-3);
        color: var(--text);
        font-size: 11px;
        font-weight: 700;
        box-sizing: border-box;
    }
    .vs-grid .level-dots--sm,
    .level-dots {
        width: auto;
    }
}

/* ── Slot-knapper: kant som border (ikke outline), delt mellem naboer ── */
/* Højden er fast (box-sizing: border-box), så kanten fylder ikke ekstra.
   To spillere på samme hold deler én 1px-linje i stedet for to. */
.slot-btn {
    outline: none;
    border: 1px dashed var(--border-strong);
    box-sizing: border-box;
}
.slot-btn:hover {
    border-color: var(--accent);
}
.slot-btn.is-selected,
.slot-btn.is-selected:hover {
    outline: none;
    border: 1px solid var(--accent);
}
#resultArea.is-picking .slot-btn:not(.is-selected) {
    outline: none;
    border-color: var(--accent);
}
.vs-grid .team > .slot-btn:not(:last-child) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.vs-grid .team > .slot-btn + .slot-btn {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.slot-btn.is-invisible {
    visibility: hidden;
    pointer-events: none;
}

/* ── Live-session: banner, overdragelse, landingsside ─────── */

.live-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--chip-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--text);
}
.live-banner.hidden {
    display: none;
}
.live-banner--viewer {
    background: #fff6dc;
    border-color: #f0dc9a;
}
.live-banner-text {
    flex: 1 1 auto;
    min-width: 0;
}
.live-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18);
}
.live-banner--viewer .live-dot {
    background: #c28a00;
    box-shadow: 0 0 0 3px rgba(194, 138, 0, 0.18);
}
/* Læsetilstand: man kan skifte faner og se med, men ikke ændre aftenen. */
body.is-viewer #tabFremmode,
body.is-viewer #tabKampe,
body.is-viewer #actionbar,
body.is-viewer #historyArea,
body.is-viewer #endEveningBtn,
body.is-viewer #handoverBtn,
body.is-viewer #undoBtn,
body.is-viewer #resetHistoryBtn {
    pointer-events: none;
    opacity: 0.6;
}

.handover-row {
    margin: 12px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.handover-qr {
    display: flex;
    justify-content: center;
    margin: 4px 0 12px;
}
.qr-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    image-rendering: pixelated;
    border-radius: 10px;
    background: #fff;
}
.handover-note {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
    margin: 0 0 10px;
}
.handover-warning {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 10px;
    padding: 9px 12px;
    background: #fff6dc;
    border: 1px solid #f0dc9a;
    border-radius: 10px;
    color: var(--text);
}
.handover-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.handover-actions button {
    justify-content: center;
}
.handover-info {
    margin: 14px 0 18px;
}
.handover-title {
    font-size: 18px;
    font-weight: 700;
}
.handover-meta {
    font-size: 13.5px;
    color: var(--muted);
    margin: 4px 0 12px;
}
.handover-landing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.handover-landing-actions button {
    justify-content: center;
}
.guest-players-notice {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    font-size: 13px;
}
.guest-players-notice.hidden {
    display: none;
}
.guest-players-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ── Rækker på smalle skærme: ikke 200 px høje ───────────── */
/* flex: 1 1 200px blev til en HØJDE, når rækken står i kolonne. */
@media (max-width: 640px) {
    .user-row .user-row-main {
        flex: 0 0 auto;
    }
    /* Klikbare rækker (fx klubber) har kun tekst + pil: behold én linje. */
    .user-row.user-row--clickable {
        flex-direction: row;
        align-items: center;
    }
    .user-row.user-row--clickable .user-row-main {
        flex: 1 1 auto;
    }
}

/* ── Admin: sammenfoldelige sektioner ────────────────────── */
.admin-section {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}
.admin-section-head {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.admin-section-head::-webkit-details-marker {
    display: none;
}
.admin-section-head:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 12px;
}
.admin-section-chev {
    flex: 0 0 auto;
    transition: transform 0.15s ease;
}
.admin-section[open] .admin-section-chev {
    transform: rotate(90deg);
}
.admin-section-body {
    padding: 0 16px 16px;
}
.admin-section-body > .user-create-form {
    margin-top: 0;
    border: none;
    padding: 0;
    background: none;
}

/* ── Hold på klubsiden ───────────────────────────────────── */

/* Selects i hold-rækkerne: den globale padding (10px top/bund) i en 40px-høj
   boks skubbede teksten ned og klippede bunden af fx "g". Uden lodret
   padding centrerer browseren selv teksten, ligesom i tekstfeltet. */
.squad-add-row select {
    padding-top: 0;
    padding-bottom: 0;
    line-height: normal;
}

/* Et lukket hold er én kompakt række — også på mobil, hvor den generelle
   .user-row-regel ellers stabler indholdet og gør rækken ~200px høj. */
@media (max-width: 640px) {
    .user-row.squad-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
    }
    .user-row.squad-row .user-row-main {
        flex: 1 1 auto;
        min-width: 0;
    }
    .user-row.squad-row .user-row-delete,
    .user-row.user-row--clickable .user-row-delete {
        align-self: flex-start;
        flex: 0 0 auto;
    }
    .squad-row:not(.squad-row--open) {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* ── Fremmøde: niveau kun som prikker (ingen tekst-kolonne) ── */
.attendance-head,
.attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 66px 44px 44px;
}
.attendance-head-level   { grid-column: 4 / span 1; }
.attendance-head-created { grid-column: 5; }
.attendance-level-edit   { grid-column: 4 / span 2; }
@media (max-width: 640px) {
    .attendance-head,
    .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 50px 40px 44px;
    }
    .attendance-head-level   { grid-column: 4 / span 1; }
    .attendance-head-created { grid-column: 5; }
    .attendance-level-edit   { grid-column: 4 / span 2; }
}

/* ── Fremmøde: "Spillere" + Opret på én linje, Fra klubben under ── */
.players-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.players-head #newPlayerBtn {
    flex: 0 0 auto;
}
.quick-add-select {
    width: 100%;
    margin-top: 12px;
    text-align: left;
    text-align-last: left;
}
.quick-add-select.hidden {
    display: none;
}

/* ── Fremmøde uden "Oprettet"-kolonne; sortering via ikon til højre ── */
.attendance-head,
.attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 66px 44px;
}
.attendance-table--no-level .attendance-head,
.attendance-table--no-level .attendance-row {
    grid-template-columns: 48px 36px minmax(0, 1fr) 44px;
}
.attendance-head-level { grid-column: 4 / span 1; }
.attendance-head-sort {
    grid-column: 5;
    justify-self: center;
    align-self: center;
}
.attendance-table--no-level .attendance-head-sort { grid-column: 4; }
.attendance-level-edit { grid-column: 4 / span 1; }
/* Under "Rediger niveau" får rækken plads til dropdownen. */
.attendance-row.is-editing-level {
    grid-template-columns: 48px 36px minmax(0, 1fr) 132px 44px;
}
@media (max-width: 640px) {
    .attendance-head,
    .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 50px 44px;
    }
    .attendance-table--no-level .attendance-head,
    .attendance-table--no-level .attendance-row {
        grid-template-columns: 40px 30px minmax(0, 1fr) 44px;
    }
    .attendance-head-level { grid-column: 4 / span 1; }
    .attendance-head-sort { grid-column: 5; }
    .attendance-table--no-level .attendance-head-sort { grid-column: 4; }
    .attendance-level-edit { grid-column: 4 / span 1; }
    .attendance-row.is-editing-level {
        grid-template-columns: 40px 30px minmax(0, 1fr) 120px 44px;
    }
}
.attendance-head {
    position: relative;
    z-index: 5;
}
.sort-menu-toggle {
    width: 36px;
    height: 36px;
}
.sort-menu {
    min-width: 230px;
}
.sort-menu-title {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 6px 12px 4px;
}
.sort-menu-item {
    justify-content: space-between;
}
.sort-menu-item.is-active {
    background: var(--chip-bg);
    font-weight: 600;
}
.sort-menu-dir {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

/* ── Fremmøde på små skærme: ingen sidepadding i rækker/header ── */
/* Panelet har allerede luft mod skærmkanten; checkbox- og ⋮-kolonnerne
   har selv luft nok, så pladsen går til navnene. */
@media (max-width: 640px) {
    .attendance-head,
    .attendance-row {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ── "Tilføj spillere": tre muligheder, foldet ud under knappen ── */
.add-players-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
}
.add-players-panel.hidden {
    display: none;
}
.add-players-option {
    width: 100%;
    margin: 0;
    justify-content: flex-start;
}
.add-players-panel .quick-add-select {
    margin-top: 0;
}
.add-players-panel .quick-add-select.hidden {
    display: none;
}
#addPlayersToggle.is-active {
    background: var(--accent-hover);
}

/* ── Handlingslinjen: altid fast i bunden (spejlbillede af headeren) ── */
/* position: sticky stoppede ved bunden af indholdet og "hoppede" op.
   Fixed holder den mod skærmens bund; indholdet får bundafstand svarende
   til linjens faktiske højde (--actionbar-h sættes af script.js). */
#mainPage {
    padding-bottom: calc(var(--actionbar-h, 140px) + 16px);
}
.actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: 800px;
    margin: 0 auto;
    z-index: 50;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}
/* På mobil er headeren kant-til-kant uden runding — det samme gælder her. */
@media (max-width: 980px) {
    .actionbar {
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

/* ── Popover (Lås pladser, kampformat, overdrag aftenen): i midten ── */
/* Tidligere et "bottom sheet" klistret til bunden; nu en almindelig
   centreret dialog med runde hjørner hele vejen rundt. */
.sheet-backdrop {
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}
.sheet {
    max-width: 480px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: 16px;
    padding-bottom: 18px;
}

/* ── "Lås en spiller": navn | Bane-mærke i midten | prikker flugter ── */
.sheet-option--grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px auto;
    align-items: center;
    column-gap: 10px;
}
.sheet-option-tag {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.sheet-option--grid .level-dots--sm {
    justify-self: end;
    width: 46px;
    justify-content: space-between;
}

/* ── Kampkort: navne mod VS, spejlede niveauprikker, stiplet VS-akse ── */
/* Venstre hold: navnet højrestilles, så det står op ad prikkerne ved VS.
   Højre hold: navnet venstrestilles op ad prikkerne ved VS. */
.vs-grid .team:first-child .player-line > .pname,
.vs-grid .team:first-child .team-member-line > .pname,
.vs-grid .team:first-child .result-team-name {
    text-align: right;
}
.vs-grid .team:last-child .player-line > .pname,
.vs-grid .team:last-child .team-member-line > .pname,
.vs-grid .team:last-child .result-team-name {
    text-align: left;
}
/* Venstre hold: prikkerne fyldes op fra højre (ind mod VS), så niveau 2
   er de to prikker tættest på VS. Gælder kun i kampvisningen. */
.vs-grid .team:first-child .level-dots {
    flex-direction: row-reverse;
}
/* Stiplet lodret linje over og under "VS" — to hold, én bane. */
.vs-grid > .flex-center {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.vs-grid > .flex-center::before,
.vs-grid > .flex-center::after {
    content: '';
    flex: 1 1 auto;
    min-height: 6px;
    width: 0;
    border-left: 1px dashed var(--border-strong);
}

/* ── Hovedmenuen på smalle skærme: dropdown under knappen ── */
/* Tidligere et "bottom sheet" nederst på skærmen, som nu blev dækket af den
   faste handlingslinje. Nu åbner den under ☰-knappen som på brede skærme. */
@media (max-width: 980px) {
    .menu-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: auto;
        bottom: auto;
        width: min(300px, calc(100vw - 24px));
        min-width: 0;
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
        border-radius: 16px;
        padding: 8px;
        z-index: 200;
        transform-origin: top right;
        animation: menuOpen 0.15s ease;
        box-shadow: var(--shadow-pop);
    }
    .menu-dropdown button.menu-item.danger {
        border-radius: 10px;
    }
}
