/* The club's orange and black, with the same tokens and class names as KV Kios Live so the two applications
   look like one club's. The constraint behind the palette is the same too: orange is a fill colour, not a text
   colour, on a light background — at 2.5:1 on white it is far under the 4.5:1 text needs — so it goes on
   surfaces, borders and rules, and --accent-text is the dark fallback for the few places that only have
   glyphs to colour. Dark mode has no such conflict. */
:root {
    --surface: #f5f5f4;
    --card: #ffffff;
    --ink: #12100e;
    --ink-muted: #6b625a;
    --border: #e2ded9;
    --accent: #fb8500;
    --accent-text: #a85700;
    /* Black on orange, not white: white on this orange is only 2.5:1, black is 7.7:1. */
    --accent-ink: #12100e;
    --danger: #c2231c;
    --danger-surface: #fdecea;
    --header: #12100e;
    --header-ink: #f5f3f0;
    --header-muted: #a49a90;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--surface);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

button {
    /* Drops the double-tap-to-zoom delay on phones, so a tap on a small button registers at once. */
    touch-action: manipulation;
}

h1 {
    font-size: 1.6rem;
    margin: 0 0 1rem;
}

h1:focus {
    outline: none;
}

/* There is no global anchor rule, so links inside running text get the readable dark orange explicitly. */
.app-main p a,
.app-main li a,
.app-main td a {
    color: var(--accent-text);
}

code {
    background: color-mix(in srgb, var(--ink-muted) 14%, transparent);
    border-radius: 4px;
    padding: 0 0.25rem;
}

/* Shared brand mark: the orange square with black lettering is the club. */
.app-mark,
.auth-mark {
    align-items: center;
    background: var(--accent);
    border-radius: 8px;
    color: var(--accent-ink);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    letter-spacing: 0.04em;
    width: 2rem;
}

/* Shell */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    align-items: center;
    background: var(--header);
    border-bottom: 3px solid var(--accent);
    color: var(--header-ink);
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
}

.app-brand {
    align-items: center;
    color: inherit;
    display: inline-flex;
    flex-shrink: 0;
    font-weight: 600;
    gap: 0.6rem;
    text-decoration: none;
    white-space: nowrap;
}

.app-user {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    /* Lets the name below ellipsise instead of pushing the header onto two lines. */
    min-width: 0;
}

.app-user-name {
    color: var(--header-muted);
    display: block;
    font-size: 0.9rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-main {
    margin: 0 auto;
    max-width: 60rem;
    padding: 1.5rem 1.25rem 3rem;
    width: 100%;
}

.app-nav {
    display: flex;
    flex-shrink: 0;
    gap: 1rem;
    margin-right: auto;
}

.app-nav a {
    border-radius: 6px;
    color: var(--header-muted);
    padding: 0.3rem 0.6rem;
    text-decoration: none;
}

.app-nav a:hover {
    color: var(--header-ink);
}

/* Against black the orange is bright enough to use as text directly. */
.app-nav a.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-weight: 600;
}

