h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

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

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

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

/* Theme tokens. The base colours come from the MudBlazor palette (Theming/DmsTheme.cs), so they follow
   light and dark mode; the rest have a light value here and a dark one below. Bootstrap's own
   variables are mapped onto them so its utilities match the app. */
:root {
    --bg: var(--mud-palette-background);
    --surface: var(--mud-palette-surface);
    --surface-subtle: var(--mud-palette-background-gray);
    --text: var(--mud-palette-text-primary);
    --muted: var(--mud-palette-text-secondary);
    --label: #334155;
    --accent: var(--mud-palette-primary);
    --accent-rgb: var(--mud-palette-primary-rgb);
    --accent-hover: var(--mud-palette-primary-darken);
    --accent-soft: rgba(var(--accent-rgb), .1);
    --border: var(--mud-palette-lines-default);
    --input-border: var(--mud-palette-lines-inputs);
    --input-border-hover: #b9c4d1;
    --hover: #eef2f6;
    --danger: var(--mud-palette-error);
    --danger-hover: var(--mud-palette-error-darken);
    --danger-soft: #fdf1f1;
    --danger-border: #f0c9c9;
    --tag: #eef2f6;
    --tag-text: #475569;
    --success-soft: #e7f6ec;
    --success-text: #1f7a42;
    --warning-text: var(--warning-text);
    --overdue-text: var(--overdue-text);
    --due-soon-bg: #fff4d6;
    --overdue-bg: #fde2e2;
    --overdue-row-text: #8f1a1a;
    --free: #cfeedb;
    --busy: #d9534f;
    --station: #0a7ea4;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 2px 8px rgba(15, 27, 45, .04);
    --focus-ring: 0 0 0 3px rgba(var(--accent-rgb), .18);

    --bs-primary: var(--accent);
    --bs-primary-rgb: var(--accent-rgb);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--muted);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: var(--accent-rgb);
    --bs-link-hover-color: var(--accent-hover);
    --bs-link-hover-color-rgb: var(--accent-rgb);
    --bs-body-font-family: "Inter", "Noto Sans Lao", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgba(var(--accent-rgb), .18);
}

:root[data-bs-theme="dark"] {
    --label: #cbd5e1;
    --input-border-hover: #4a6178;
    --hover: #1c2b3c;
    --danger-soft: rgba(239, 91, 91, .12);
    --danger-border: rgba(239, 91, 91, .4);
    --tag: #1f3043;
    --tag-text: #cbd5e1;
    --success-soft: rgba(60, 207, 106, .14);
    --success-text: #6ee09a;
    --warning-text: #f0b429;
    --overdue-text: #f27c7c;
    --due-soon-bg: rgba(240, 180, 41, .14);
    --overdue-bg: rgba(239, 91, 91, .16);
    --overdue-row-text: #f8a5a5;
    --free: rgba(60, 207, 106, .22);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
}

.btn-primary {
    --bs-btn-color: var(--mud-palette-primary-text);
    --bs-btn-hover-color: var(--mud-palette-primary-text);
    --bs-btn-active-color: var(--mud-palette-primary-text);
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    font-weight: 500;
}

.form-control:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.form-control { border-color: var(--input-border); }
/* Identity pages render statically with Bootstrap markup; these rules make them look like the
   MudBlazor parts of the app: outlined dense fields with the label on the border, normal-size buttons. */
