:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #616e7c;
  --border: #d9e2ec;
  --accent: #2563eb;
  --accent-soft: #dbe7fe;
  --ok: #157f3b;
  --ok-bg: #e3f6e9;
  --err: #b42318;
  --err-bg: #fdecea;
  --info-bg: #e8f1fd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --card: #1b2129;
    --text: #e4e7eb;
    --muted: #9aa5b1;
    --border: #2f3a46;
    --accent: #6b9cff;
    --accent-soft: #233456;
    --ok: #6fd28f;
    --ok-bg: #173323;
    --err: #ff8a80;
    --err-bg: #3a1c1a;
    --info-bg: #1c2a40;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a {
  padding: 6px 12px; border-radius: 6px; color: var(--text); text-decoration: none;
}
nav a.active, nav a:hover { background: var(--accent-soft); color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 20px 0 10px; }
a { color: var(--accent); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); }
input, textarea, button { font: inherit; color: inherit; }
input[type=date], input[type=email], input[type=password], input[type=number], input[type=text],
.training-form input:not([type]),
.stack input:not([type]), textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.date-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 600; }
fieldset.scale { border: none; padding: 0; margin: 0 0 14px; }
fieldset.scale legend { font-weight: 600; margin-bottom: 6px; }
.options { display: flex; gap: 8px; flex-wrap: wrap; }
.options label { position: relative; }
.options input { position: absolute; opacity: 0; inset: 0; }
.options span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-weight: 600; background: var(--bg);
}
.options input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.note { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-top: 6px; }
.note textarea { font-weight: normal; resize: vertical; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.total { font-size: 1.15rem; }
.total strong { font-size: 1.6rem; }
button {
  padding: 9px 18px; border: none; border-radius: 6px; background: var(--accent); color: #fff;
  cursor: pointer; font-weight: 600;
}
button.link { background: none; color: var(--accent); padding: 0; font-weight: normal; }
button.link.danger { color: var(--err); }
.chart-wrap { position: relative; height: 360px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 6px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num { text-align: right; }
.nowrap { white-space: nowrap; }
.note-cell { min-width: 140px; max-width: 260px; }
.actions form { margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; color: inherit; }
.stack .hint { margin: 0; }
.entry-form-choice { max-width: 480px; }
.entry-form-choice + .entry-form-choice, .settings-list + .entry-form-choice { margin-top: 20px; }
.form-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 600; flex-wrap: wrap; }
.form-switch select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; color: inherit; max-width: 100%; }
a.entry-pill { color: inherit; text-decoration: none; }
a.entry-pill:hover { border-color: var(--accent); color: var(--accent); }
.hint { color: var(--muted); font-size: 0.92rem; }
.status { font-weight: 600; }
.status.ok { color: var(--ok); }