/* The checkbox driving the mobile menu: off-screen rather than display: none, so it stays focusable. */
.app-nav-toggle {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.app-nav-button {
    display: none;
}

.app-nav-icon {
    position: relative;
}

.app-nav-icon,
.app-nav-icon::before,
.app-nav-icon::after {
    background: var(--header-ink);
    border-radius: 1px;
    height: 2px;
    width: 1.25rem;
}

.app-nav-icon::before,
.app-nav-icon::after {
    content: "";
    left: 0;
    position: absolute;
    transition: transform 150ms ease, top 150ms ease;
}

.app-nav-icon::before {
    top: -0.4rem;
}

.app-nav-icon::after {
    top: 0.4rem;
}

/* Common text and layout */
.lead {
    color: var(--ink-muted);
    margin-top: 0;
}

.breadcrumb {
    column-gap: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem 0 1.25rem;
    row-gap: 0.25rem;
}

.breadcrumb a {
    color: var(--ink-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--ink);
}

.section-heading {
    align-items: baseline;
    display: flex;
    font-size: 1.1rem;
    gap: 0.5rem;
    margin: 1.75rem 0 0.75rem;
}

.section-count {
    color: var(--ink-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.placeholder {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--ink-muted);
    padding: 1.5rem;
    text-align: center;
}

.placeholder a {
    color: var(--accent-text);
    font-weight: 600;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

/* Buttons */
.auth-submit {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: var(--accent-ink);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    margin-top: 0.25rem;
    padding: 0.65rem 1rem;
}

a.auth-submit {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.auth-card a.auth-submit {
    display: block;
}

.auth-submit:hover {
    filter: brightness(1.08);
}

.auth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.sync-button {
    font-size: 0.85rem;
    margin-top: 0;
    padding: 0.4rem 0.85rem;
}

.secondary-button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
}

.secondary-button:hover:not(:disabled) {
    border-color: var(--ink-muted);
}

.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.secondary-button.danger {
    color: var(--danger);
}

.secondary-link {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

/* A button that reads as a link, for a secondary action inside running text. */
.link-button {
    background: none;
    border: none;
    color: var(--accent-text);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.icon-button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    height: 2.5rem;
    width: 2.5rem;
}

.icon-button:hover:not(:disabled) {
    border-color: var(--ink-muted);
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.icon-button.danger:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
}

/* Fields */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-field label,
.filter-field label,
.filter-field legend,
.check-group legend {
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-field input,
.auth-field select,
.auth-field textarea,
.filter-field select,
.filter-field input[type="search"],
.picker-filters input,
.picker-filters select,
.plan-item-fields input,
.plan-item-title {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    padding: 0.55rem 0.7rem;
    width: 100%;
}

.auth-field textarea {
    line-height: 1.45;
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 1px;
}

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

.validation-message {
    color: var(--danger);
    font-size: 0.85rem;
}

/* Messages */
.auth-error {
    background: var(--danger-surface);
    border-radius: 8px;
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
}

/* The tinted panel already carries the orange, so the text on it is plain ink. */
.auth-notice {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.9rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
}

.sync-hint {
    color: var(--ink-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Filters */
.filter-bar {
    align-items: flex-end;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    margin: 0 0 1.5rem;
    padding: 1rem;
}

.filter-field {
    border: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.filter-equipment {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.filter-equipment legend {
    margin-bottom: 0.35rem;
    padding: 0;
    width: 100%;
}

.filter-check {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    gap: 0.4rem;
}

.filter-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
}

/* With script the form submits on every change, so the button is only a fallback; it stays visible because
   the search box only submits on Enter or on leaving it. */
.admin-filter {
    align-items: center;
}

/* Exercise list */
.exercise-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    list-style: none;
    margin: 0;
    padding: 0;
}

.exercise-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
}

.exercise-card-link {
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
}

.exercise-card-link:hover .exercise-card-name {
    text-decoration: underline;
}

.exercise-card-name {
    font-weight: 600;
}

.exercise-card-summary {
    color: var(--ink-muted);
    display: -webkit-box;
    font-size: 0.9rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.exercise-card-materials {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag {
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink-muted);
    font-size: 0.75rem;
    padding: 0.05rem 0.55rem;
}

.tag.is-age {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: transparent;
    color: var(--ink);
}

.tag.is-hidden {
    border-style: dashed;
}

/* Exercise details */
.exercise-details-theme {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 0.5rem;
}

.exercise-details-name {
    font-size: 1.3rem;
    margin: 0 0 0.75rem;
}

.exercise-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 0.75rem;
    padding: 0.85rem 1.1rem;
}

.exercise-section h3 {
    color: var(--ink-muted);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}

.exercise-section p {
    margin: 0 0 0.5rem;
}

.exercise-section p:last-child,
.exercise-section ul:last-child {
    margin-bottom: 0;
}

.exercise-section ul {
    margin: 0 0 0.5rem;
    padding-left: 1.25rem;
}

.exercise-section li + li {
    margin-top: 0.2rem;
}

.exercise-columns {
    display: grid;
    gap: 0 0.75rem;
    grid-template-columns: 1fr;
}

.add-to-plan {
    margin-top: 1.5rem;
}

.add-to-plan-form {
    align-items: flex-end;
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

/* Info */
.info-list {
    padding-left: 1.25rem;
}

.info-list li + li {
    margin-top: 0.3rem;
}

.action-table {
    background: var(--card);
    border: 1px solid var(--border);
    border-collapse: separate;
    border-radius: var(--radius);
    border-spacing: 0;
    width: 100%;
}

.action-table th,
.action-table td {
    padding: 0.5rem 0.85rem;
    text-align: left;
}

.action-table th {
    border-bottom: 1px solid var(--border);
    color: var(--ink-muted);
    font-size: 0.85rem;
}

/* Lists of rows: plans, administrators */
.format-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.format-row {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.65rem 1rem;
}

.format-name {
    display: flex;
    flex-direction: column;
}

.format-sport {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.plan-link {
    color: inherit;
    flex: 1;
    font-weight: 600;
    text-decoration: none;
}

.plan-link .format-sport {
    font-weight: 400;
}

.plan-link:hover {
    text-decoration: underline;
}

.admin-add {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-add .auth-field {
    flex: 1 1 16rem;
}

.admin-list {
    margin-bottom: 0.75rem;
}

.admin-self {
    color: var(--ink-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

/* Revoking access is outlined rather than solid: it is not the primary action on a page about granting it. */
.admin-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
}

.admin-remove:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
}

/* Admin overview cards */
.sync-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sync-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.sync-head {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.sync-name {
    font-weight: 600;
}

.sync-meta {
    display: grid;
    gap: 0.2rem 1rem;
    grid-template-columns: auto 1fr;
    margin: 0;
}

.sync-meta dt {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.sync-meta dd {
    font-size: 0.85rem;
    margin: 0;
}

/* Age matrix. Scrolls sideways on a phone rather than squeezing seven columns of boxes, with the names
   pinned so a row can still be identified while scrolled. */
.matrix-scroll {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.age-matrix {
    border-collapse: collapse;
    width: 100%;
}

.age-matrix th,
.age-matrix td {
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: center;
    white-space: nowrap;
}

.age-matrix thead th {
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.age-matrix .matrix-name {
    background: var(--card);
    font-weight: 400;
    left: 0;
    max-width: 18rem;
    overflow: hidden;
    position: sticky;
    text-align: left;
    text-overflow: ellipsis;
}

.age-matrix .matrix-name a {
    color: var(--ink);
    text-decoration: none;
}

.age-matrix .matrix-name a:hover {
    text-decoration: underline;
}

.age-matrix .matrix-theme th {
    background: color-mix(in srgb, var(--accent) 12%, var(--card));
    font-size: 0.85rem;
    font-weight: 600;
    left: 0;
    position: sticky;
    text-align: left;
}

.age-matrix tr.is-hidden .matrix-name a {
    color: var(--ink-muted);
    text-decoration: line-through;
}

/* Exercise form */
.exercise-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-hint {
    margin-top: 0.25rem;
}

.check-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0.75rem 1rem;
}

.check-group legend {
    padding: 0 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.danger-zone {
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
}

.danger-zone p {
    margin: 0;
}

/* Plan editor */
.plan-details {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: 1fr;
    padding: 1rem;
}

.plan-details-actions {
    display: flex;
    justify-content: flex-end;
}

.share-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.share-row {
    display: flex;
    gap: 0.5rem;
}

.share-input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    flex: 1;
    font: inherit;
    font-size: 0.85rem;
    min-width: 0;
    padding: 0.5rem 0.7rem;
}

.plan-total {
    margin: 1.25rem 0 0;
}

.plan-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
}

.plan-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.plan-item-head {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.plan-item-name {
    color: var(--ink);
    font-weight: 600;
}

.plan-item-title {
    font-weight: 600;
}

.plan-item-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 0.35rem;
}

.plan-item-fields {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.plan-item-duration {
    align-items: center;
    color: var(--ink-muted);
    display: flex;
    flex-shrink: 0;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.plan-item-fields .plan-item-duration input {
    width: 4.5rem;
}

.plan-add {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.plan-add-free {
    display: flex;
    flex: 1 1 18rem;
    gap: 0.5rem;
}

.plan-add-free input {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    flex: 1;
    font: inherit;
    min-width: 0;
    padding: 0.5rem 0.7rem;
}

.picker {
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.85rem;
}

.picker-filters {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr;
}

.picker-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    max-height: 24rem;
    overflow-y: auto;
    padding: 0;
}

.picker-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
}

.picker .secondary-button {
    align-self: flex-start;
}

/* Shared plan */
.plan-meta {
    display: grid;
    gap: 0.2rem 1rem;
    grid-template-columns: auto 1fr;
    margin: 0 0 1rem;
}

.plan-meta dt {
    color: var(--ink-muted);
}

.plan-meta dd {
    margin: 0;
}

.plan-notes-text {
    white-space: pre-line;
}

.plan-part-heading {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.3rem;
}

.plan-step {
    margin-bottom: 1.5rem;
}

.plan-step-head {
    align-items: baseline;
    display: flex;
    font-size: 1.1rem;
    gap: 0.75rem;
    justify-content: space-between;
    margin: 0 0 0.25rem;
}

.plan-step-duration {
    color: var(--ink-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.plan-step-notes {
    font-style: italic;
    margin: 0 0 0.5rem;
}

.plan-step .exercise-details-theme {
    margin-top: 0;
}

/* Login */
.auth-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgb(18 16 14 / 10%);
    max-width: 24rem;
    padding: 2rem;
    width: 100%;
}

.auth-header {
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 1.4rem;
    margin: 0.75rem 0 0.25rem;
}

.auth-header p {
    color: var(--ink-muted);
    margin: 0;
}

.auth-note {
    color: var(--ink-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0.85rem 0 0;
    text-align: center;
}

.auth-note a {
    color: var(--accent-text);
}

.logout-form {
    margin: 0;
}

/* Only ever rendered inside the black header. The sign-in link shares the look, so both read as the one
   account control in the corner. */
.logout-button {
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--header-ink) 35%, transparent);
    border-radius: 8px;
    color: var(--header-ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}

.logout-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Framework defaults */
.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Er is een fout opgetreden.";
}

/* Global rather than scoped to a layout, so it is hidden on the login page too; Blazor reveals it with an
   inline display: block when something actually fails. */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

/* Two columns only once a card is wide enough for an exercise's name and summary to breathe. */
@media (min-width: 48rem) {
    .exercise-list,
    .sync-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .exercise-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .plan-details {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .plan-details .plan-notes {
        grid-column: 1 / -1;
    }

    .plan-details .plan-details-actions {
        grid-column: 1 / -1;
    }

    .picker-filters {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

/* Mobile header: brand and menu button on top, the links and the account control in a panel below that is
   only shown while open. */
@media (max-width: 43.99rem) {
    .app-header {
        column-gap: 0.75rem;
        display: grid;
        grid-template-columns: 1fr auto;
        padding: 0.5rem 0.75rem;
        row-gap: 0;
    }

    .app-brand {
        grid-area: 1 / 1;
    }

    .app-nav-button {
        align-items: center;
        block-size: 2.75rem;
        cursor: pointer;
        display: flex;
        grid-area: 1 / 2;
        inline-size: 2.75rem;
        justify-content: center;
        position: relative;
    }

    .app-nav {
        grid-area: 2 / 1 / 3 / -1;
    }

    .app-user {
        grid-area: 3 / 1 / 4 / -1;
    }

    /* Collapsed by height rather than display: none, which cannot animate; visibility: hidden also takes the
       closed panel out of the tab order. */
    .app-nav,
    .app-user {
        max-height: 0;
        overflow: hidden;
        transition: max-height 150ms ease, visibility 150ms;
        visibility: hidden;
    }

    .app-nav {
        flex-direction: column;
        gap: 0;
        margin: 0 -0.75rem;
    }

    .app-nav-toggle:checked ~ .app-nav {
        max-height: 15rem;
        visibility: visible;
    }

    .app-user {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .app-nav-toggle:checked ~ .app-user {
        border-top: 1px solid color-mix(in srgb, var(--header-ink) 12%, transparent);
        max-height: 10rem;
        padding-bottom: 0.75rem;
        padding-top: 0.75rem;
        visibility: visible;
    }

    .app-user-name {
        max-width: 100%;
    }

    .app-nav a {
        border-radius: 0;
        border-top: 1px solid color-mix(in srgb, var(--header-ink) 12%, transparent);
        display: block;
        padding: 0.75rem;
    }

    /* An edge bar rather than the desktop pill: the pill's tint over black turns brown across a full row. */
    .app-nav a.active {
        background: none;
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .app-nav-toggle:checked ~ .app-nav-button .app-nav-icon {
        background: transparent;
    }

    .app-nav-toggle:checked ~ .app-nav-button .app-nav-icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    .app-nav-toggle:checked ~ .app-nav-button .app-nav-icon::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .app-nav-toggle:focus-visible ~ .app-nav-button {
        outline: 2px solid var(--accent);
        outline-offset: -2px;
    }

    .app-main {
        padding: 1.25rem 0.75rem 2.5rem;
    }

    .plan-item-fields {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-nav,
    .app-nav-icon::before,
    .app-nav-icon::after {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #14120f;
        --card: #201d19;
        --ink: #f0ece7;
        --ink-muted: #a89e94;
        --border: #35302a;
        /* Orange is bright against a dark card, so text can use the accent itself. */
        --accent: #f5901f;
        --accent-text: #f5901f;
        --accent-ink: #12100e;
        --danger: #f2b8b5;
        --danger-surface: #3b1d1a;
        --header: #0c0b09;
    }
}

/* Print: the exercise or the training on paper, without the application around it. Always light, whatever
   the screen's scheme, since paper is white. */
@media print {
    :root {
        --surface: #ffffff;
        --card: #ffffff;
        --ink: #000000;
        --ink-muted: #444444;
        --border: #bbbbbb;
    }

    .app-header,
    .no-print,
    .breadcrumb,
    #blazor-error-ui,
    #components-reconnect-modal {
        display: none !important;
    }

    .app-main {
        max-width: none;
        padding: 0;
    }

    body {
        font-size: 11pt;
    }

    .exercise-section {
        border: none;
        border-left: 2px solid var(--border);
        border-radius: 0;
        break-inside: avoid;
        margin-top: 0.4rem;
        padding: 0.2rem 0 0.2rem 0.75rem;
    }

    .plan-step {
        break-inside: avoid-page;
    }

    .plan-part-heading {
        break-after: avoid;
    }

    .exercise-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}