.btn, .btn-lg {
    --bs-btn-font-size: .875rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-border-radius: var(--radius-sm);
    min-height: 40px;
}
.btn.w-100 { width: auto !important; }
.form-floating { max-width: 32rem; }
.form-floating > .form-control,
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    height: 40px;
    min-height: 40px;
    padding: .5rem .875rem;
    background: transparent;
    color: var(--text);
    font-size: .9375rem;
    border-radius: var(--radius-sm);
}
.form-floating > .form-control:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.form-floating > .form-control:disabled { background: transparent; color: var(--muted); }
.form-floating > .form-control::placeholder { color: var(--muted); opacity: .7; }
.form-floating > .form-control ~ label,
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:disabled ~ label {
    top: 0;
    left: .55rem;
    height: auto;
    padding: 0 .3rem;
    font-size: .75rem;
    line-height: 1;
    color: var(--muted);
    background: var(--bg);
    transform: translateY(-50%);
    opacity: 1;
}
.form-floating > .form-control ~ label::after { display: none; }
.form-floating > .form-control:focus ~ label { color: var(--accent); }
.account-manage h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.account-manage h4 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .75rem; }
.btn-link { --bs-btn-color: var(--accent); --bs-btn-hover-color: var(--accent-hover); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--accent-soft); --bs-nav-pills-link-active-color: var(--accent-hover); --bs-nav-link-color: var(--text); --bs-nav-link-hover-color: var(--accent); }
.nav-pills .nav-link { border-radius: var(--radius-sm); font-weight: 500; }
.alert { border-radius: var(--radius); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

body {
    margin: 0;
    font-family: var(--bs-body-font-family);
    font-size: .9375rem;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1 { font-size: 1.625rem; font-weight: 650; letter-spacing: -.02em; margin-bottom: 1.25rem; }
h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .75rem; }

/* Shell */
.app-bar .brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; font-size: 1.05rem; margin-left: .5rem; }
.app-bar .brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--mud-palette-primary-lighten), var(--accent));
    font-size: 1rem;
}
.app-drawer .mud-drawer-content { display: flex; flex-direction: column; padding: .75rem .5rem; }
.app-drawer .mud-nav-link { border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; }
.app-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled) { background: rgba(255, 255, 255, .06); color: #fff; }
.app-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) { background: rgba(34, 184, 224, .14); color: #fff; }
.app-drawer .mud-nav-link.active .mud-nav-link-icon { color: #4cc9ec; }
.app-drawer .drawer-account { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .5rem; margin-top: .5rem; }
.app-drawer .drawer-account .mud-nav-link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-drawer .logout-button { justify-content: flex-start; text-transform: none; font-size: .875rem; font-weight: 500; padding: 8px 16px 8px 16px; color: var(--mud-palette-drawer-text); }
.app-drawer .logout-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-drawer .logout-button .mud-button-icon-start { margin-right: 12px; margin-left: 0; }
.app-drawer .logout-icon-button { margin-left: 4px; color: var(--mud-palette-drawer-text); }
.app-drawer .logout-icon-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-drawer .drawer-divider { border-color: rgba(255, 255, 255, .08); }
.app-drawer .shell-nav-item { display: block; position: relative; }
.app-drawer .shell-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* With only icons the badge sits on the icon's top right corner. */
.app-drawer .shell-nav-badge {
    position: absolute;
    top: 2px;
    left: 30px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: .6875rem;
    font-weight: 700;
    pointer-events: none;
}

.content { padding-top: 2rem; padding-bottom: 2rem; }

/* Page header: title on the left, primary actions on the right. */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header .subtitle { color: var(--muted); margin: .25rem 0 0; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .875rem; margin-bottom: .5rem; }

/* Surfaces */
.card {
    /* Bootstrap, loaded for the Identity pages, makes cards a flex column that stretches buttons to full width. */
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.card.flush { padding: 0; overflow: hidden; }
.card-toolbar { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.form-grid > label { display: flex; flex-direction: column; font-size: .8125rem; font-weight: 500; color: var(--label); gap: .375rem; }
/* MudBlazor fields bring their own label; the grid gap replaces their margins. */
.form-grid > .mud-input-control, .form-grid > .mud-picker, .form-grid > .mud-select { margin: 0; }
/* In inline rows they keep their own width instead of stretching across the row. */
:is(.form-actions, .plan-toolbar) > :is(.mud-input-control, .mud-picker, .mud-select) { flex: 0 0 auto; margin: 0; }
/* Buttons next to them match the 40px of a dense outlined field. */
:is(.form-actions, .plan-toolbar):has(> :is(.mud-input-control, .mud-picker, .mud-select)) > :is(button, a.button) { min-height: 40px; }
/* MudFileUpload is a flex column; its button keeps its natural width. */
.mud-file-upload { align-items: flex-start; }

/* Dropdown lists are cut off at their maximum height. macOS hides scrollbars until one scrolls, so nothing showed that
   more entries follow (e.g. the equipment types after "Shoes"); a styled scrollbar always shows. */
/* Chrome and Safari use the pseudo-elements only while scrollbar-width and -color are auto; MudBlazor's theme sets them
   for every element (an overlay scrollbar again), so the list resets them. Other browsers get the standard properties. */
.mud-popover .mud-list { scrollbar-width: auto; scrollbar-color: auto; }
.mud-popover .mud-list::-webkit-scrollbar { width: 8px; }
.mud-popover .mud-list::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
.mud-popover .mud-list::-webkit-scrollbar-track { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
    .mud-popover .mud-list { scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
}
/* A checkbox keeps distance from what follows, except its own explanation. */
form .mud-input-control-boolean-input + :not(.muted) { margin-top: .75rem; }

/* Form controls */
/* Plain form elements; Bootstrap-classed ones (Identity pages) keep Bootstrap's own sizing. */
/* :where() keeps these base rules at element specificity, so any class rule overrides them. */
input:where(:not(.form-control):not(.form-check-input):not([class*="mud-"])), select:where(:not(.form-select)), textarea:where(:not(.form-control):not([class*="mud-"])) {
    padding: .5rem .75rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
}

input:not(.form-check-input):not([class*="mud-"]):hover, select:hover, textarea:not([class*="mud-"]):hover { border-color: var(--input-border-hover); }
input:not([class*="mud-"]):focus, select:focus, textarea:not([class*="mud-"]):focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; }


/* Buttons */
button:where(:not(.btn):not([class*="mud-"])), a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: var(--accent);
    color: var(--mud-palette-primary-text);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .5rem 1rem;
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}

:where(button:not(.btn):not([class*="mud-"])):hover, a.button:hover { background: var(--accent-hover); color: var(--mud-palette-primary-text); }
button:not([class*="mud-"]):focus-visible, a.button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

button.secondary, a.button.secondary { background: var(--surface); color: var(--text); border-color: var(--input-border); }
button.secondary:hover, a.button.secondary:hover { background: var(--hover); color: var(--text); }
button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-hover); }
button.danger.subtle { background: var(--surface); color: var(--danger); border-color: var(--danger-border); }
button.danger.subtle:hover { background: var(--danger-soft); }
button:not([class*="mud-"]):disabled { opacity: .55; cursor: default; }

a.icon-button, button.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--muted);
    font-size: 1rem;
}

