/* TheOne – gemeinsames Stylesheet für User-App, Admin und Installer */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #151826;
  --muted: #646a82;
  --border: #e1e4ee;
  --primary: #4f46e5;
  --primary-ink: #ffffff;
  --primary-soft: #eceafd;
  --danger: #d92d3a;
  --danger-soft: #fdecee;
  --success: #12805c;
  --success-soft: #e5f6ef;
  --warning: #a8600a;
  --warning-soft: #fdf3e2;
  --info: #1d63c9;
  --info-soft: #e7f0fc;
  --admin: #111421;
  --admin-ink: #d8dbe8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 40, .05), 0 6px 24px rgba(16, 20, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1018;
    --surface: #171a26;
    --surface-2: #1f2332;
    --text: #e8eaf3;
    --muted: #9aa0b8;
    --border: #2a2f42;
    --primary: #7c74ff;
    --primary-soft: #262447;
    --danger: #ff6b76;
    --danger-soft: #3a1c22;
    --success: #3fcf97;
    --success-soft: #16302a;
    --warning: #f2b04f;
    --warning-soft: #362a17;
    --info: #6aa6ff;
    --info-soft: #182a45;
    --admin: #07080d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html {
  /* Verhindert horizontales Scrollen/Wackeln, falls ein Element (Bild, Tabelle, langer Text)
     minimal über die Bildschirmbreite hinausragt – häufige Ursache für "Seite breiter als Screen" auf Mobile. */
  overflow-x: hidden;
  width: 100%;
}
/* Bilder/SVGs dürfen ihren Container nie sprengen; lange, leerzeichenlose Texte (E-Mail, Namen)
   sollen umbrechen statt die Flex-/Grid-Zeile (und damit die Seite) breiter zu ziehen. */
img, svg { max-width: 100%; }
* { overflow-wrap: break-word; }
body {
  overflow-x: hidden;
  overflow-x: clip; /* clip statt hidden: body wird kein Scroll-Container, sonst greift position: sticky der Tab-Leiste nicht */
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh;
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .92rem;
  padding: 9px 16px; min-height: 40px;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .84rem; }
