* { box-sizing: border-box; }
html { font: 16px/1.6 var(--wn-font); color: var(--wn-text); background: var(--wn-bg); }
body { background: var(--wn-bg); margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
::selection { color: var(--wn-text); background: var(--wn-selection); }
h1, h2, h3 { line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); margin: 0 0 1rem; }
h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; overflow-wrap: anywhere; }
a { color: var(--wn-primary); text-underline-offset: .2em; }
a:hover { color: var(--wn-primary-hover); }
/* An internal reference in a note read without JavaScript (NoteReferences.Html; in the editor .cm-note-reference): the
   reference as written reads as a link in the accent colour. */
.note-reference { color: var(--wn-primary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a.note-reference:hover { color: var(--wn-primary-hover); text-decoration-thickness: 2px; }
/* A reference with several notes, without JavaScript: the reference opens the first, each small number another one. */
.note-reference-more { margin-inline-start: .15em; }
@media (forced-colors: active) { a.note-reference { color: LinkText; } }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--wn-primary); outline-offset: 3px; }
mark, .text-highlight { color: var(--wn-text); background: var(--wn-highlight); padding: .05em .2em; border-radius: 3px; }
.text-muted, .help-text { color: var(--wn-muted); }
.help-text { font-size: .875rem; }
.prose { max-width: 72ch; line-height: 1.7; }
.prose blockquote { margin-inline: 0; padding: .75rem 1rem; background: var(--wn-active-line); border-inline-start: 3px solid var(--wn-primary); }
.active-line { background: var(--wn-active-line); border-inline-start: 3px solid var(--wn-primary); padding: .25rem .75rem; }
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1rem clamp(1rem, 4vw, 3rem); background: var(--wn-surface); border-bottom: 1px solid var(--wn-border); }
.brand { color: var(--wn-primary); font-size: 1.4rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.user-name { max-width: 22ch; overflow-wrap: anywhere; margin-inline-end: .5rem; font-size: .875rem; color: var(--wn-muted); }
.language-selector { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .875rem; }
.language-selector label { color: var(--wn-muted); }
.language-selector select { max-width: 100%; min-height: 44px; padding: .4rem .6rem; border: 1px solid var(--wn-border); border-radius: var(--wn-radius); background: var(--wn-surface); color: var(--wn-text); }
.site-main { flex: 1; width: 100%; max-width: 78rem; margin-inline: auto; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem); }
.site-footer { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding: .75rem clamp(1rem, 4vw, 3rem); background: var(--wn-surface); border-top: 1px solid var(--wn-border); font-size: .8rem; color: var(--wn-muted); }
.application-version { margin-inline-start: auto; text-align: end; }
.welcome { max-width: 48rem; margin: 2rem auto; padding: clamp(1.5rem, 5vw, 3rem); }
.welcome .actions { margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: var(--wn-radius); font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; transition: background var(--wn-motion), color var(--wn-motion), border-color var(--wn-motion); }
.btn-primary { color: var(--wn-on-primary); background: var(--wn-primary); border-color: var(--wn-primary); }
.btn-primary:hover { color: var(--wn-on-primary); background: var(--wn-primary-hover); border-color: var(--wn-primary-hover); }
.btn-primary:active { background: var(--wn-primary-active); }
.btn-secondary { background: var(--wn-surface); color: var(--wn-text); border-color: var(--wn-input-border); }
.btn-secondary:hover { color: var(--wn-primary-hover); background: var(--wn-active-line); }
.btn-ghost { color: var(--wn-primary); background: transparent; }
.btn-ghost:hover { color: var(--wn-primary-hover); background: var(--wn-selection); }
.btn-danger { color: var(--wn-on-primary); background: var(--wn-danger); }
.btn-danger:hover { color: var(--wn-danger); background: var(--wn-danger-bg); border-color: var(--wn-danger); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--wn-disabled-bg); color: var(--wn-disabled-text); border-color: transparent; box-shadow: none; cursor: not-allowed; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.account-card { width: 100%; max-width: 33rem; margin-inline: auto; padding: clamp(1.25rem, 4vw, 2.5rem); }
.account-card h1 { font-size: 1.8rem; margin-bottom: 1.75rem; }
.page-panel { width: 100%; max-width: 60rem; margin-inline: auto; padding: clamp(1.25rem, 4vw, 2.5rem); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin-bottom: .25rem; font-size: 1.8rem; }
.page-heading p { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: .75rem .5rem; border-bottom: 1px solid rgb(36 58 54 / 14%); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.data-table thead th { font-size: .8rem; font-weight: 650; color: var(--wn-muted); text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody th { font-weight: 600; }
.data-table__text { white-space: pre-line; }
.data-table__nowrap { white-space: nowrap; overflow-wrap: normal; }
.data-table .actions { justify-content: flex-end; flex-wrap: nowrap; }
/* Action labels stay whole; the text columns absorb the remaining width. */
.data-table td:has(> .actions) { width: 1%; }
.data-table .btn { white-space: nowrap; overflow-wrap: normal; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.account-card form > .btn { margin-top: .75rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--wn-input-border); border-radius: var(--wn-radius); color: var(--wn-text); background: var(--wn-surface); }
.field input:hover, .field textarea:hover { border-color: var(--wn-primary); }
.field input[readonly], .field input:disabled { background: var(--wn-bg); color: var(--wn-muted); }
.field [aria-invalid="true"], .field .input-validation-error { border-color: var(--wn-danger); background: var(--wn-danger-bg); }
.field-error { font-size: .85rem; color: var(--wn-danger); }
.field-error:empty { display: none; }
.validation-summary-valid { display: none; }
.validation-summary-errors { box-shadow: var(--wn-shadow-note); padding: .75rem 1rem; margin-bottom: 1rem; border-inline-start: 3px solid var(--wn-danger); border-radius: 4px; color: var(--wn-danger); background: var(--wn-danger-bg); }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.2rem; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--wn-primary); }
.check label { cursor: pointer; }
/* Save results (Pages/Shared/_StatusMessage.cshtml): success, warning and error. The region is fixed at the top of
   the window, centred (inside a dialog when the message belongs to it); it lets clicks through around its messages
   and scrolls when many are open. A message stays until its close button, a form with method="dialog", closes it. */
