:root {
    --mud-typography-default-family: 'Inter', 'Roboto', 'Segoe UI', system-ui, sans-serif;
}

html, body {
    font-family: 'Inter', 'Roboto', 'Segoe UI', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.mud-typography { font-family: inherit; }

.text-truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Smalle telefoner: kun ikon på "Brug"-knappen */
@media (max-width: 480px) {
    .hide-xs { display: none; }
    .brug-btn .mud-button-icon-start { margin: 0; }
    .brug-btn { min-width: 48px; padding-left: 12px; padding-right: 12px; }
}

.location-card { transition: transform .12s ease, box-shadow .12s ease; }
.location-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }

/* Opstart */
.boot { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #2E7D5B;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    font-family: system-ui, sans-serif;
}

.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Indlæser"); }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

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

/* Login / opsætning */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--mud-palette-background);
}

.auth-card { width: 100%; max-width: 420px; }

/* App-bar: profil-avatar og husstandsvælger */
.avatar-button {
    background: none;
    border: 0;
    padding: 4px;
    margin-left: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
}

.avatar-button:hover { background: rgba(255, 255, 255, .12); }
.avatar-button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.household-button.mud-button-outlined {
    color: inherit;
    border-color: rgba(255, 255, 255, .5);
    text-transform: none;
    border-radius: 16px;
}

.profile-menu { min-width: 240px; }

/* Udskrivning (etiketter): kun selve indholdet */
@media print {
    .mud-appbar, .mud-drawer, .mud-drawer-overlay, .no-print, .mud-snackbar-provider { display: none !important; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .mud-container { max-width: none !important; padding: 0 !important; }
    html, body, .mud-layout { background: #fff !important; }
    @page { margin: 8mm; }
}

/* "Ny version"-banner (styres af index.html, uden for Blazor) */
#update-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-radius: 12px;
    background: #1B2420;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: .95rem;
    max-width: calc(100% - 32px);
}

#update-banner[hidden] { display: none; }

#update-banner button {
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    background: #5CC29A;
    color: #0d1a14;
    font-weight: 600;
    cursor: pointer;
}

