/* Phinix base styles: mobile first, no build step (E39). Values from the design of 09.11.2026
   (docs/OBERFLAECHE.md section 1 is the table they come from). */
:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --fg: #111B32;
  --muted: #46526A;
  --accent: #4F46E5;
  --accent-hover: #3730A3;
  --on-accent: #FFFFFF;
  --border: #69758B;
  --line: #D8DDE8;
  --soft: #EEF0FF;
  --danger: #B42318;
  --on-danger: #FFFFFF;
  --danger-bg: #FEECEB;
  --info-bg: #E9EDFF;
  --info-fg: #273F91;
  --success-bg: #E2F4EA;
  --success-fg: #165B3B;
  --slot-0: #F0F3F7;
  --slot-1: #E3EAF0;
  --slot-2: #C7D5DF;
  --slot-3: #A4BAC7;
  --shadow: 0 12px 30px rgba(17, 27, 50, .07);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1424;
    --surface: #172238;
    --fg: #F3F5FC;
    --muted: #BAC2D5;
    --accent: #A9A5FF;
    --accent-hover: #C3C0FF;
    --on-accent: #0D1424;
    --border: #8795AC;
    --line: #35425A;
    --soft: #252C50;
    --danger: #FFAAA3;
    --on-danger: #0D1424;
    --danger-bg: #3B2028;
    --info-bg: #202D50;
    --info-fg: #C9D2FF;
    --success-bg: #16372D;
    --success-fg: #B7F1D0;
    --slot-0: #202A3C;
    --slot-1: #2C3C4C;
    --slot-2: #3B5061;
    --slot-3: #526B7C;
    /* Dark: outline and a little surface difference instead of a strong shadow */
    --shadow: none;
  }
}
* { box-sizing: border-box; }
/* Column layout: on short pages the footer stays at the bottom edge instead of mid-screen. */
body {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
/* Focus: 3 px ring in the accent colour with a gap, independent of hover; never suppressed. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .75rem; z-index: 10; background: var(--surface); padding: .75rem 1rem; border-radius: .6rem; }
h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin: 0 0 .75rem; }
h2 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.lead { font-size: 1.125rem; color: var(--muted); margin: 0 0 1rem; }
/* Small line above h1 */
.eyebrow { margin: 0 0 .75rem; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.intro { margin-bottom: 2rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code { overflow-wrap: anywhere; }

/* Header: mark + name, on a PC the area links as a bar below and the account on the right;
   on a phone one menu (details, works without JavaScript). */
.site-header { position: relative; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 75rem; margin: 0 auto; padding: .75rem 1.25rem; min-height: 4.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 800; font-size: 1.3rem; letter-spacing: -.04em; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.brandmark { display: block; flex: none; }
.brandmark img { display: block; width: 29px; height: 29px; }
.nav-main, .account { display: none; }
.nav-main a, .mobile-menu a { color: var(--muted); font-weight: 650; text-decoration: none; border-radius: .5rem; }
.nav-main a[aria-current="page"], .mobile-menu a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.nav-main a:hover, .mobile-menu a:hover { color: var(--fg); text-decoration: underline; }
.account { align-items: center; gap: 1rem; font-size: .85rem; min-width: 0; }
.account form, .mobile-menu form { margin: 0; }
/* Link to the account page; muted so it stays apart from the area links */
.who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; min-width: 0; }
.account button.link { color: var(--muted); font-size: inherit; }
.mobile-nav summary { list-style: none; display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 .5rem; font-weight: 700; cursor: pointer; border-radius: .5rem; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-menu { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; padding: .5rem 1.25rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 30px rgba(17, 27, 50, .12); }
.mobile-menu a, .mobile-menu button.link { display: flex; align-items: center; min-height: 2.75rem; padding: .5rem .75rem; color: var(--fg); font-size: 1rem; font-weight: 400; text-decoration: none; width: 100%; text-align: left; border-radius: .5rem; }
.mobile-menu button.link:hover { background: var(--soft); }
.guest-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25rem; }
/* Phones: both links next to the mark down to about 360 px (system fonts set bold wider) */
.guest-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .45rem; font-size: .9375rem; font-weight: 700; color: var(--fg); text-decoration: none; border-radius: .5rem; }
.guest-nav a:hover { text-decoration: underline; }
/* Narrow phones (360 px): a little smaller so name and both links stay in one line; below, they wrap. */
@media (max-width: 24rem) {
  .brand { font-size: 1.15rem; gap: .45rem; }
  .guest-nav a { padding: 0 .35rem; font-size: .875rem; }
}
@media (min-width: 53.25rem) {
  .header-inner { display: grid; grid-template-columns: auto 1fr auto; padding: .75rem 2rem .4rem; }
  .brand { grid-column: 1; grid-row: 1; }
  .account { display: flex; grid-column: 3; grid-row: 1; justify-self: end; }
  .guest-nav { grid-column: 3; grid-row: 1; justify-self: end; }
  .nav-main { display: flex; flex-wrap: wrap; gap: .25rem; grid-column: 1 / -1; grid-row: 2; margin-left: -.75rem; }
  .nav-main a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; font-size: .9rem; }
  .mobile-nav { display: none; }
}

main { flex: 1 0 auto; width: 100%; max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
/* Moderation: wide working area (design 09.11.2026) */
main.wide { max-width: 71.5rem; }
@media (min-width: 53.25rem) {
  main { padding: 3.25rem 2rem 5rem; }
  h1 { font-size: 2.5rem; line-height: 1.1; }
}
main > .msg { margin-bottom: 1rem; }

/* E22: imprint and privacy policy on every page; long legal texts break anywhere (URLs). */
.site-footer { border-top: 1px solid var(--line); padding: 1.25rem 1.25rem 2rem; font-size: .875rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; }
.site-footer a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); }
.legal { overflow-wrap: anywhere; }
.legal h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.legal h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }

/* Buttons: one main action per form; grow and wrap with long texts. */
button:not(.link), a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .7rem 1.2rem; border: 1px solid transparent; border-radius: .625rem;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; line-height: 1.3;
  text-align: center; text-decoration: none; cursor: pointer;
}
button:not(.link):hover, a.button:hover { background: var(--accent-hover); }
button:not(.link):active, a.button:active { transform: translateY(1px); }
button.secondary { background: var(--surface); color: var(--fg); border-color: var(--border); }
button.secondary:hover { background: var(--soft); }
button.danger { background: var(--danger); color: var(--on-danger); }
button.danger:hover { background: var(--danger); filter: brightness(.9); }
button:disabled, button:disabled:hover { background: var(--line); color: var(--muted); border-color: var(--line); cursor: not-allowed; transform: none; filter: none; }
/* Looks like a link: "Abmelden" (a POST form), "… als vertraut merken" */
button.link { display: inline-flex; align-items: center; min-height: 2.75rem; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { text-decoration-thickness: 2px; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 1rem; margin: 1.25rem 0; }
.stack > button, .stack > a.button { align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: .4rem; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea {
  display: block; width: 100%; min-height: 2.75rem; padding: .6rem .75rem;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: .625rem;
  font: inherit; font-weight: 400;
}
textarea { resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--danger); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
/* Native file chooser keeps working without JavaScript; the browser writes the file name. */
input[type="file"] { display: block; width: 100%; max-width: 100%; min-height: 3.1rem; padding: .3rem; background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: .6rem; font: inherit; font-weight: 400; cursor: pointer; }
input[type="file"]::file-selector-button { min-height: 2.4rem; margin: 0 .5rem 0 0; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: .4rem; background: var(--surface); color: var(--fg); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
input[type="file"]:hover::file-selector-button { background: var(--soft); }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; }
/* Hints inside a label: not bold like the label itself. */
.field .hint { font-weight: 400; font-size: .875rem; }
.hint { color: var(--muted); margin: 0; font-size: .875rem; }
.form-title { font-size: 1.375rem; margin: 2.25rem 0 .75rem; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.checks legend { font-weight: 600; margin-bottom: .5rem; }
/* Whole label clickable, at least 44 px high */
.check { display: flex; gap: .7rem; align-items: flex-start; min-height: 2.75rem; padding: .55rem 0; font-weight: 400; }
.check input { margin-top: .1rem; }
/* A choice as a card (booking page): framed, chosen = accent frame and tinted surface */
.check.choice { padding: .9rem 1rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--surface); }
.check.choice:has(input:checked) { border: 2px solid var(--accent); padding: calc(.9rem - 1px) calc(1rem - 1px); background: var(--soft); }
.choice strong { overflow-wrap: anywhere; }
.choice .preview.thumb { margin-bottom: .4rem; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.row > .field { flex: 1 1 9rem; }
.row > .msg, .row > .hint { flex: 1 1 100%; }
form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
form.inline .field { flex: 1 1 10rem; }
form.inline > .hint { align-self: center; margin: 0; }
.offscreen { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
progress { width: 100%; height: .75rem; accent-color: var(--accent); }

/* Confirmation window (confirm.js): instead of the browser's confirm(). */
dialog.confirm { max-width: min(28rem, calc(100vw - 2rem)); padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--fg); box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .3); }
dialog.confirm::backdrop { background: rgba(13, 20, 36, .6); }
dialog.confirm h2 { margin: 0; font-size: 1.2rem; }
dialog.confirm p { margin: 0; }
dialog.confirm .stack { margin: 0; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; }

/* Messages: surface and matching text colour */
.msg { margin: 0; padding: .75rem 1rem; border-radius: .6rem; background: var(--info-bg); color: var(--info-fg); }
.msg-error { background: var(--danger-bg); color: var(--danger); }
.msg-success { background: var(--success-bg); color: var(--success-fg); }
.msg a { color: inherit; }
.links { display: flex; flex-direction: column; gap: .5rem; }

/* Cards: surface, radius, generous padding; children stacked with an even gap */
.cards { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.card { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.card > * { margin-top: 0; margin-bottom: 0; }
section.card { margin: 0 0 1.25rem; }
@media (min-width: 53.25rem) { .card { padding: 1.5rem; } }
/* Wide page (moderation): cards side by side, each about a readable column wide */
@media (min-width: 60rem) { main.wide .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); align-items: start; } }
.card-title { font-weight: 700; }
/* Booking steps: number, title and a short line */
.step { display: flex; gap: .9rem; align-items: flex-start; }
.step-number { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .6rem; background: var(--soft); color: var(--accent); font-weight: 800; }
.step h2 { margin: .1rem 0 .15rem; font-size: 1.25rem; }
.step p { margin: 0; color: var(--muted); font-size: .9rem; }
/* Screen page: address with the screen */
.location { color: var(--muted); }
.tags { line-height: 2; }

/* Badges: always a written status, colour only adds to it */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 1rem; font-size: .8rem; font-weight: 700; background: var(--info-bg); color: var(--info-fg); }
.badge-ok { background: var(--success-bg); color: var(--success-fg); }
.badge-off { background: var(--danger-bg); color: var(--danger); }

/* Tables (administration) */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
/* Long values in table cells (e-mail addresses): wrap instead of widening the table on phones. */
td.wrap { white-space: normal; overflow-wrap: anywhere; }

/* Second factor (account page) */
.qr { display: block; background: #fff; padding: .75rem; border-radius: .6rem; }
code.secret { display: inline-block; font-size: 1rem; word-break: break-all; padding: .3rem .5rem; border-radius: .4rem; background: var(--bg); }
.codes { columns: 2; padding-left: 1.5rem; margin: 0; font-size: 1rem; }

/* Administration */
.subnav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.5rem; }
.subnav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; border-radius: .5rem; color: var(--muted); font-weight: 650; text-decoration: none; }
.subnav a:hover { color: var(--fg); text-decoration: underline; }
.subnav a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
code.url { overflow-wrap: anywhere; word-break: break-all; }
/* Media (E7): previews keep their aspect ratio, at most the card width or 20rem high. */
/* align-self: in a flex card the default stretch would distort portrait images. */
.preview { display: block; align-self: flex-start; max-width: 100%; max-height: 20rem; border-radius: .6rem; background: var(--line); }
/* Videos take the card width, but not more than a readable column on the wide moderation page */
video.preview { align-self: flex-start; width: 100%; max-width: 40rem; }
/* Small preview next to a choice (booking page, own bookings). */
.preview.thumb { max-height: 5rem; margin-bottom: .25rem; }