.status-region { position: fixed; z-index: 30; top: 0; inset-inline: 0; margin-inline: auto; display: flex; flex-direction: column; gap: .5rem; width: min(28rem, 100%); max-height: 100%; padding: 1rem; overflow-y: auto; pointer-events: none; }
.status-message { position: static; display: flex; align-items: flex-start; gap: .65rem; flex: none; width: auto; max-width: none; margin: 0; padding: .65rem .35rem .65rem .9rem; border: 0; border-inline-start: 4px solid var(--status-accent); border-radius: var(--wn-radius); color: var(--wn-text); background: var(--status-bg); box-shadow: var(--wn-shadow-raised); pointer-events: auto; }
.status-message:not([open]) { display: none; }
/* A short entrance, also when a repeated save replaces an identical message; none with reduced motion. */
.status-message { animation: status-message-enter 160ms ease-out; }
@keyframes status-message-enter { from { opacity: 0; transform: translateY(-.5rem); } }
.status-message--success { --status-accent: var(--wn-primary); --status-bg: var(--wn-success-bg); }
.status-message--warning { --status-accent: var(--wn-warning); --status-bg: var(--wn-warning-bg); }
.status-message--error { --status-accent: var(--wn-danger); --status-bg: var(--wn-danger-bg); }
.status-message svg { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status-message__icon { margin-top: .15rem; color: var(--status-accent); }
.status-message__text { flex: 1; min-width: 0; margin: .1rem 0 0; overflow-wrap: anywhere; }
.status-message__actions { display: contents; }
.status-message__close { flex: none; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin: -.55rem 0; padding: 0; border: 0; border-radius: var(--wn-radius); color: var(--wn-muted); background: transparent; cursor: pointer; }
.status-message__close:hover { color: var(--wn-text); background: rgb(36 58 54 / 8%); }
.status-message__close:active { background: rgb(36 58 54 / 14%); }
@media (forced-colors: active) { .status-message { border: 1px solid CanvasText; } }
@media (max-width: 700px) { .language-selector { margin-inline-start: auto; } .welcome { margin-block: .5rem; } .data-table thead { display: none; } .data-table tr { display: block; padding: .75rem 0; border-bottom: 1px solid rgb(36 58 54 / 14%); } .data-table th, .data-table td { display: block; padding: .25rem 0; border: 0; } .data-table .actions { justify-content: flex-start; flex-wrap: wrap; margin-top: .5rem; } .data-table td:has(> .actions) { width: auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .btn { border: 1px solid ButtonText; } }
/* Overlay for forms opened over a page; the same look applies with or without JavaScript. */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 1rem; border: 0; color: var(--wn-text); background: rgb(24 42 37 / 35%); overflow-y: auto; }
.modal::backdrop { background: transparent; }
.modal-panel { width: 100%; max-width: 33rem; margin-block: 1rem; padding: clamp(1.25rem, 4vw, 2.5rem); }
.modal-panel--wide { max-width: 46rem; }
.modal-form { margin-top: 1.5rem; }
.modal-panel h2 { margin-top: 0; font-size: 1.6rem; margin-bottom: 1.5rem; }
body:has(.modal[open]:not(.note-editor-dialog--minimized)) { overflow: hidden; }
@media (forced-colors: active) { .modal-panel { border: 1px solid CanvasText; } }