@media print { #update-banner { display: none !important; } }

/* ---------- Typografi ---------- */
/* Sidetitler: lidt kraftigere og strammere – og mindre på telefon. */
.mud-typography-h4 { font-weight: 700 !important; letter-spacing: -0.02em !important; }
.mud-typography-h5, .mud-typography-h6 { font-weight: 650 !important; letter-spacing: -0.01em; }
@media (max-width: 599.98px) { .mud-typography-h4 { font-size: 1.75rem !important; } }
.mud-paper-outlined { border-radius: 18px !important; }
.mud-button-root { border-radius: 12px; }
.mud-dialog { border-radius: 22px !important; }
body { font-feature-settings: "cv11", "ss01"; }

/* ---------- Layout på telefon ---------- */
/* Plads til bundmenuen (og iPhonens hjem-streg) under indholdet. */
.main-container { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 959.98px) {
    .mud-snackbar-location-bottom-center { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
    .mud-appbar .mud-toolbar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
}
@media (min-width: 960px) { .main-container { padding-bottom: 48px; } }

/* ---------- "Se som" (administrator) ---------- */
.mud-appbar.impersonating { background: #B45309 !important; }
.impersonation-bar {
    position: sticky; top: var(--mud-appbar-height); z-index: 1100;
    display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: .88rem;
    color: #1f1300; background: #FBBF24;
}

/* ---------- Bevægelse og feedback ---------- */
/* Siderne glider blidt ind; kort og lister dukker op i rækkefølge. */
.page-enter { animation: page-in .32s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

.stagger > * { animation: rise-in .45s cubic-bezier(.22, 1, .36, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; }
.stagger > *:nth-child(n+7) { animation-delay: .3s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

/* Knapper og klikbare kort giver efter, når man trykker. */
.mud-button-root, .tap { transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease; }
.mud-button-root:active:not(:disabled), .tap:active { transform: scale(.96); }

.fx-pop { animation: pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { 40% { transform: scale(1.18); } }

.fx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1700; }

/* Pladsholdere mens data hentes (i stedet for en spinner). */
.skeleton {
    border-radius: 12px;
    background: linear-gradient(90deg, var(--mud-palette-action-disabled-background) 0%, color-mix(in srgb, var(--mud-palette-action-disabled-background) 40%, transparent) 50%, var(--mud-palette-action-disabled-background) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* Øvelsesillustrationer (samme regler som PoseSvg.Css) */
.pose { width: 100%; height: auto; display: block; --fig: var(--mud-palette-text-primary, #333); }
@supports (color: rgb(from red r g b)) {
.pose { --fig: color-mix(in srgb, rgb(from var(--mud-palette-text-primary, #333) r g b) 85%, var(--mud-palette-background-gray, #f4f4f4)); }
}
.pose .near polyline, .pose .near line, .pose .far polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pose .near polyline { stroke: var(--fig); stroke-width: 4.2; }
.pose .near .torso { stroke: var(--fig); stroke-width: 6.5; }
.pose .far { opacity: .4; }
.pose .far polyline { stroke: var(--fig); stroke-width: 3.8; }
.pose .head { fill: var(--fig); }
.pose .near .halo { stroke: var(--mud-palette-background-gray, #f4f4f4); stroke-width: 6.6; }
.pose .near .torso.halo { stroke-width: 8.6; }
.pose .floor, .pose .wall { stroke: var(--mud-palette-lines-default, #ccc); stroke-width: 1; }
.pose .mat { fill: color-mix(in srgb, var(--mud-palette-primary, #2E7D5B) 20%, transparent); }
.pose .bench { fill: color-mix(in srgb, var(--mud-palette-text-secondary, #777) 35%, transparent); }
.pose .bench-leg { stroke: color-mix(in srgb, var(--mud-palette-text-secondary, #777) 45%, transparent); stroke-width: 1.6; }
.pose .pad { stroke: color-mix(in srgb, var(--mud-palette-text-secondary, #777) 40%, transparent); stroke-width: 3.2; stroke-linecap: round; }
.pose .bar { stroke: var(--mud-palette-text-secondary, #777); stroke-width: 2; stroke-linecap: round; }
.pose .cable { stroke: var(--mud-palette-text-secondary, #777); stroke-width: .8; }
.pose .pulley { fill: var(--mud-palette-text-secondary, #777); }
.pose .db, .pose .kb { fill: var(--mud-palette-primary, #2E7D5B); }
.pose .plate { fill: color-mix(in srgb, var(--mud-palette-primary, #2E7D5B) 30%, transparent); stroke: var(--mud-palette-primary, #2E7D5B); stroke-width: 1.8; }
.pose .handle { fill: var(--mud-palette-text-secondary, #777); }
.pose .roller { fill: color-mix(in srgb, var(--mud-palette-text-secondary, #777) 55%, transparent); }
.pose .wheel { fill: color-mix(in srgb, var(--mud-palette-text-secondary, #777) 25%, transparent); stroke: var(--mud-palette-text-secondary, #777); stroke-width: 1; }
.pose .hub { fill: var(--mud-palette-surface, #fff); }
.pose .kb-handle { fill: none; stroke: var(--mud-palette-primary, #2E7D5B); stroke-width: 1.6; }

/* Kropsfigur til kropsmål (samme regler som BodySvg.Css) */
.bodyfig { width: 100%; height: auto; display: block; }
.bodyfig .body { fill: var(--mud-palette-text-primary, #333); opacity: .16; }
.bodyfig .tape { fill: none; stroke: var(--mud-palette-primary, #2E7D5B); stroke-width: 2.4; stroke-linecap: round; }
.bodyfig .tape-ticks { fill: none; stroke: var(--mud-palette-surface, #fff); stroke-width: .7; stroke-dasharray: .35 1.6; }