/* Kalender (Wochenansicht) */
:root {
  --c-sleep: #6366f1; --c-run: #f97316; --c-bike: #0ea5e9; --c-swim: #14b8a6;
  --c-strength: #a855f7; --c-walk: #22c55e; --c-mind: #ec4899; --c-other: #64748b;
  --c-bp: #dc2626; --c-weight: #0f766e;
  --hour: 30px;
}
.g-sleep { --c: var(--c-sleep); } .g-run { --c: var(--c-run); } .g-bike { --c: var(--c-bike); }
.g-swim { --c: var(--c-swim); } .g-strength { --c: var(--c-strength); } .g-walk { --c: var(--c-walk); }
.g-mind { --c: var(--c-mind); } .g-other { --c: var(--c-other); }
.g-bp { --c: var(--c-bp); } .g-weight { --c: var(--c-weight); }
.cal-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.cal-head h1 { margin: 0; }
.cal-head h1 small { font-weight: 400; color: var(--muted); font-size: 0.95rem; margin-left: 6px; }
.cal-nav { display: flex; gap: 6px; }
.btn {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); text-decoration: none; background: var(--bg); min-width: 36px; text-align: center;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.legend { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 14px;
          font-size: 0.85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cal-scroll { overflow-x: auto; position: relative; }
.cal-grid {
  display: grid; grid-template-columns: 46px repeat(7, minmax(110px, 1fr));
  min-width: 820px; border-top: 1px solid var(--border);
}
.cal-day-head { padding: 8px 6px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
                font-size: 0.85rem; min-width: 0; }
.cal-day-head.today { background: var(--accent-soft); }
.cal-date { color: var(--text); text-decoration: none; display: block; margin-bottom: 4px; }
.cal-date:hover .dn { text-decoration: underline; }
.cal-date .wd { color: var(--muted); font-weight: 600; }
.cal-date .dn { font-weight: 700; }
.today .cal-date .dn { color: var(--accent); }
.cal-stats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pill { font-size: 0.75rem; padding: 1px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
        white-space: nowrap; }
.pill small { color: var(--muted); }
.pill.score { font-weight: 700; }
.pill.g-sleep { border-color: var(--c); color: var(--c); }
.pill.train { border-color: var(--c-run); color: var(--c-run); }
.pill.load { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.b-metrics .m.load { font-weight: 700; }
.pill.g-bp, .pill.g-weight { border-color: var(--c); color: var(--c); }
.cal-acts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-acts li { display: flex; gap: 6px; align-items: flex-start; font-size: 0.78rem; line-height: 1.3; }
.cal-acts .dot { margin-top: 4px; }
.cal-acts small { color: var(--muted); }
.act-text { min-width: 0; overflow-wrap: anywhere; }
.cal-axis { position: relative; height: calc(24 * var(--hour)); }
.cal-axis span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 0.7rem; color: var(--muted); }
.cal-axis span:first-child { transform: none; }
.cal-col {
  position: relative; height: calc(24 * var(--hour)); border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour));
  background-size: 100% calc(var(--hour) * 3);
}
.cal-col.today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.block {
  position: absolute; left: 3px; right: 3px; overflow: hidden; border-radius: 5px;
  border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 22%, var(--card));
  padding: 1px 5px; font-size: 0.72rem; line-height: 1.25; min-height: 4px; cursor: default;
}
.block.activity { left: 10px; z-index: 2; background: color-mix(in srgb, var(--c) 35%, var(--card));
                  box-shadow: 0 1px 2px rgb(0 0 0 / 0.15); }