.btn.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.icon-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field > label, .form > label { font-weight: 600; font-size: .88rem; display: grid; gap: 5px; }
input[type=text], input[type=tel], input[type=date], input[type=time], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; min-height: 42px;
}
/* Datum und Zeit: iOS gibt ihnen sonst eine feste, zu breite Eigenbreite und eine andere Optik (Pille) als den übrigen Feldern */
input[type=date], input[type=time] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; box-sizing: border-box; text-align: left;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 13px; min-height: 380px; white-space: pre; tab-size: 2; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .82rem; }
.error-text:empty { display: none; }
.hint { color: var(--muted); font-size: .82rem; }
.check, .form > label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-wrap .reveal {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.pw-wrap .reveal:hover { background: var(--surface-2); color: var(--text); }
.pw-wrap .reveal .reveal-icon { width: 20px; height: 20px; }
.pw-wrap .reveal .reveal-icon::before {
  content: ""; display: block; width: 100%; height: 100%;
  -webkit-mask: var(--icon-eye) center / contain no-repeat; mask: var(--icon-eye) center / contain no-repeat;
  background: currentColor;
}
.pw-wrap .reveal.is-visible .reveal-icon::before { -webkit-mask-image: var(--icon-eye-off); mask-image: var(--icon-eye-off); }
:root {
  --icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --icon-eye-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18M10.6 10.6a3 3 0 0 0 4.24 4.24M9.9 5.1A11 11 0 0 1 12 5c7 0 11 7 11 7a13.5 13.5 0 0 1-3.1 3.9M6.3 6.9A13.4 13.4 0 0 0 1 12s4 7 11 7a10.5 10.5 0 0 0 3.5-.6'/%3E%3C/svg%3E");
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.actions.start { justify-content: flex-start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }

/* ---------- Hinweise ---------- */
.alert { padding: 11px 14px; border-radius: 9px; font-size: .92rem; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert .btn { margin-top: 8px; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; line-height: 1;
  padding: 5px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.active, .badge.success { background: var(--success-soft); color: var(--success); }
.badge.pending, .badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.disabled, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- Karten & Tabellen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card > h2:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 30px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts & Modal ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; left: 20px; display: grid; justify-items: end; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow); max-width: 420px; transition: opacity .4s, transform .4s; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

dialog.modal { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 12, 22, .5); }
dialog.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
dialog.modal header h2 { margin: 0; }
.modal-body { padding: 20px; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto; }

/* ---------- Auth-Seiten (Login, Registrierung …) ---------- */
.auth-page { display: grid; align-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #06b6d4 14%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card .brand-logo { display: block; margin: 0 0 14px; }
.auth-card .brand-logo img { height: 56px; width: auto; display: block; }
.sidebar .logo img { height: 24px; width: auto; flex: none; }
.auth-card .brand { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-card .brand small { font-size: .8rem; font-weight: 700; vertical-align: middle; margin-left: 6px; }
.auth-card > p.muted { margin-bottom: 22px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .9rem; margin-top: 18px; }
.auth-page.admin { background: var(--admin); }
.auth-page.admin .auth-card { border-color: #262a3b; }

/* ---------- User-App ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.topbar nav a:hover, .topbar nav a.active { color: var(--text); background: var(--surface-2); }
.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

.hero { border-radius: 18px; padding: 36px 30px; margin-bottom: 24px; color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 120%); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.hero p { margin: 0; opacity: .92; }
.hero .roles { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.hero .badge { background: rgba(255, 255, 255, .2); color: #fff; }

.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--border); }
.block.info { border-top-color: var(--info); }
.block.success { border-top-color: var(--success); }
.block.warning { border-top-color: var(--warning); }
.block p { white-space: pre-line; color: var(--muted); margin-bottom: 12px; }
.block p:last-child { margin-bottom: 0; }

.session-list { list-style: none; padding: 0; margin: 0; }
.session-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.session-list li:last-child { border-bottom: 0; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--admin); color: var(--admin-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { font-weight: 800; font-size: 1.2rem; color: #fff; padding: 6px 12px 16px; display: flex; align-items: center; gap: 8px; }
.sidebar .logo .badge { background: #f43f5e; color: #fff; }
.sidebar a { color: var(--admin-ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.sidebar a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar a.active { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: .82rem; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 8px; color: #8f94aa; }
.sidebar .who strong { color: #fff; display: block; font-size: .9rem; }
.admin-main { padding: 26px 30px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.menu-toggle { display: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { flex: 1 1 160px; }
.filters input[type=search] { flex: 3 1 240px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: .9rem; color: var(--muted); }

.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.preview-frame { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.preview-text { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; background: var(--surface-2); border-radius: 9px; padding: 14px; min-height: 300px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: .78rem; padding: 4px 8px; border-radius: 6px; border: 1px dashed var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.json { font-family: var(--mono); font-size: 12px; margin: 0; white-space: pre-wrap; word-break: break-all; color: var(--muted); }

@media (max-width: 1100px) { .tpl-editor { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .menu-toggle { display: inline-flex; }
  .admin-main { padding: 18px 16px 60px; }
}
@media (max-width: 560px) {
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .topbar { padding: 10px 14px; }
  .container { padding: 20px 16px 50px; }
  .hero { padding: 28px 22px; }
  .auth-card { padding: 26px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Admin: Filterleiste und sortierbare Tabellen */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: flex-end; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.filter-bar label.grow { flex: 1; min-width: 200px; }
.filter-bar select, .filter-bar input { min-width: 130px; }
.bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }

/* Handynummer: Land (Auswahl) + Nummer nebeneinander, auf schmalen Bildschirmen untereinander */
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.phone-row input { font-size: 1.1rem; letter-spacing: .02em; }
/* Nach dem Absenden zeigt das Feld genau eine Meldung: die Fehlermeldung ersetzt den Live-Hinweis */
.field.invalid .phone-hint { display: none; }
.phone-hint-bad { color: var(--danger, #c0392b); }
.phone-hint-ok { color: var(--success, #1e8e4e); }
@media (max-width: 380px) { .phone-row { grid-template-columns: 1fr; } }

/* Passport-Wizard */
.wiz-steps { display: flex; gap: 6px; margin: 10px 0 14px; flex-wrap: wrap; }
.wiz-step { min-width: 34px; min-height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.wiz-step.done { border-color: var(--success, #3aa76d); }
.wiz-step.todo { border-color: var(--warning, #eec84a); }
.wiz-step.active { background: var(--primary, #eec84a); color: #111; border-color: transparent; }
.wiz-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* Klickbare Auswahl (Pool, Einheiten) und Sichtbarkeits-Schalter im Passport-Wizard */
.choice-row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
.choice { width: 100%; min-height: 56px; padding: 6px 8px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.choice.active { background: var(--primary, #eec84a); color: #111; border-color: transparent; }
.share-toggle { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.measure { display: grid; gap: 6px; margin-bottom: 8px; }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input input { flex: 1; min-width: 0; }

.measure .field { margin-bottom: 0; }

/* Profil-Kopf: Unterpunkte als Links im gleichen Stil wie die Tab-Knöpfe */
.tabs a.tab { padding: 8px 12px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.profile-summary { min-height: 92px; }

.pool-fixed { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-weight: 700; }

/* iOS zoomt die ganze Seite, sobald ein Eingabefeld unter 16 px den Fokus bekommt, und bleibt danach gezoomt (Navigation und Inhalt laufen
   seitlich aus dem Bild). Auf iOS (Safari, PWA, App-Hülle) deshalb mindestens 16 px in allen Feldern. */
@supports (-webkit-touch-callout: none) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: 16px; }
}
.medal-cell svg.medal { width: 44px; height: 63px; display: block; } /* Abzeichen-Liste: gleiche Medaille wie in der App */

/* Admin: Regelwerk (server/content/regelwerk.md) */
.rulebook .rb-toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; }
.rulebook .rb-toc li { margin: 2px 0; }
.rulebook .rb-body h1 { margin-top: 0; }
.rulebook .rb-body h2 { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--border); }
.rulebook .rb-body h3 { margin-top: 18px; }
.rulebook .rb-body ul { padding-left: 20px; }
.rulebook .rb-body li { margin: 4px 0; line-height: 1.5; }
.rulebook { --rb-val: #c2410c; --rb-val-soft: #ffedd5; }
@media (prefers-color-scheme: dark) { .rulebook { --rb-val: #fdba74; --rb-val-soft: #43220c; } }
.rulebook .rb-val { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--rb-val-soft); color: var(--rb-val); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.rulebook a.rb-val:hover, .rulebook a.rb-val:focus-visible { background: var(--rb-val); color: #fff; }
.rulebook .rb-val.fixed { text-decoration: none; border: 1px dashed var(--rb-val); background: transparent; }
.field-flash { outline: 3px solid #f97316; outline-offset: 4px; border-radius: 8px; transition: outline-color .4s; }
.rulebook .rb-val.missing { background: var(--danger-soft, #2c1416); color: var(--danger, #ff5a5f); }
@media (max-width: 700px) { .rulebook .rb-toc ol { columns: 1; } }
