/* Fahrlizenz - look after docs/design-vorlage.md and the colleague's prototype
   (src/app/globals.css). System fonts only: nothing is loaded from anywhere. */

:root {
  /* Colours (design-vorlage.md, "Farben") */
  --navy-950: #050a18;
  --navy-900: #0a1128;
  --navy-850: #0d1633;
  --navy-800: #111c3f;
  --navy-700: #1b2a5c;
  --navy-600: #26397a;
  --coral-600: #d9463b;
  --coral-500: #f55a4d;
  --coral-400: #ff7a63;
  --orange-400: #ff8a3d;
  --helix-blue: #3b6cff;
  --helix-violet: #7b3bff;
  --helix-magenta: #c53bff;
  --helix-lavender: #b8c4f5;
  --mint-400: #34d399;
  --mint-300: #6ee7b7;
  --ink-50: #f4f6fb;
  --ink-200: #c9d1e8;
  --ink-400: #9aa6c9;
  --ink-500: #6f7ba3; /* placeholders and decoration only, never small readable text */

  --card-border: rgba(184, 196, 245, 0.12);
  --line: rgba(184, 196, 245, 0.1);
  --line-faint: rgba(184, 196, 245, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  --focus: 3px solid rgba(255, 138, 61, 0.8);

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* `.actions` further down sets display:flex, which beats the browser default
   for [hidden] - without this, a hidden action block still shows. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--navy-950);
  color: var(--ink-50);
  font: 400 1rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

a { color: var(--coral-400); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: var(--focus); outline-offset: 3px; }

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 0.25rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }

.muted { color: var(--ink-400); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Background: three soft lights over navy (.bg-stage) ------------------ */
.bg-stage {
  background-color: var(--navy-950);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(59, 108, 255, 0.28), transparent 60%),
    radial-gradient(700px 500px at -10% 40%, rgba(123, 59, 255, 0.22), transparent 60%),
    radial-gradient(600px 400px at 60% 110%, rgba(197, 59, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #070d20 0%, #050a18 100%);
  background-attachment: fixed;
}

/* --- Building blocks ------------------------------------------------------ */
.card {
  background: linear-gradient(180deg, rgba(17, 28, 63, 0.85), rgba(10, 17, 40, 0.9));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 1.25rem;
}

.text-gradient-brand {
  background: linear-gradient(90deg, #ff7a63 0%, #f55a4d 40%, #c53bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 1rem 0 0.5rem;
}
.label:first-child { margin-top: 0; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 0;
}
.eyebrow.coral { color: var(--coral-400); }

.stripe {
  height: 3px;
  width: 3rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f55a4d, #ff8a3d);
}

.input {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  border-radius: 16px;
  background: rgba(5, 10, 24, 0.6);
  border: 1px solid rgba(184, 196, 245, 0.18);
  color: var(--ink-50);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder { color: var(--ink-500); }
.input:focus {
  outline: none;
  border-color: rgba(255, 122, 99, 0.7);
  box-shadow: 0 0 0 4px rgba(245, 90, 77, 0.18);
}
.input[aria-invalid="true"] { border-color: rgba(245, 90, 77, 0.8); }
.input.is-error { border-color: var(--coral-500); box-shadow: 0 0 0 2px rgba(245, 90, 77, 0.25); }
select.input { padding-right: 2.5rem; }
.input.code {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.wide { width: 100%; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #ff7a63 0%, #f55a4d 55%, #e64a3d 100%);
  box-shadow: 0 10px 30px -10px rgba(245, 90, 77, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 14px 36px -10px rgba(245, 90, 77, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

.btn-secondary {
  color: var(--ink-50);
  background: rgba(184, 196, 245, 0.08);
  border: 1px solid rgba(184, 196, 245, 0.18);
}
.btn-secondary:hover { background: rgba(184, 196, 245, 0.14); }

.btn-ghost { color: var(--ink-200); background: transparent; }
.btn-ghost:hover { background: rgba(184, 196, 245, 0.08); }

/* Like btn-ghost, with a visible border in the secondary buttons' colour. */
.btn-outline { color: var(--ink-200); background: transparent; border: 1px solid rgba(184, 196, 245, 0.18); }
.btn-outline:hover { background: rgba(184, 196, 245, 0.08); }

/* A dangerous action that is not the main one: outlined in coral, no fill. */
.btn-danger { color: var(--coral-400); background: transparent; border: 1px solid var(--coral-400); }
.btn-danger:hover { background: rgba(245, 90, 77, 0.1); }

.btn-sm { min-height: 2.75rem; padding: 0 1rem; font-size: 0.9375rem; border-radius: 12px; }

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

/* Status pills: outlined, upper case. The text carries the meaning, not the colour. */
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(184, 196, 245, 0.2);
  background: rgba(184, 196, 245, 0.05);
  color: var(--ink-200);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.pill.mint { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: var(--mint-300); }
.pill.coral { border-color: rgba(245, 90, 77, 0.4); background: rgba(245, 90, 77, 0.1); color: var(--coral-400); }
.pill.blue { border-color: rgba(59, 108, 255, 0.4); background: rgba(59, 108, 255, 0.1); color: var(--helix-lavender); }

/* Messages and refusals */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.notice {
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  border: 1px solid rgba(184, 196, 245, 0.2);
  background: rgba(184, 196, 245, 0.06);
}
.notice.error, .messages .error { border-color: rgba(245, 90, 77, 0.4); background: rgba(245, 90, 77, 0.1); color: var(--coral-400); }
.notice.success, .messages .success, .messages .info { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: var(--mint-300); }
.errorlist { list-style: none; padding: 0; margin: 0.4rem 0 0; color: var(--coral-400); font-size: 0.9rem; }
.field-error { margin: 0.35rem 0 0; color: var(--coral-400); font-size: 0.85rem; }

.hint { font-size: 0.9rem; color: var(--ink-400); margin-top: 1rem; }
.prize-line { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: var(--mint-300); margin-top: 0.75rem; }
.prize-hint { font-size: 0.9rem; color: var(--ink-400); margin: 1rem 0 0.5rem; }
.hint strong { color: var(--ink-200); }

/* --- Participant screens --------------------------------------------------- */
.visitor {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1rem, env(safe-area-inset-bottom));
}
.visitor-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; }
.visitor-top img { display: block; width: clamp(100px, 32vw, 140px); height: auto; }
/* With the DE/EN switch beside it, "Sign out" stays on one line at 375 px. */
.visitor-top .btn { white-space: nowrap; }
.visitor-top form { margin: 0; }
.visitor-hero { margin-top: 2.5rem; }
.visitor-hero h1 { font-size: 2.35rem; line-height: 1.05; margin-top: 0.75rem; }
.visitor-hero .stripe { margin-top: 1.25rem; }
.visitor-hero .lead { margin-top: 1.25rem; font-size: 1.125rem; color: var(--ink-200); }
.visitor .card { margin-top: 2rem; }
.visitor-foot { margin-top: auto; padding-top: 2.5rem; }
.visitor-foot img { display: block; width: 100%; height: 6rem; opacity: 0.8; }
.visitor-foot p { text-align: center; font-size: 0.8rem; color: var(--ink-400); margin: 0.25rem 0 0; }

.signed-in-name { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 0.25rem 0 0; overflow-wrap: anywhere; }

/* --- Admin ---------------------------------------------------------------- */
.admin { display: flex; min-height: 100vh; min-height: 100dvh; }

.admin-side {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 15rem;
  flex-shrink: 0;
  flex-direction: column;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.7);
}
.admin-side img { display: block; width: 130px; height: auto; }
.admin-side .eyebrow { margin-top: 0.5rem; }
.admin-side nav { margin-top: 1.5rem; }
.admin-side-foot { margin-top: auto; font-size: 0.8rem; color: var(--ink-400); }
.admin-side-foot p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  color: var(--ink-200);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.admin-nav a:hover { background: rgba(184, 196, 245, 0.08); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(245, 90, 77, 0.15); color: #fff; }

.admin-body { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.admin-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.admin-top img { display: block; width: 100px; height: auto; }

/* The phone menu: <details>, so it works without a script. */
.admin-menu { position: relative; }
.admin-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 12px;
  color: var(--ink-200);
  font-size: 1.25rem;
  cursor: pointer;
}
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary:hover { background: rgba(184, 196, 245, 0.08); }
.admin-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(5, 10, 24, 0.97);
  box-shadow: var(--shadow-card);
}
.admin-menu-panel form { margin-top: 0.75rem; }

.admin-main { flex: 1; padding: 1.5rem 1rem 3rem; max-width: 64rem; width: 100%; }
.page-head { margin-bottom: 1.25rem; }
.page-head p { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--ink-400); }

@media (min-width: 1024px) {
  .admin-side { display: flex; }
  .admin-top { display: none; }
  .admin-main { padding: 2rem; }
}

/* Forms in the admin: a card, labels above fields */
.form-card { max-width: 32rem; }

/* --- QR page -------------------------------------------------------------- */
.qr-name { font-size: 1.75rem; font-weight: 700; margin: 0.25rem 0 1rem; overflow-wrap: anywhere; }
.qr-frame { margin: 0; }
/* Black on white, whatever the page: a camera needs the contrast. */
.sign-in-qr {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  background: #fff;
  border-radius: 16px;
}
.qr-frame figcaption { margin-top: 0.75rem; font-size: 0.9rem; color: var(--ink-400); }

/* --- Motion --------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

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

.qr-card { display: inline-block; max-width: 100%; }
.desk-code-label { margin: 1.25rem 0 0; color: var(--ink-400); }
.desk-code { margin: 0.25rem 0 0; font-size: 2rem; font-weight: 700; letter-spacing: 0.12em; }

/* --- Participant list: built for the registration desk -------------------- */
/* The search stays in reach while scrolling. Below 1024 px it sits under the
   sticky top bar, above it at the very top. */
.people-search {
  position: sticky;
  top: var(--admin-top-height, 0px);
  z-index: 20;
  margin: 0 -1rem 1rem;
  padding: 0.5rem 1rem;
  background: rgba(5, 10, 24, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.admin { --admin-top-height: 4.25rem; }
@media (min-width: 1024px) {
  .admin { --admin-top-height: 0px; }
  .people-search { margin: 0 -2rem 1rem; padding: 0.75rem 2rem; }
}

.people-card { padding: 0; overflow: hidden; }
.people-head {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.people { list-style: none; margin: 0; padding: 0; }
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line-faint);
}
.person-row:last-child { border-bottom: 0; }
.person-row:hover { background: rgba(184, 196, 245, 0.04); }
.person-row.empty { color: var(--ink-400); padding: 1rem; }
.person-row .who { min-width: 0; }
.person-row .row-actions { display: flex; flex: none; gap: 0.5rem; }
.person-row p { margin: 0; line-height: 1.35; }
.person-row .line1 { font-size: 1rem; }
.person-row .line1 .pill { margin-left: 0.25rem; }
.person-row .line2 { font-size: 0.85rem; color: var(--ink-400); }
.person-row .address { overflow-wrap: anywhere; }
.person-row .status.seen { color: var(--mint-300); }
.person-row form { margin: 0; flex-shrink: 0; }

/* Phone: the button goes under the text rather than squeezing the row. */
@media (max-width: 599px) {
  .person-row { flex-direction: column; align-items: flex-start; padding: 0.6rem 1rem; }
}

.known-address { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 0.5rem; font-size: 1.0625rem; }
.known-address span { font-weight: 600; overflow-wrap: anywhere; }
.known-address a { font-size: 0.9rem; }

/* --- Lizenzkarte: Fortschritt und Kachelraster (Variante D) ------------------ */
.card-actions { margin-top: 1.5rem; }
.license-state { margin: 0 0 0.75rem; font-weight: 600; }
.progress-card { padding: 14px 16px; }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bar { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); margin: 12px 0 10px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--coral-500), var(--orange-400), var(--mint-400)); }
.bar-0 { width: 0; } .bar-1 { width: 16.67%; } .bar-2 { width: 33.33%; } .bar-3 { width: 50%; }
.bar-4 { width: 66.67%; } .bar-5 { width: 83.33%; } .bar-6 { width: 100%; }
.tiles { list-style: none; margin: 1.25rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { min-width: 0; padding: 12px; border-radius: 20px; border: 1px solid var(--card-border); background: linear-gradient(rgba(17, 28, 63, 0.85), rgba(10, 17, 40, 0.9)); }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 26px; }
.tile-head .eyebrow { font-size: 10px; letter-spacing: 0.05em; min-width: 0; hyphens: auto; overflow-wrap: anywhere; }
.tile-check { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-400); color: #05331f; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.tile-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px dashed rgba(184, 196, 245, 0.3); }
.tile-logo { width: 100%; aspect-ratio: 1 / 1; margin: 10px 0 8px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(184, 196, 245, 0.08); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tile-logo-name { font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.tile-partner { margin: 0; font-size: 13px; color: var(--ink-200); }
.tile-task { margin: 2px 0 0; font-size: 12px; color: var(--ink-400); }
.tile-state { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-400); }
.tile.done .tile-state { color: var(--mint-300); }

/* --- Stempel scannen ------------------------------------------------------ */
.scan-video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; background: #000; }
.scan-note { text-align: center; }

/* --- Stempel geben ------------------------------------------------------- */
.give-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.give-names { min-width: 0; }
.give-logo { flex: none; width: 56px; margin: 0; padding: 6px; border-radius: 12px; }
.give-logo .tile-logo-name { font-size: 10px; }
/* Tighter spacing on the partner's page only: with a code open the button must
   stay above the fold at 375x667 (iPhone SE). The QR keeps its size. */
.give-hero { margin-top: 0.75rem; }
.give-hero h1 { font-size: 1.75rem; margin-top: 0.125rem; }
.give-hero .stripe { margin-top: 0.625rem; }
.give-hero + .give-card, .give-hero + .notice { margin-top: 0.875rem; }
.give-card { padding: 14px 20px 12px; }
.give-card .give-digits { line-height: 1.1; margin-top: 0.25rem; }
.give-card .give-bar { margin: 0.5rem 0 0.125rem; }
.give-card .give-count { margin-bottom: 0; }
.give-card + .actions { margin-top: 0.75rem; }
.give-button { padding-block: 0.875rem; }
.give-card { text-align: center; }
.give-digits { font-size: 3rem; letter-spacing: .3em; margin: .5rem 0 0; }
.give-bar { height: .5rem; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin: .75rem 0 .25rem; }
.give-bar span { display: block; height: 100%; width: 100%; background: var(--coral-500); transition: width .25s linear; }
.give-done { font-size: 2rem; margin: 1rem 0; }
.give-expired { font-size: 1.25rem; opacity: .8; }
.give-button { font-size: 1.25rem; }
.give-today { text-align: center; margin-top: 1rem; }
/* "Schon bei euch": below the fold on purpose, few words, readable at 375 px. */
.give-visits { margin-top: 1.5rem; }
.give-visits h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.visit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.visit-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.visit-who { display: flex; flex-direction: column; min-width: 0; }
.visit-who strong { overflow-wrap: anywhere; }
.visit-company { color: var(--ink-400); font-size: 0.9rem; overflow-wrap: anywhere; }
.visit-time { flex: none; font-size: 0.9rem; white-space: nowrap; }

/* --- Person löschen -------------------------------------------------------- */
/* "Löschen" ends the form's button row, pushed to the right. */
.form-actions .btn-danger:last-child { margin-left: auto; }
/* On a phone the three buttons only share one line a little tighter; the height stays. */
@media (max-width: 479px) {
  .form-actions { gap: 0.5rem; }
  .form-actions .btn { padding: 0 0.75rem; font-size: 0.9375rem; }
  .form-actions .btn-ghost { padding: 0 0.5rem; }
}
/* The stamps under "Person bearbeiten": as wide as the form, apart from it. */
.stamps-card { max-width: 32rem; margin-top: 1.25rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; margin: 0; }
.facts dt { color: var(--ink-400); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* --- Import ----------------------------------------------------------------- */
.import-list { margin: 0.25rem 0 1rem; padding-left: 1.1rem; line-height: 1.6; }
.import-skipped { color: var(--ink-400); }

/* --- Overview (docs/nachtrag-uebersicht.md) -------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.stat { padding: 1rem 1.1rem; border-radius: 16px; }
.stat .eyebrow { font-size: 0.6875rem; letter-spacing: 0.12em; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 0.35rem 0 0.15rem; font-variant-numeric: tabular-nums; }
.stat-value.blue { color: var(--helix-lavender); }
.stat-value.mint { color: var(--mint-300); }
.stat-value.coral { color: var(--coral-400); }
.stat-hint { margin: 0; font-size: 0.8rem; color: var(--ink-400); }
.overview-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.overview-card { border-radius: 20px; }
.overview-card h2 { margin: 0; }
.overview-card .small { margin: 0.25rem 0 0; font-size: 0.8rem; }
.bars { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.bars li { display: grid; grid-template-columns: minmax(6rem, 38%) 1fr 2.5rem; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.bars li.muted { display: block; }
.bar-label { color: var(--ink-200); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; }
.meter { display: block; height: 8px; border-radius: 9px; background: rgba(5, 10, 24, 0.8); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--coral-500), var(--orange-400)); }
.meter.blue span { background: linear-gradient(90deg, var(--helix-blue), var(--helix-violet)); }
.meter.violet span { background: linear-gradient(90deg, var(--helix-violet), var(--helix-magenta)); }
.meter-0 { width: 0%; }
.meter-1 { width: 5%; }
.meter-2 { width: 10%; }
.meter-3 { width: 15%; }
.meter-4 { width: 20%; }
.meter-5 { width: 25%; }
.meter-6 { width: 30%; }
.meter-7 { width: 35%; }
.meter-8 { width: 40%; }
.meter-9 { width: 45%; }
.meter-10 { width: 50%; }
.meter-11 { width: 55%; }
.meter-12 { width: 60%; }
.meter-13 { width: 65%; }
.meter-14 { width: 70%; }
.meter-15 { width: 75%; }
.meter-16 { width: 80%; }
.meter-17 { width: 85%; }
.meter-18 { width: 90%; }
.meter-19 { width: 95%; }
.meter-20 { width: 100%; }
@media (min-width: 768px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-card.wide { grid-column: 1 / -1; }
}

/* --- Partner logos in the admin area (docs/nachtrag-admin-logos.md) -------- */
.person-row .row-logo { flex: none; width: 56px; margin: 0; padding: 6px; border-radius: 12px; }
.person-row .row-logo + .who { flex: 1; }
.bar-label { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-logo { flex: none; width: 24px; margin: 0; padding: 2px; border-radius: 6px; }
/* Phone: the logo stays beside the text; the button goes under the text. */
@media (max-width: 599px) {
  .person-row.with-logo { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.5rem; align-items: center; }
  .person-row.with-logo .row-logo { grid-row: 1 / span 2; align-self: start; }
  .person-row.with-logo > .btn { grid-column: 2; justify-self: start; }
}

/* --- Race settings (docs/scheibe2-spec.md) --------------------------------- */
.race-day { margin-bottom: 1rem; }
.race-day h2 { margin-top: 0; }
.race-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0 1rem; }
.race-remove { margin: -0.5rem 0 1.25rem; }

/* --- Booking a slot (docs/scheibe2-spec.md) -------------------------------- */
.race-card { margin-top: 1rem; }
.race-card p { margin: 0.5rem 0 0; }
.race-slot { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.race-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.slot-card { margin-top: 1rem; }
.slot-card h2 { margin-top: 0; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.5rem; }
.slot-grid form { margin: 0; }
.slot-button { width: 100%; }

/* --- Rig tablet (docs/scheibe2-spec.md) ------------------------------------ */
.rig-switch { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.rig-card { padding: 0.25rem 0; margin-bottom: 1rem; }
.rig-past summary { padding: 0.75rem 1rem; cursor: pointer; color: var(--ink-400); }
.rig-rows { list-style: none; margin: 0; padding: 0; }
.rig-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 22rem); align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line-faint); }
.rig-row:last-child { border-bottom: 0; }
.rig-row.done .rig-time { color: var(--mint-300); }
.rig-time { font-size: 1.1rem; font-weight: 700; }
.rig-who { min-width: 0; }
.rig-who .muted { margin-left: 0.35rem; }
.rig-do { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; min-width: 0; }
.rig-do form { margin: 0; }
/* A field-error message takes its own full-width line in the actions column
   and wraps there, instead of stretching the column and squeezing the name
   next to it (finding 4, whole-branch review). */
.rig-do .field-error { flex: 1 1 100%; max-width: 100%; overflow-wrap: break-word; text-align: right; }
@media (max-width: 599px) {
  .rig-row { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .rig-do { grid-column: 1 / -1; justify-content: flex-start; }
}
.rig-lap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.rig-lap-input { flex: 1 1 6rem; min-width: 0; width: auto; min-height: 40px; padding: 0.35rem 0.6rem; }
.rig-lap-label { font-size: 0.85rem; color: var(--ink-400); white-space: nowrap; }
.rig-lap-shown { font-weight: 700; color: var(--mint-300); }
/* The preview below a time field: "= 1:02.345" while typing, or why not in coral
   (docs/nachtrag-zeit-ziffern-spec.md). Right-aligned like the field's error. */
.rig-lap-preview { flex: 1 1 100%; max-width: 100%; margin: 0.25rem 0 0; text-align: right; font-size: 1rem; font-weight: 700; color: var(--mint-300); }
.rig-lap-preview.is-bad { color: var(--coral-400); }

/* The tablet frame for the role Rig (docs/nachtrag-selbsttest-spec.md): logo,
   clock, "Abmelden" - no menu. The clock also sits in the admin's page head. */
.tablet { min-height: 100vh; min-height: 100dvh; }
.tablet-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.5rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.tablet-top img { display: block; flex: 0 1 110px; min-width: 0; width: 110px; height: auto; }
.tablet-top .btn { flex: none; }
/* The DE/EN switch on the right is as wide as the logo, so the clock stays in the middle. */
.tablet-top .lang-switch { flex: 0 1 110px; justify-content: flex-end; }
.tablet-clock,
.page-head .tablet-clock {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.page-head .tablet-clock { margin-top: 0.5rem; }
.tablet-main { padding: 1rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left)); max-width: 64rem; margin: 0 auto; }
@media (max-width: 420px) {
  .tablet-top img { width: 72px; }
}

/* The running slot: framed in the accent colour, with a coral "Jetzt". The mark
   hangs below the time, so the row's grid keeps its three columns. */
.rig-row { position: relative; }
.rig-row.now {
  padding-bottom: 1.9rem;
  background: rgba(184, 196, 245, 0.08);
  box-shadow: inset 0 0 0 2px var(--coral-500);
  border-radius: 12px;
}
.rig-now {
  position: absolute;
  left: 1rem;
  bottom: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--coral-500);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

/* --- Leaderboard (docs/scheibe2-spec.md, Variante A) ----------------------- */
.board { list-style: none; margin: 0.5rem 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.board-row { display: grid; grid-template-columns: 2rem 1.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; border-radius: 14px; background: rgba(184, 196, 245, 0.05); border: 1px solid var(--card-border); }
.board-row.top { background: linear-gradient(90deg, rgba(245, 90, 77, 0.22), rgba(184, 196, 245, 0.05)); }
.board-pos { font-weight: 800; color: var(--ink-400); text-align: right; font-variant-numeric: tabular-nums; }
.board-row.top .board-pos { color: var(--coral-400); }
/* The signed-in person's own row - podium, full list, and the standalone
   line when there is no podium spot. One class, everywhere (Nachtrag Bestenliste). */
.board-row.me { background: linear-gradient(90deg, rgba(59, 108, 255, 0.28), rgba(184, 196, 245, 0.05)); border-color: rgba(59, 108, 255, 0.4); }
.board-row.own-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0; font-weight: 700; }
.board-who { font-weight: 700; display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.board-who .board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who .pill { flex-shrink: 0; }
/* Narrow phone: the pill would otherwise squeeze the name down to almost
   nothing. Stack it under the name instead, small, and let the name have
   the row's full width - cut at most at the end, with "…" (Nachtrag, 23.09.). */
@media (max-width: 480px) {
  .board-who { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .board-who .board-name { width: 100%; }
  .board-who .pill { font-size: 0.6rem; padding: 0.05rem 0.4rem; }
}
.board-time { font-weight: 700; font-size: 1.1rem; }
.board-row.top .board-time { color: var(--mint-300); }
/* Colour is baked into each trophy-<kind>.svg file, never set here (F3). */
.trophy { display: block; width: 1.5rem; height: 1.5rem; }
.board-days { display: flex; gap: 0.5rem; margin: 0 0 0.75rem; }
.board-prize { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--ink-400); }
.board-all { padding: 0.25rem 0; margin-top: 0.75rem; }
.board-all summary { padding: 0.75rem 1rem; cursor: pointer; color: var(--ink-400); }
.board-all .board { margin: 0.5rem 1rem 1rem; }
.race-best { font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Dashboard: wall monitor 1920x1080 (Nachtrag Bestenliste, Variante A) --
   Everything scales with the viewport height; the frame never scrolls,
   also with ten rows plus three trophy holders below the rule. */
.dash { height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 2.4vh 3vw; }
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.dash-logo { height: 3.4vh; width: auto; }
.dash-day { margin: 0; font-size: clamp(0.9rem, 2.1vh, 2rem); color: var(--ink-400); }
.dash-eyebrow { margin: 1.2vh 0 0; font-size: clamp(0.75rem, 1.9vh, 1.75rem); }
.dash-title { margin: 0.3vh 0 0; font-size: clamp(2rem, 6.4vh, 6rem); line-height: 1.1; font-weight: 800; }
.dash-prize { margin: 0.4vh 0 0; font-size: clamp(0.8rem, 1.9vh, 1.75rem); color: var(--ink-400); }
.dash-empty { margin-top: 2vh; font-size: clamp(1rem, 3vh, 2.5rem); }
.dash-board { display: flex; flex-direction: column; gap: 0.6vh; margin: 1.2vh 0 0; }
.dash-board:not(.dash-extra) { flex: 1 1 auto; min-height: 0; }
.dash-row { flex: 1 1 0; min-height: 0; max-height: 6.4vh; grid-template-columns: 4vw 4vh minmax(0, 1fr) auto; gap: 1.6vw; padding: 0 1.4vw; border-radius: 1.4vh; }
.dash-extra .dash-row { flex: none; height: 4.6vh; }
.dash-row .board-pos { font-size: clamp(1rem, 3vh, 3rem); }
.dash-row .board-name { font-size: clamp(1rem, 3.2vh, 3rem); }
.dash-row .board-who { gap: 1vw; }
.dash-row .pill { font-size: clamp(0.65rem, 1.6vh, 1.5rem); padding: 0.2vh 0.8vw; }
.dash-row .board-time { font-size: clamp(1rem, 3.4vh, 3.2rem); letter-spacing: -0.02em; }
.dash-row .trophy { width: 3.4vh; height: 3.4vh; }
.dash-rule { flex: none; margin: 1.2vh 0 0; border: 0; border-top: 2px dashed var(--ink-400); opacity: 0.5; }
.dash-stats { flex: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2vw; margin-top: 1.6vh; }
.dash-stats .stat { padding: 0.9vh 1.2vw; border-radius: 1.2vh; }
.dash-stats .eyebrow { margin: 0; font-size: clamp(0.65rem, 1.6vh, 1.5rem); }
.dash-stats .stat-value { margin: 0.2vh 0 0; font-size: clamp(1.25rem, 3.4vh, 3.2rem); }

.prize-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.prize-table th, .prize-table td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.prize-table td.mono, .prize-table th.num { text-align: right; }
.prize-count { display: flex; gap: .5rem; align-items: center; }
.prize-count .input { width: 5rem; }

.prize-card { padding: 10px 14px; border-color: rgba(52, 211, 153, 0.5); }
.give-hero + .prize-card { margin-top: 0.875rem; }
.give-compact { margin: 0.25rem 0 0; }
.prize-card + .give-card, .prize-card + .prize-card { margin-top: 0.5rem; }
.give-compact + .prize-card { margin-top: 0.5rem; }
.prize-who { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prize-who .visit-company { margin-left: 0.5rem; }
.prize-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.prize-actions form { flex: 1 1 auto; min-width: 0; }
.prize-actions .btn { white-space: nowrap; min-height: 2.75rem; padding: 0 0.75rem; font-size: 0.875rem; }
.prize-actions form .btn { width: 100%; }
.give-prize { font-size: 2.25rem; margin: 1rem 0; text-align: center; }
.visit-prize { margin-left: 0.35rem; }

/* Open win: every pixel above the fold counts at 375x667 (spec §5). */
.give-compact { margin-top: 0; }
.give-compact + .prize-card, .prize-card + .prize-card { padding-block: 6px; }
.prize-card .prize-actions { margin-top: 6px; }
.prize-card ~ .give-card { padding-top: 8px; padding-bottom: 8px; }
.prize-card ~ .actions { margin-top: 8px; }

/* --- Win screen (/gewonnen/, docs/sofortgewinne-spec.md §6) --------------- */
.won { text-align: center; padding: 1.5rem 0 0.5rem; }
.won-gift { font-size: 5.5rem; line-height: 1; margin: 0.5rem 0 0.75rem; display: inline-block; animation: won-hop 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both; }
.won-logo { width: 9rem; margin: 0 auto 1rem; }
.won-head { font-size: 2.25rem; margin: 0 0 0.75rem; }
.won-text { font-size: 1.15rem; color: var(--ink-200); margin: 0 0 0.5rem; }
.won .actions { margin-top: 1.5rem; }
@keyframes won-hop {
  0% { transform: scale(0.6) translateY(12px); opacity: 0; }
  55% { transform: scale(1.15) translateY(-14px); opacity: 1; }
  75% { transform: scale(0.95) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .won-gift { animation: none; }
}

/* The rig page's head: the heading and a real "Aktualisieren" button in one row,
   below it the small note when the poll fails (docs/nachtrag-rig-aktualisieren-spec.md). */
.rig-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.rig-head-row h1 { margin: 0; }
.rig-head-row .btn { flex: none; }
/* "Keine Verbindung": a bar seen from a metre away. It sticks below the frame's
   own sticky bar (--frame-top, measured by tablet.js), so it stays in view while
   scrolling. White bold 1.2rem on coral: large text, contrast above 3:1. */
.rig-offline {
  position: sticky;
  top: var(--frame-top, 0px);
  z-index: 25;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--coral-500);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* DE/EN switch (docs/zweisprachig-spec.md 2.3): two small buttons, the active one filled. */
.lang-switch { display: inline-flex; gap: 0.25rem; margin: 0; }
.lang-btn { min-width: 2.5rem; min-height: 36px; padding: 0.25rem 0.5rem; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-400); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.lang-btn.is-active { background: var(--coral-500); border-color: var(--coral-500); color: #fff; }
.visitor-top-actions { display: flex; align-items: center; gap: 0.5rem; }
.admin-side-foot .lang-switch, .admin-menu-panel .lang-switch { margin-bottom: 0.75rem; }