.block .b-label { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block .b-detail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); opacity: 0.8; }
.block.short { display: flex; gap: 5px; align-items: baseline; padding-top: 0; padding-bottom: 0; }
.block.short .b-label { flex: none; max-width: 60%; }
.block.short .b-detail { flex: 1; min-width: 0; }
.cal-corner, .cal-axis { position: sticky; left: 0; z-index: 3; background: var(--card); }
.block.activity { padding: 2px 5px 3px; }
.block.activity:hover { z-index: 4; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); }
.block.measure {
  right: auto; left: 18px; max-width: calc(100% - 21px); z-index: 2; min-height: 0; padding: 0 5px;
  background: var(--card); border: 1px solid var(--c); border-left-width: 3px; border-radius: 4px;
  transform: translateY(-50%); font-size: 0.68rem;
}
.block.measure .b-label { font-weight: 600; color: var(--c); }
.block.measure:hover { z-index: 3; }
.block .b-time { font-weight: 400; opacity: 0.75; }
.b-metrics { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 2px; }
.b-metrics .m {
  font-size: 0.68rem; padding: 0 5px; border-radius: 4px; white-space: nowrap;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.hr { color: #dc2626; }
@media (prefers-color-scheme: dark) { .hr { color: #f87171; } }

/* Einstellungen: Reiter oben */
.subnav { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.subnav a {
  padding: 8px 14px; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.subnav a:hover { color: var(--accent); background: var(--accent-soft); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.card-title { margin-top: 0; }
.settings-list { margin: 0; }
.settings-list dt { font-weight: 600; margin-top: 14px; }
.settings-list dt:first-child { margin-top: 0; }
.settings-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.settings-list .hint { margin: 4px 0 0; }

/* Trainingsbelastung */
.training-form fieldset {
  display: grid; grid-template-columns: minmax(0, 190px) 120px auto; align-items: center; gap: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px 12px; margin: 0 0 12px;
}
.training-form legend { font-weight: 600; padding: 0 4px; }
.training-form label { display: contents; }
.training-form label input, .training-form select { width: 100%; min-width: 0; }
.training-form small { color: var(--muted); }
.training-form .hint { grid-column: 1 / -1; margin: 4px 0 0; }
@media (max-width: 700px) {
  .training-form fieldset { grid-template-columns: minmax(0, 1fr) 106px 62px; gap: 8px; padding: 8px 10px 10px; }
  .training-form small { font-size: 0.75rem; }
}
select { font: inherit; color: inherit; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.form-neg { color: var(--err); }

/* Verbindungen */
h3 { font-size: 1rem; margin: 18px 0 8px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 9px 18px; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.steps { padding-left: 20px; margin: 0 0 14px; }
.steps li { margin-bottom: 6px; }
code.copy { user-select: all; overflow-wrap: anywhere; }
details { margin: 10px 0; }
summary { cursor: pointer; color: var(--accent); }

/* Anmeldung */
.logout { margin: 0; }
.login-card { max-width: 420px; margin: 40px auto; }

/* Handy-Ansicht: Navigation als Leiste unten, größere Tippflächen */
.ni { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  .topbar { position: sticky; top: 0; z-index: 10; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .topbar nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid;
    grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--card);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .topbar nav a { display: flex; flex-direction: column; align-items: center; gap: 2px;
                  padding: 6px 2px; font-size: 0.72rem; }
  .topbar nav a:hover:not(.active) { background: none; color: var(--text); }
  .ni { display: block; }
  main { padding: 12px 10px calc(84px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; margin-bottom: 12px; }
  h1 { font-size: 1.25rem; }
  /* 16px verhindert das automatische Hineinzoomen in Eingabefelder (iOS) */
  input, textarea { font-size: 16px; }
  .date-row { flex-wrap: wrap; }
  .options { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .options span { width: 100%; height: 48px; }
  .form-footer button { flex: 1 1 100%; padding: 14px; }
  .stack { max-width: none; }
  .stack button { padding: 12px; }
  .chart-wrap { height: 300px; }
  .cal-grid { --hour: 26px; min-width: 760px; }
  .login-card { margin-top: 16px; }
}
@media (display-mode: standalone) {
  .topbar .brand { font-size: 0.95rem; }
}

/* PC-Ansicht: Navigation als ein-/ausklappbare Seitenleiste links, jeder Menüpunkt mit Icon */
:root { --side-w: 232px; }
.nav-collapsed { --side-w: 68px; }
.side-foot { display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { color: var(--accent); }
.nav-toggle { display: none; }
@media (min-width: 701px) {
  .topbar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 10; width: var(--side-w);
    flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 20px;
    padding: 20px 12px; border-bottom: none; border-right: 1px solid var(--border);
    overflow-x: hidden; overflow-y: auto;
  }
  .brand { gap: 12px; padding: 0 0 0 11px; min-width: 0; font-size: 0.95rem; }
  .brand:has(.nav-toggle) { padding-left: 6px; gap: 7px; }
  .nav-toggle + .brand-icon { display: none; }
  .nl { white-space: nowrap; overflow: hidden; }
  .side-foot { margin-top: auto; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 32px; height: 32px; padding: 0; border-radius: 6px; background: none; color: var(--text);
  }
  .nav-toggle:hover { background: var(--accent-soft); color: var(--accent); }
  .logout button.link {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 11px;
    border-radius: 6px; color: var(--muted); text-align: left;
  }
  .topbar nav { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  .topbar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 11px; }
  .ni { display: block; flex: none; }
  .logout button.link:hover { background: var(--accent-soft); color: var(--accent); }
  /* Inhalt nutzt die ganze Breite neben der Seitenleiste */
  main { max-width: none; margin: 0 0 0 var(--side-w); padding: 20px 24px 40px; }
  /* Eingeklappt: nur Icons */
  .nav-collapsed .nl { display: none; }
  .nav-anim .topbar { transition: width 0.2s ease; }
  .nav-anim main { transition: margin-left 0.2s ease; }
}
@media (min-width: 701px) and (prefers-reduced-motion: reduce) {
  .nav-anim .topbar, .nav-anim main { transition: none; }
}
/* Auf dem Handy bleibt "Abmelden" ein schlichter Textlink oben */
@media (max-width: 700px) {
  .logout .ni { display: none; }
  .brand-icon { display: block; }
}

/* Fitness-Diagramm im Stil von Intervals.icu */
:root {
  --fit-ctl: #2a78d6;
  --fit-atl: #4a3aa7;
  --fit-ramp: #1baf7a;
  --zone-transition: #eda100;
  --zone-fresh: #2a78d6;
  --zone-grey: #8a8f98;
  --zone-optimal: #008300;
  --zone-risk: #e34948;
  /* Gesundheit: Einzelwerte in fester Reihenfolge der geprüften Palette */
  --h-1: #2a78d6; --h-2: #eb6834; --h-3: #1baf7a; --h-4: #eda100; --h-5: #e87ba4;
  --h-score: #3e4c59; --h-sleep: #4a3aa7; --h-hr: #e34948; --h-weight: #1baf7a;
  --h-recovery: #1baf7a; --h-strain: #e34948; --h-stress: #eb6834; --h-stress-max: #eda100;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fit-ctl: #3987e5;
    --fit-atl: #d55181;
    --fit-ramp: #199e70;
    --zone-transition: #c98500;
    --zone-fresh: #3987e5;
    --zone-grey: #8d929b;
    --zone-optimal: #2fa52f;
    --zone-risk: #e66767;
    --h-1: #3987e5; --h-2: #d95926; --h-3: #199e70; --h-4: #c98500; --h-5: #d55181;
    --h-score: #c3c9d1; --h-sleep: #9085e9; --h-hr: #e66767; --h-weight: #199e70;
    --h-recovery: #199e70; --h-strain: #e66767; --h-stress: #d95926; --h-stress-max: #c98500;
  }
}
.range-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 16px; }
.fit-ranges { display: flex; flex-wrap: wrap; gap: 4px; }
.fit-ranges button {
  font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.fit-ranges button:hover { border-color: var(--accent); color: var(--accent); }
.fit-ranges button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fit-span { font-size: 0.85rem; color: var(--muted); }
.fit-body { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.fit-charts { min-width: 0; outline: none; border-radius: 6px; }
.fit-charts:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.fit-panel { position: relative; }
.fit-panel + .fit-panel { margin-top: 6px; }
.fit-readout dt.toggle { cursor: pointer; border-radius: 4px; }
.fit-readout dt.toggle:hover { color: var(--text); }
.fit-readout dt.toggle:focus-visible { outline: 2px solid var(--accent); }
.fit-readout dt.toggle[aria-pressed="false"] { text-decoration: line-through; opacity: 0.6; }
.fit-readout dt.toggle[aria-pressed="false"] + dd { opacity: 0.4; }
.fit-panel-main { height: 260px; }
.fit-panel-form { height: 150px; }
.fit-panel-ramp { height: 90px; }
.fit-panel-h-score, .fit-panel-h-items { height: 170px; }
.fit-panel-h-small { height: 110px; }
.fit-readout { font-size: 0.9rem; }
.fit-date { font-weight: 600; margin-bottom: 8px; }
.fit-readout dl { display: grid; grid-template-columns: auto auto; gap: 4px 12px; margin: 0 0 14px; }
.fit-readout dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fit-readout dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fit-readout dd small { display: block; font-weight: 400; color: var(--muted); white-space: nowrap; }
.fit-zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.fit-zones li { display: flex; align-items: center; gap: 6px; }
.fit-zones small { margin-left: auto; font-variant-numeric: tabular-nums; }
.fit-explain { margin-bottom: 0; }
@media (max-width: 700px) {
  .fit-body { grid-template-columns: 1fr; }
  .fit-panel-main { height: 210px; }
  .fit-panel-form { height: 130px; }
  .fit-panel-ramp { height: 80px; }
  .fit-panel-h-score, .fit-panel-h-items { height: 150px; }
  .fit-panel-h-small { height: 100px; }
  .fit-readout dl { grid-template-columns: auto auto auto auto; }
  #health-readout { grid-template-columns: auto auto; }
  .fit-zones { grid-template-columns: 1fr 1fr; }
}

/* Tageseintrag aus dem Formulargenerator – Regeln aus der Beispielanwendung
   (static/style.css), unter .fg-form gekapselt und an die Farben des Trackers angepasst. */
.form-source { margin: -6px 0 14px; }
.fg-form .lbl { display: block; font-weight: 600; margin-bottom: 4px; }
.fg-form input[type=text], .fg-form input[type=email], .fg-form input[type=number],
.fg-form input[type=date], .fg-form select, .fg-form textarea { width: 100%; }
.fg-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; color: inherit; }
.fg-form textarea { min-height: 90px; resize: vertical; }
.fg-form .form-row { margin-bottom: 16px; }
.fg-form .form-row .help { font-size: 0.92rem; color: var(--muted); margin-top: 3px; }
.fg-form .form-row .error-msg { font-size: 0.92rem; color: var(--err); margin-top: 3px; }
.fg-form .form-row.invalid input, .fg-form .form-row.invalid select, .fg-form .form-row.invalid textarea { border-color: var(--err); }
.fg-form .form-row .req { color: var(--err); margin-left: 2px; }
.fg-form .form-row .choices label { display: flex; align-items: center; gap: 8px; font-weight: normal; margin: 2px 0; min-height: 32px; }
.fg-form .form-section { font-size: 1.05rem; font-weight: 600; border-bottom: 2px solid var(--accent-soft); padding-bottom: 4px; margin: 24px 0 12px; }
.fg-form .form-section:first-child { margin-top: 0; }
.fg-form .inline-check { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.fg-form .muted { color: var(--muted); }

/* Skala (Schieberegler) */
.fg-form .scale { --thumb: 22px; padding: 2px 0 4px; }
.fg-form .scale-text { text-align: center; font-weight: 600; min-height: 1.5em; margin-bottom: 2px; }
.fg-form .scale[data-answered="false"] .scale-text { color: var(--muted); font-weight: normal; font-style: italic; }
.fg-form .scale-track { position: relative; padding-top: 22px; }
.fg-form .scale-number {
  position: absolute; top: 0;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pos, 0.5));
  transform: translateX(-50%);
  font-weight: 700; font-size: 14px; line-height: 20px; color: var(--text);
}
.fg-form .scale[data-answered="false"] .scale-number { visibility: hidden; }
.fg-form input.scale-range {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: var(--thumb); margin: 0; padding: 0;
  background: transparent; border: none; cursor: pointer;
}
.fg-form input.scale-range:focus { outline: none; }
.fg-form input.scale-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #2e9e3e, #f2c94c 50%, #e53935);
}
.fg-form input.scale-range::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #2e9e3e, #f2c94c 50%, #e53935);
}
.fg-form input.scale-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--thumb); height: var(--thumb); margin-top: calc((4px - var(--thumb)) / 2);
  border-radius: 50%; background: #fff; border: 1px solid #d0d5dc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.fg-form input.scale-range::-moz-range-thumb {
  box-sizing: border-box; width: var(--thumb); height: var(--thumb);
  border-radius: 50%; background: #fff; border: 1px solid #d0d5dc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.fg-form input.scale-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 4px rgba(0, 0, 0, .3); }
.fg-form input.scale-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 4px rgba(0, 0, 0, .3); }
.fg-form .scale[data-answered="false"] input.scale-range::-webkit-slider-thumb { background: #e9ecef; }
.fg-form .scale[data-answered="false"] input.scale-range::-moz-range-thumb { background: #e9ecef; }
.fg-form .scale.reversed input.scale-range::-webkit-slider-runnable-track { background: linear-gradient(to right, #e53935, #f2c94c 50%, #2e9e3e); }
.fg-form .scale.reversed input.scale-range::-moz-range-track { background: linear-gradient(to right, #e53935, #f2c94c 50%, #2e9e3e); }

/* Smiley-Bewertung: Text links, fünf Smileys rechts in einer Linie */
.fg-form .smiley-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 6px; }
.fg-form .smiley-row .smiley-question { flex: 1 1 240px; margin-bottom: 0; }
.fg-form .smiley-row .help, .fg-form .smiley-row .error-msg { flex-basis: 100%; }
.fg-form .smiley-choices { display: flex; gap: 8px; }
.fg-form .smiley { position: relative; display: block; line-height: 0; cursor: pointer; }
.fg-form .smiley input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fg-form .smiley svg {
  width: 40px; height: 40px; border-radius: 50%;
  filter: grayscale(.3); opacity: .55;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}
.fg-form .smiley:hover svg { filter: none; opacity: .9; transform: scale(1.08); }
.fg-form .smiley input:checked + svg { filter: none; opacity: 1; transform: scale(1.18); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.fg-form .smiley input:focus-visible + svg { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) {
  .fg-form .smiley-choices { gap: 6px; width: 100%; justify-content: space-between; }
  .fg-form .smiley svg { width: 44px; height: 44px; }
}
