/* ==========================================================================
   GhostOrb - Stylesheet
   Einfach, professionell, mobil und am Desktop nutzbar.
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef1f7;
  --border: #dde3ee;
  --border-strong: #c6cfe0;
  --text: #16203a;
  --text-muted: #5d6a85;
  --text-inverse: #ffffff;
  --primary: #2f6fed;
  --primary-hover: #1f58ca;
  --primary-soft: #e6eefd;
  --danger: #d23b48;
  --danger-soft: #fdeaec;
  --success: #17875a;
  --success-soft: #e3f5ec;
  --warning: #b8770d;
  --warning-soft: #fdf2dd;
  --info: #2f6fed;
  --info-soft: #e6eefd;
  --shadow: 0 1px 2px rgba(16, 28, 56, .06), 0 8px 24px rgba(16, 28, 56, .06);
  --shadow-lg: 0 12px 40px rgba(16, 28, 56, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0f1729;
  --bg-elevated: #172033;
  --bg-subtle: #1e293f;
  --border: #2a3654;
  --border-strong: #3c4a6e;
  --text: #e8edf8;
  --text-muted: #9aa8c4;
  --text-inverse: #0f1729;
  --primary: #5b90ff;
  --primary-hover: #7aa5ff;
  --primary-soft: #1d2d52;
  --danger: #ff6b78;
  --danger-soft: #3a1f26;
  --success: #3ddc9a;
  --success-soft: #12312a;
  --warning: #f5c265;
  --warning-soft: #362b16;
  --info: #5b90ff;
  --info-soft: #1d2d52;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }

/* Muss vor allen Komponenten stehen: eigene display-Regeln (z.B. .marker oder
   .floorplan-wrap) haben sonst Vorrang vor dem hidden-Attribut. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- Kopfleiste */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-right: auto;
}
.brand:hover { text-decoration: none; }

.brand-orb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #a9c6ff 0%, var(--primary) 55%, #14367f 100%);
  box-shadow: 0 0 12px rgba(47, 111, 237, .55);
}

.mainnav { display: flex; align-items: center; gap: 4px; }

.navlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 550;
  color: var(--text-muted);
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.navlink:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.navlink.is-active { background: var(--primary-soft); color: var(--primary); }
.navlink-logout { color: var(--danger); }
.navlink-logout:hover { background: var(--danger-soft); color: var(--danger); }
.navlink-icon { font-size: 1.1rem; padding: 9px 12px; }
.navform { margin: 0; display: inline-flex; }

.theme-icon { line-height: 1; }
html[data-theme="light"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
}
.nav-toggle-bar { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------------------------------------------------------------- Layout */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.page-narrow { max-width: 680px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-title { margin: 0; }
.page-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: .95rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: .5; }

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- Karten */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title h2 { margin: 0; }
.card-tight { padding: 0; overflow: hidden; }

.grid { display: grid; gap: 16px; margin-bottom: 18px; }
/* Karten in einem Raster bekommen ihren Abstand vom Raster selbst. */
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: .85rem; }

/* ---------------------------------------------------------------- Gebäude-Buttons */
.tile-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  min-height: 96px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 5px solid var(--tile-color, var(--primary));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile:active { transform: translateY(0); }

.tile-badge {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tile-color, var(--primary));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .5px;
}
.tile-emoji { font-size: 1.5rem; background: var(--primary-soft); color: var(--primary); }
.tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-name { font-weight: 650; line-height: 1.3; }
.tile-meta {
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-align: center;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger); filter: brightness(.92); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: .85rem; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Formulare */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label, .field > label { font-size: .88rem; font-weight: 600; color: var(--text-muted); }

.input {
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.input:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: auto; }
input[type="color"].input { padding: 4px; height: 44px; }
input[type="file"].input { padding: 9px; background: var(--bg-subtle); }