a.icon-button:hover, button.icon-button:hover { background: var(--hover); color: var(--text); }
button.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.row-actions.align-end { text-align: right; }

/* Toolbars above flush tables, and messages inside flush cards. */
.card-toolbar { flex-wrap: wrap; }
.card-toolbar .push-right { margin-left: auto; }
.card-message { padding: .5rem 1.25rem 0; }

.card h3 { font-size: .9375rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.card > h2:first-child { margin-top: 0; }
.card table + .muted { margin-top: .75rem; }

input[type=file] { padding: .35rem; font-size: .875rem; }
input[type=file]::file-selector-button {
    margin-right: .75rem;
    padding: .35rem .8rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.form-actions { display: flex; align-items: center; gap: .5rem; }
.form-actions .push-right { margin-left: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: .75rem; font-size: .875rem; }
th, td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-subtle); }
tbody tr { transition: background-color .1s; }
tbody tr:hover td { background: var(--surface-subtle); }
tbody tr:last-child td { border-bottom: 0; }
.card.flush table { margin: 0; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 1.25rem; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 1.25rem; }

.person { display: flex; align-items: center; gap: .75rem; font-weight: 500; color: var(--text); }
.person small { display: block; color: var(--muted); font-weight: 400; }
.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .75rem;
    font-weight: 650;
}