/* Fold-out areas: visible open/closed state, large enough summary */
details > summary { cursor: pointer; }
.filters { margin: .75rem 0; }
.filters summary, details.reject > summary, details.appeal > summary, details.link > summary { display: flex; align-items: center; min-height: 2.75rem; font-weight: 700; color: var(--accent); }
details.reject, details.appeal, details.link { border-top: 1px solid var(--line); padding-top: .25rem; }
.filter-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; margin: .75rem 0 0; }
.filter-form .field { font-weight: 600; }
.filter-form .field .hint { font-size: .85rem; }
.filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

/* Review list (E97): small previews in a grid, pages. */
.grid { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: .15rem; min-width: 0; font-size: .85rem; }
/* Square frame, whole image visible (contain): the moderator must see everything the screen shows. */
.tile-link { position: relative; display: block; aspect-ratio: 1; border-radius: .75rem; overflow: hidden; background: var(--line); }
.tile-link img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tile-badge { position: absolute; right: .35rem; bottom: .35rem; padding: .1rem .45rem; border-radius: .35rem; background: rgba(13, 20, 36, .8); color: #fff; font-weight: 700; }
.tile-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.pager a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Incident report (E98): previews to pick with a radio button. */
.pick-tile { display: flex; flex-direction: column; gap: .2rem; cursor: pointer; }
.pick-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-tile .tile-link { outline: 3px solid transparent; outline-offset: 2px; }
.pick-tile input:checked + .tile-link { outline-color: var(--accent); }
.pick-tile input:focus-visible + .tile-link { outline-color: var(--accent); outline-style: dashed; }
.report-link { margin-top: 2rem; font-size: .9rem; color: var(--muted); }
.reports .card { gap: .4rem; }
.report-media { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
.report-media .tile-link { flex: 0 0 6rem; }
.report-text { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
/* E152: "Freigeben" and "Überspringen" on one line on the review page */
.review-actions { align-items: center; }
/* E103: found QR codes and addresses on the moderation pages, long values wrap */
.found-links ul { margin: .25rem 0; padding-left: 1.1rem; }
.found-links li { margin-bottom: .35rem; }
.link-value { display: block; overflow-wrap: anywhere; font-size: .9rem; }
.found-links button.link { text-align: left; font-size: .9rem; }  /* E109: "… als vertraut merken" */

/* Week overview (E114): days as columns, hours as rows; on phones one day per screen width.
   The page gets the full width on a PC, all seven days side by side. Calm tone steps for the
   load (not the accent: the cells are no choice); the written count carries the meaning. */
main:has(> .week-wrap) { max-width: 90rem; }
.week-wrap { scroll-snap-type: x mandatory; }
.week { table-layout: fixed; width: auto; min-width: 100%; }
.week th, .week td { vertical-align: top; border: 1px solid var(--line); padding: .3rem .4rem; }
.week thead th { position: sticky; top: 0; background: var(--bg); }
.week th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--bg); font-weight: 600; width: 6.5rem; }
.week td { width: 9rem; min-width: calc(100vw - 8.5rem); scroll-snap-align: end; white-space: normal; color: var(--fg); }
.week thead th.today { color: var(--fg); box-shadow: inset 0 -3px var(--border); }
.week td.level-0 { background: var(--slot-0); }
.week td.level-1 { background: var(--slot-1); }
.week td.level-2 { background: var(--slot-2); }
.week td.level-3 { background: var(--slot-3); }
.week td.closed { background-image: repeating-linear-gradient(135deg, transparent 0 .45rem, var(--line) .45rem .65rem); }
.week td .hint { color: var(--fg); }
.week td a { display: flex; flex-direction: column; gap: .2rem; color: var(--fg); text-decoration: none; min-height: 2.75rem; }
/* The accent ring is too weak on the darker steps; the text colour contrasts with all of them. */
.week td a:focus-visible { outline: 3px solid var(--fg); outline-offset: 1px; }
.week td a .badge { align-self: flex-start; }
.cell-count { font-weight: 700; font-size: .85rem; }
.cell-media { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; }
.cell-thumb { width: 2.5rem; height: 2.5rem; object-fit: contain; background: var(--surface); border-radius: .25rem; vertical-align: middle; }
@media (min-width: 48rem) { .week td { min-width: 7.5rem; } }