.field-hint { margin: 0; font-size: .82rem; color: var(--text-muted); }
.field-error { margin: 0; font-size: .82rem; color: var(--danger); font-weight: 550; }
.has-error .input { border-color: var(--danger); }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-input { width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; }
.check-label { font-size: .95rem; }
.field-check { flex-direction: column; }

.check-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.check-card:hover { border-color: var(--primary); }
.checkbox-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.checkbox-grid ul, .checkbox-grid li { list-style: none; margin: 0; padding: 0; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 650; padding: 0; margin-bottom: 10px; }

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { flex: 1 1 200px; }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--bg-subtle); white-space: nowrap; }
.table tbody tr:hover { background: var(--bg-subtle); }
.table td.actions { text-align: right; white-space: nowrap; }
.table .muted { color: var(--text-muted); }

/* Tabellen auf Mobilgeräten als Karten darstellen */
@media (max-width: 720px) {
  .table.table-cards thead { display: none; }
  .table.table-cards, .table.table-cards tbody, .table.table-cards tr, .table.table-cards td { display: block; width: 100%; }
  .table.table-cards tr { border-bottom: 1px solid var(--border); padding: 10px 4px; }
  .table.table-cards td { border: 0; padding: 5px 12px; display: flex; justify-content: space-between; gap: 12px; }
  .table.table-cards td::before {
    content: attr(data-label);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    font-weight: 600;
    flex: 0 0 40%;
  }
  .table.table-cards td.actions { justify-content: flex-start; }
  .table.table-cards td.actions::before { content: ""; flex: 0 0 40%; }
}

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 650;
  background: var(--bg-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-admin { background: var(--primary-soft); color: var(--primary); }
.badge-objektleiter { background: var(--success-soft); color: var(--success); }
.badge-handwerker { background: var(--warning-soft); color: var(--warning); }
.badge-brandwache { background: var(--danger-soft); color: var(--danger); }
.badge-on { background: var(--success-soft); color: var(--success); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }

/* ---------------------------------------------------------------- Checkliste */
.checklist { font-size: .92rem; }
.checklist-head { padding: 16px 18px 0; }
.checklist th { white-space: nowrap; }
.checklist-no { width: 40px; text-align: center; color: var(--text-muted); font-weight: 600; }
.checklist-question { min-width: 260px; }
.checklist-question label { cursor: pointer; }
.checklist-status { width: 190px; }
.checklist-comment { min-width: 180px; }
.checklist tr.row-defect { background: var(--danger-soft); }

.input-sm { min-height: 38px; padding: 7px 10px; font-size: .9rem; }

/* Unveränderlicher Wert an der Stelle eines Eingabefeldes. */
.field-static {
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
}

.statusgroup { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.statusopt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.statusopt input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.statusopt:hover { border-color: var(--primary); }
.statusopt:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.statusopt-io:has(input:checked) {
  background: var(--success); border-color: var(--success); color: #fff;
}
.statusopt-nio:has(input:checked) {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.statusopt-na:has(input:checked) {
  background: var(--text-muted); border-color: var(--text-muted); color: #fff;
}

.checklist-preview { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: .9rem; }
.checklist-preview li { margin-bottom: 6px; }

@media (max-width: 720px) {
  .checklist, .checklist tbody, .checklist tr, .checklist td { display: block; width: 100%; }
  .checklist thead { display: none; }
  .checklist tr { border-bottom: 1px solid var(--border); padding: 12px 4px; }
  .checklist td { border: 0; padding: 4px 12px; }
  .checklist-no { text-align: left; width: auto; font-size: .75rem; text-transform: uppercase; }
  .checklist-no::before { content: "Prüfpunkt "; }
  .checklist-status, .checklist-comment { width: auto; }
  .statusopt { flex: 1 1 0; }
}

/* ---------------------------------------------------------------- Meldungen */
.flashes { display: grid; gap: 10px; margin-bottom: 18px; }
.flashes:empty { display: none; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: .94rem;
  box-shadow: var(--shadow);
}
.flash-text { flex: 1; }
.flash-close { border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }
.flash-close:hover { opacity: 1; }
.flash-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.flash-error, .flash-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.flash-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.flash-info, .flash-message { background: var(--info-soft); border-color: var(--info); color: var(--info); }

.notice {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: .92rem;
}
.notice-warning { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.notice-danger { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.logo-preview-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.logo-preview-frame-wide { display: flex; }
.logo-preview {
  display: block;
  max-width: min(420px, 100%);
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; }

/* ---------------------------------------------------------------- Login */
.auth-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-orb {
  width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #a9c6ff 0%, var(--primary) 55%, #14367f 100%);
  box-shadow: 0 0 26px rgba(47, 111, 237, .5);
}
.auth-title { font-size: 1.5rem; margin: 0; }
.auth-subtitle { color: var(--text-muted); font-size: .92rem; margin: 0; }
.auth-form { display: grid; gap: 16px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-footer { margin-top: 20px; text-align: center; font-size: .88rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- Grundriss */
.floorplan-viewer { display: grid; gap: 10px; }
.floorplan-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.floorplan-toolbar-label {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 600;
}
.floorplan-zoom-label {
  min-width: 4.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .9rem;
}
.floorplan-toolbar-hint { margin: 0; flex: 1 1 12rem; }
.floorplan-scroller {
  overflow: auto;
  max-width: 100%;
  max-height: min(80vh, 920px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  -webkit-overflow-scrolling: touch;
}
.floorplan-wrap {
  --zoom: 1;
  --marker-size: 10px;
  position: relative;
  display: block;
  width: calc(var(--zoom) * 100%);
  max-width: none;
  line-height: 0;
}
.floorplan-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}
.floorplan-pickable { cursor: crosshair; }

/* Markierungsgröße kommt je Grundriss aus --marker-size (Pixel)
   und bleibt beim Zoomen gleich, damit der Sitz genauer erkennbar ist. */
.marker {
  position: absolute;
  transform: translate(-50%, -50%) translate(var(--spread-x, 0px), var(--spread-y, 0px));
  display: inline-flex;
  align-items: center;
  padding: .08em .42em;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  font-size: var(--marker-size);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  z-index: 3;
}
.marker:hover, .marker:focus-visible {
  transform: translate(-50%, -50%) translate(var(--spread-x, 0px), var(--spread-y, 0px)) scale(1.25);
  text-decoration: none;
  color: #fff;
  z-index: 6;
}
.marker-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}
.marker-leaders line {
  stroke-linecap: round;
  fill: none;
}
.marker-leader-halo {
  stroke: #fff;
  stroke-width: 5;
}
.marker-leader {
  stroke: #9f1239;
  stroke-width: 2;
}
.marker-pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.marker-active {
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 1px 4px rgba(0, 0, 0, .5);
  z-index: 4;
}
.marker-preview { background: var(--primary); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 237, .55); }
  50% { box-shadow: 0 0 0 10px rgba(47, 111, 237, 0); }
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 8px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .9rem;
  font-weight: 550;
}
.chip:hover { border-color: var(--primary); text-decoration: none; }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.definition { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 10px 20px; margin: 0; }
.definition dt { color: var(--text-muted); font-size: .88rem; font-weight: 600; }
.definition dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 540px) {
  .definition { grid-template-columns: 1fr; gap: 2px; }
  .definition dd { margin-bottom: 10px; }
}

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .mainnav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 14px;
    border-top: 1px solid var(--border);
  }
  .mainnav.is-open { display: flex; }
  .navform { width: 100%; }
  .navlink { width: 100%; justify-content: flex-start; min-height: 46px; font-size: 1rem; }
  .page { padding: 18px 14px 56px; }
  h1 { font-size: 1.4rem; }
  .form-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .topbar, .footer, .page-actions, .flashes, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