.avatar.lg { width: 52px; height: 52px; font-size: 1.05rem; }

.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty-state .bi { display: block; font-size: 2rem; margin-bottom: .5rem; opacity: .6; }

/* Dialogs */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 29, 46, .45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.dialog {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(12, 29, 46, .25);
}

.dialog h2 { margin-top: 0; font-size: 1.15rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.dialog.form-dialog { max-width: 760px; max-height: calc(100vh - 2rem); overflow-y: auto; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
button.dialog-close { background: none; border: none; color: var(--muted); padding: .25rem .5rem; }
button.dialog-close:hover { background: var(--hover); color: var(--text); }


tr.inactive td { color: var(--muted); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-left: .4rem;
    padding: .15rem .55rem;
    border: 0;
    border-radius: 999px;
    background: var(--tag);
    font-size: .75rem;
    font-weight: 500;
    color: var(--tag-text);
}

.badge.accent { background: var(--accent-soft); color: var(--accent-hover); }
.badge.success { background: var(--success-soft); color: var(--success-text); }
td > .badge:first-child { margin-left: 0; }

.muted { color: var(--muted); }
.revision-overdue { color: var(--overdue-text); font-weight: 600; }
.revision-soon { color: var(--warning-text); font-weight: 600; }
.badge.overdue { color: var(--overdue-text); border-color: var(--overdue-text); }
.badge.warning { color: var(--warning-text); border-color: var(--warning-text); }
.difficulty-badge {
    display: inline-block;
    padding: .05rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    /* Mixed from the text colour, so dark piste colours such as black stay visible on dark surfaces. */
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-text-primary) 45%, transparent);
}
.short-description { display: block; color: var(--muted); font-weight: 400; }

/* Markdown written by staff, such as tour descriptions. */
.markdown-body { line-height: 1.6; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.25rem 0 .5rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote { margin: 0 0 .75rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; }
.markdown-body blockquote { padding-left: .75rem; border-left: 3px solid var(--border); color: var(--muted); }
.markdown-body code { padding: .1rem .3rem; border-radius: 4px; background: var(--tag); font-size: .875em; }
.markdown-body img { max-width: 100%; border-radius: var(--radius-sm); }
.markdown-editor .mud-tabs-toolbar { border-bottom: 1px solid var(--border); }
img.cover { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; display: block; }
.thumbnails { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.thumbnail { margin: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.thumbnail img { width: 100%; height: 110px; object-fit: cover; display: block; }
.thumbnail figcaption { display: flex; gap: .25rem; padding: .4rem; align-items: center; }
.thumbnail figcaption button:not(.icon-button) { padding: .25rem .5rem; }
.thumbnail figcaption .danger { margin-left: auto; }
.thumbnail .badge { margin: 0; }
.form-grid .wide { grid-column: 1 / -1; }
/* Position, description, quantity and unit price of an invoice line on one row. */
.invoice-line-grid { display: grid; grid-template-columns: 6rem minmax(12rem, 1fr) 8rem 10rem; gap: 1rem 1.25rem; margin-bottom: 1.25rem; }
.invoice-line-grid > .mud-input-control { margin: 0; }
@media (max-width: 720px) {
    .invoice-line-grid { grid-template-columns: 1fr 1fr; }
    .invoice-line-grid > .description { grid-column: 1 / -1; }
}
.product-lines { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.product-line { display: flex; gap: .5rem; align-items: center; }
.product-line > .mud-select { flex: 1; max-width: 360px; margin: 0; }
.product-line > .mud-input-control:not(.mud-select) { flex: none; width: 7rem; margin: 0; }
.invoice-header { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.invoice-header dt { color: var(--muted); }
.invoice-header dd { margin: 0; }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; }
.invoice-lines .number { text-align: right; }
th.number, td.number { text-align: right; }
.invoice-lines input { width: 7rem; text-align: right; }
.invoice-lines tfoot th { border-top: 2px solid var(--border); }
/* Keeps adding an item apart from the actions on the whole invoice below it. */
.invoice-add-line { margin: 1.5rem 0; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.recurrence { min-width: 0; margin: 0 0 .75rem; padding: .25rem 1rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.recurrence legend { float: none; width: auto; margin: 0; padding: 0 .375rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.recurrence .form-actions { flex-wrap: wrap; margin-top: 0; }

.plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.plan-toolbar .plan-date { font-weight: 600; margin-left: .5rem; }
.plan-scroll { overflow-x: auto; }
.staff-plan { display: grid; grid-template-columns: minmax(10rem, max-content) minmax(36rem, 1fr); gap: .5rem 1rem; align-items: center; }
.staff-plan .plan-name small { display: block; color: var(--muted); }
.plan-hours { position: relative; height: 1.25rem; font-size: .75rem; color: var(--muted); }
.plan-hours span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.plan-hours span:first-child { transform: none; }
.plan-hours span:last-child { transform: translateX(-100%); }
.plan-bar { position: relative; height: 1.75rem; border-radius: 4px; background: var(--free); overflow: hidden; }
.plan-busy {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0 .4rem;
    background: var(--busy);
    color: #fff;
    font-size: .8rem;
    line-height: 1.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    border-left: 1px solid rgba(255, 255, 255, .5);
}
.plan-busy:hover { filter: brightness(1.1); }
.plan-station {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0 .4rem;
    background: var(--station);
    color: #fff;
    font: inherit;
    font-size: .8rem;
    line-height: 1.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, .5);
    border-radius: 6px;
    cursor: pointer;
}
.plan-station:hover { filter: brightness(1.1); }
.staff-plan .plan-name { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.plan-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: .75rem; font-size: .8125rem; }
.plan-swatch { display: inline-block; width: .875rem; height: .875rem; border-radius: 3px; margin-right: .35rem; vertical-align: -2px; }
.plan-swatch.tour { background: var(--busy); }
.plan-swatch.station { background: var(--station); }
.weekday-picker { margin: .5rem 0; }
.weekday-picker .mud-toggle-item { min-height: 40px; min-width: 3rem; text-transform: none; }

.invite-link { flex: 1; min-width: 0; }
.invite-link input { font-family: ui-monospace, monospace; font-size: .8rem; }

.quick-input { max-width: 32rem; margin-bottom: .75rem; }
.quick-customer { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.quick-customer h2 { margin: 0 0 .75rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg); }

/* House reef: divers close to or past their return limit must stand out. */
tr.due-soon td { background: var(--due-soon-bg); }
tr.overdue td { background: var(--overdue-bg); color: var(--overdue-row-text); font-weight: 600; }
.row-actions, .nowrap { white-space: nowrap; }
.mud-table-cell.row-actions { padding-left: 4px; }
.row-actions > * + * { margin-left: .25rem; }
.chip-remove { background: none; color: inherit; border: 0; padding: 0 0 0 .25rem; cursor: pointer; }
.house-reef-status { font-size: 1.25rem; }
.house-reef-status.overdue { color: var(--overdue-text); font-weight: 700; }
.big-button { font-size: 1.25rem; padding: .75rem 1.5rem; }

/* Buttons inside table rows stay compact. */
td > button:not(.icon-button), td > a.button { padding: .3rem .7rem; font-size: .8125rem; }

/* Phones (the customer portal especially): the drawer becomes a temporary overlay on its own. */
@media (max-width: 800px) {
    .content { padding-top: 1.25rem; padding-bottom: 1.25rem; }
    .card.flush { overflow-x: auto; }
}

.card .form-actions:not(:last-child) { margin-bottom: 1rem; }
.details-list dt, .invoice-header dt { font-weight: 500; }
tfoot th { text-transform: none; letter-spacing: 0; font-size: .875rem; color: var(--text); background: none; }
.plan-bar, .plan-busy { border-radius: 6px; }

/* Waiver and medical form */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.section-header h2 { margin: 0; }
.document-wizard { max-width: 860px; }
.medical-question { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.medical-question.follow-up { padding-left: 1.5rem; border-left: 3px solid var(--accent-soft); }
.waiver-text { max-height: 22rem; overflow-y: auto; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle); }
.signature-pad { margin-top: 1rem; }
.signature-pad-label { display: flex; align-items: center; justify-content: space-between; }
/* The signature is drawn dark on white in both themes, as it is printed on the PDF. */
.signature-pad canvas { display: block; width: 100%; max-width: 560px; height: 160px; border: 1px dashed var(--input-border); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }
.upload-slot { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.question-editor td { vertical-align: top; }
.unattended-clearance { display: inline-flex; align-items: center; gap: .3rem; vertical-align: middle; }

/* Staff views: used on phones at the tank station and the meeting point, so large and one column. */
.staff-menu { display: grid; gap: 1rem; max-width: 32rem; }
.staff-menu-button {
    display: flex; align-items: center; justify-content: center; gap: .75rem; min-height: 7rem;
    border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: 1.75rem; font-weight: 600;
}
.staff-menu-button:hover { background: var(--accent-hover); color: #fff; }
.staff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; max-width: 40rem; }
/* Bootstrap's .card is a flex column; list items lay out as a row that wraps on narrow screens. */
.staff-list-item { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0; }
.staff-list-link { color: inherit; }
.staff-list-link:hover { color: inherit; border-color: var(--accent); }
.staff-list-main { display: flex; flex-direction: column; flex: 1 1 12rem; min-width: 0; font-size: 1.125rem; }
.staff-list-facts { display: flex; align-items: center; gap: .75rem; }
.staff-box { min-width: 3rem; text-align: center; font-size: 1.5rem; font-weight: 700; }
.staff-list-actions { display: flex; gap: .5rem; flex: 1 1 100%; justify-content: flex-end; }
@media (max-width: 800px) {
    .staff-list-actions .big-button { flex: 1; }
}

/* QR labels for the equipment: a grid on screen; printing shows only the selected labels. */
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }
.qr-label {
    position: relative; display: flex; flex-direction: column; align-items: center; padding: .75rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: #000; cursor: pointer; break-inside: avoid;
}
.qr-label.deselected { opacity: .35; }
.qr-label-check { position: absolute; top: .25rem; left: .25rem; }
.qr-label-code { width: 7rem; height: 7rem; }
.qr-label-code svg { width: 100%; height: 100%; display: block; }
.setup-code { width: 12rem; height: 12rem; margin: .5rem 0 1rem; }
.setup-code svg { width: 100%; height: 100%; display: block; }
.qr-label-number { margin-top: .25rem; font-size: 1.125rem; font-weight: 700; letter-spacing: .02em; }
.qr-label-details { font-size: .75rem; }
@media print {
    html, body { background: #fff !important; }
    body * { visibility: hidden; }
    .label-sheet, .label-sheet * { visibility: visible; }
    .label-sheet { position: absolute; top: 0; left: 0; width: 100%; grid-template-columns: repeat(4, 1fr); gap: 4mm; }
    .no-print, .qr-label.deselected { display: none !important; }
    .qr-label { border: 1px dashed #999; border-radius: 0; opacity: 1; }
    .qr-label-code { width: 30mm; height: 30mm; }
}

/* Customer page: the facts line wraps under the name, the status chips sit between header and tabs. */
.customer-header { margin-bottom: .75rem; }
.status-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.status-chips:empty { display: none; }
.customer-tabs .mud-tabs-tabbar { background: transparent; border-bottom: 1px solid var(--border); }
.customer-tabs .mud-tab { text-transform: none; font-weight: 500; padding-inline: 1rem 1.5rem; }
/* The badge hangs off the end of the label instead of covering its last letters. */
.customer-tabs .mud-tab-badge { margin-inline-start: .75rem; }
/* Group titles inside a form, e.g. Person, Diving and Stay of a customer. */
.field-group { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 1.25rem 0 .625rem; }
.field-group:first-child { margin-top: 0; }
