/* Allergie-Tagebuch – Stylesheet (mobile first) */

:root {
  --primary: #0f766e;
  --primary-strong: #115e59;
  --primary-soft: #ccfbf1;
  --primary-tint: #f0fdfa;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --mild: #f2b544;
  --severe: #c0392b;
  --warn-bg: #fff7ed;
  --warn: #c2410c;
  --ok: #15803d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
  --tabbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --p0: #16a34a; --p1: #4dab3a; --p2: #7cb52e; --p3: #a3b522; --p4: #c9b21a; --p5: #e5a711;
  --p6: #f59e0b; --p7: #f97316; --p8: #ef5a28; --p9: #dc3b2a; --p10: #b91c1c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon.ok { color: var(--ok); }

/* ---------- Institution (UZH) ---------- */
.orgbar { background: #fff; border-bottom: 1px solid var(--border); }
.orgbar-inner { max-width: 1120px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; gap: .9rem; }
.org-logo { display: block; line-height: 0; }
.org-logo img { height: 40px; width: auto; }
.org-unit { display: flex; flex-direction: column; justify-content: center; padding-left: .9rem; border-left: 1px solid #1f2937; min-height: 40px; font-size: .82rem; line-height: 1.3; color: #111827; }
@media (min-width: 640px) {
  .org-logo img { height: 52px; }
  .org-unit { min-height: 52px; font-size: .95rem; }
}

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #14b8a6, var(--primary)); color: #fff;
}
.brand-mark .icon { width: 22px; height: 22px; }
.mainnav { display: none; gap: .25rem; }
.mainnav a {
  display: flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem;
}
.mainnav a:hover { background: var(--bg); color: var(--text); }
.mainnav a.active { background: var(--primary-tint); color: var(--primary); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.langswitch { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.langswitch a { padding: .2rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.langswitch a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.btn-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* Tierarzt-Navigation auf dem Handy als zweite Zeile */
body:not(.has-tabbar) .mainnav { display: flex; order: 3; width: 100%; overflow-x: auto; }

/* ---------- Tableiste unten (Besitzer, Handy) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
}
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.active { color: var(--primary); }

/* ---------- Grundgerüst ---------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 1rem; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; }
.footer p { max-width: 640px; margin: 0 auto; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, .03); padding: 1.15rem; margin-bottom: 1rem;
}
.card-inset { background: #fafbfb; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; }
.card-title { font-size: 1.05rem; margin-bottom: .75rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.card-head .card-title { margin: 0; }
.sub-title { font-size: .95rem; margin: 1.25rem 0 .5rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: .25rem 0 1rem; }
.page-head h1 { margin: 0; }
.intro { max-width: 70ch; margin-top: -.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--primary); margin-bottom: .35rem; }
.lead { font-size: 1.05rem; color: #374151; }
.empty { color: var(--muted); font-style: italic; }
.empty-state { text-align: center; padding: 2rem 1rem; }
.link-more { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; text-decoration: none; font-size: .92rem; margin-top: .5rem; }
.count { display: inline-block; font-size: .9rem; background: var(--primary-tint); color: var(--primary); border-radius: 999px; padding: .1rem .6rem; vertical-align: middle; }
.back-link { display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; font-weight: 600; margin-bottom: .75rem; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-dash, .grid-2-wide { display: grid; gap: 0 1rem; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ---------- Meldungen ---------- */
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; transition: opacity .6s; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash.fade { opacity: 0; }
.notice { display: flex; gap: .75rem; background: var(--warn-bg); color: #7c2d12; border-radius: var(--radius-sm); padding: 1rem; }
.notice .icon { color: var(--warn); margin-top: .1rem; }
.notice p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 118, 110, .3); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg); }
.btn-small { min-height: 34px; padding: .35rem .75rem; font-size: .875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-xl { min-height: 60px; padding: 1rem 1.6rem; font-size: 1.15rem; border-radius: 16px; }
.btn-block { width: 100%; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: .9rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .6rem; }
.form fieldset + fieldset { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .1rem; }
.field > span, .field > legend { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); font-size: .8rem; }
.field.narrow { max-width: 320px; }
.optional { font-style: normal; font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border-strong); border-radius: 10px; padding: .65rem .8rem; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .18); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; min-height: 90px; }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
:focus-visible { outline: 3px solid rgba(15, 118, 110, .45); outline-offset: 2px; }

/* Segmentierte Auswahl */
.seg { display: inline-flex; background: #e9eceb; border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button {
  border: 0; background: transparent; font: inherit; font-size: .875rem; font-weight: 600; color: var(--muted);
  padding: .4rem .8rem; border-radius: 9px; cursor: pointer; text-decoration: none;
}
.seg .on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.filter-seg { margin-bottom: 1rem; }

/* Pillen-Auswahl (Radio/Checkbox) */
.pill-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-option { position: relative; cursor: pointer; }
.pill-option input { position: absolute; opacity: 0; pointer-events: none; }
.pill-option span {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: #fff; font-weight: 600; font-size: .95rem; transition: all .15s;
}
.pill-option input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.pill-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15, 118, 110, .3); }
.pill-option.pill-none input:checked + span { background: var(--ok); border-color: var(--ok); }

/* Tierart-Kacheln */
.species-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .9rem; }
.species-tile { position: relative; cursor: pointer; }
.species-tile input { position: absolute; opacity: 0; }
.species-tile > span:not(.species-emoji) { display: block; text-align: center; font-weight: 700; }
.species-tile {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1rem .5rem;
  border: 2px solid var(--border); border-radius: var(--radius); background: #fff; transition: all .15s;
}
.species-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.species-tile:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(15, 118, 110, .35); }
.species-emoji { font-size: 2.4rem; line-height: 1; }
.species-pick.small .species-tile { flex-direction: row; justify-content: center; padding: .6rem; }
.species-pick.small .species-emoji { font-size: 1.6rem; }

/* Schalter */
.switch-group { display: grid; gap: .25rem; margin-bottom: .75rem; }
.switch { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: #d1d5db; position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px rgba(15, 118, 110, .35); }

/* ---------- Start / Anmeldung ---------- */
.hero { display: grid; gap: 1.5rem; align-items: center; padding: 1rem 0 2rem; }
.hero h1 { font-size: 2rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-art { background: radial-gradient(circle at 50% 45%, #fff 0, #e6f4f1 70%); border-radius: 28px; padding: 1.5rem; }
.features { display: grid; gap: 1rem; }
.feature { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.feature h2 { font-size: 1.05rem; margin: .6rem 0 .3rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.auth-card { max-width: 440px; margin: 1rem auto 2rem; padding: 1.5rem; }
.auth-card.wide { max-width: 620px; }
.auth-card.center { text-align: center; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin-top: 1.25rem; font-size: .92rem; }
.auth-links a { display: inline-flex; align-items: center; gap: .2rem; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--primary); margin: 0; }

/* ---------- Heute ---------- */
.card-accent { background: linear-gradient(135deg, #ffffff 0%, #effaf7 100%); border: 1px solid #d5efe9; }
.greeting { display: grid; gap: 1rem; }
.greeting h1 { font-size: 1.55rem; }
.greeting .lead { margin: 0; }
.greeting-action { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.greeting-action .btn-xl { width: 100%; }
.pvas-badge { width: 72px; height: 72px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.pvas-badge span { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.pvas-badge small { font-size: .65rem; font-weight: 600; opacity: .9; }
.weekdots { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; margin-bottom: .6rem; }
.weekdot { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600; }
.weekdot .dot { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--border-strong); display: grid; place-items: center; background: #fff; }
.weekdot.done .dot { border: 0; background: var(--primary); color: #fff; }
.weekdot.today .dname { color: var(--text); }
.weekdot.today .dot { box-shadow: 0 0 0 3px var(--primary-soft); }
.chart { width: 100%; }
.chart-mini { height: 150px; }
.med-list { list-style: none; margin: 0; padding: 0; }
.med-list li { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i n" "i s"; column-gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.med-list li:last-child { border-bottom: 0; }
.med-list .med-icon { grid-area: i; }
.med-name { grid-area: n; font-weight: 600; }
.med-sched { grid-area: s; color: var(--muted); font-size: .875rem; }
.med-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #eef2ff; color: #4338ca; flex: none; }
.med-icon.form-injection { background: #fdf2f8; color: #be185d; }
.med-icon.form-spray, .med-icon.form-drops, .med-icon.form-cleaner { background: #ecfeff; color: #0e7490; }
.med-icon.form-capsule { background: #fef3c7; color: #b45309; }

/* pVAS-Farben */
.pvas-0 { --pc: var(--p0); } .pvas-1 { --pc: var(--p1); } .pvas-2 { --pc: var(--p2); } .pvas-3 { --pc: var(--p3); }
.pvas-4 { --pc: var(--p4); } .pvas-5 { --pc: var(--p5); } .pvas-6 { --pc: var(--p6); } .pvas-7 { --pc: var(--p7); }
.pvas-8 { --pc: var(--p8); } .pvas-9 { --pc: var(--p9); } .pvas-10 { --pc: var(--p10); }
.pvas-badge, .pvas-chip { background: var(--pc, var(--muted)); }
.pvas-chip { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .4rem; border-radius: 9px; color: #fff; font-weight: 800; font-size: .95rem; }

/* ---------- Tagebuch-Assistent ---------- */
.wizard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.wizard-head h1 { margin: 0; font-size: 1.4rem; }
.date-switch { position: relative; display: inline-flex; align-items: center; gap: .3rem; color: var(--primary); }
.date-switch input { width: auto; min-height: 40px; padding: .35rem .5rem; font-size: .875rem; }
.date-switch .icon { display: none; }
.steps { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: .35rem; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .7rem; color: var(--muted); font-weight: 600; cursor: pointer; position: relative; }
.steps li::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.active::before { background: var(--primary); }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--border-strong); position: relative; z-index: 1; font-size: .85rem; }
.steps li.active .step-num { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.steps li.done .step-num { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.steps li.active { color: var(--text); }
.step-label { display: none; text-align: center; }
.steps li.active .step-label { display: block; }
.wizard.js .step { display: none; }
.wizard.js .step.active { display: block; animation: stepin .25s ease; }
@keyframes stepin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step h2 { font-size: 1.25rem; }
.wizard-nav {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 20;
  display: flex; justify-content: space-between; gap: .75rem;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow-lg);
}
.wizard-nav .btn { flex: 1; max-width: 240px; }
.wizard-nav [data-next], .wizard-nav [data-save] { margin-left: auto; }
.hint { display: flex; gap: .4rem; align-items: flex-start; color: #374151; background: var(--primary-tint); border-radius: 10px; padding: .55rem .75rem; font-size: .9rem; }
.hint .icon { color: var(--primary); }

/* pVAS-Regler */
:where(.pvas) { --pc: var(--border-strong); }
.pvas { margin: 1.25rem 0 .5rem; }
.pvas input[type=range]:focus, .pvas input[type=range]:focus-visible { outline: none; box-shadow: none; border: 0; }
.pvas input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(15, 118, 110, .25), 0 2px 8px rgba(0, 0, 0, .25); }
.pvas-value {
  display: grid; place-items: center; width: 92px; height: 92px; margin: 0 auto 1rem; border-radius: 28px;
  font-size: 3rem; font-weight: 800; color: #fff; background: var(--pc); transition: background .2s;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
}
.pvas:not(.touched) .pvas-value { background: #e5e7eb; color: var(--muted); }
.pvas input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0;
}
.pvas input[type=range]::-webkit-slider-runnable-track {
  height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--p0), var(--p2), var(--p4), var(--p6), var(--p8), var(--p10));
}
.pvas input[type=range]::-moz-range-track {
  height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--p0), var(--p2), var(--p4), var(--p6), var(--p8), var(--p10));
}
.pvas input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 38px; height: 38px; margin-top: -12px; border-radius: 50%;
  background: #fff; border: 4px solid var(--pc); box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.pvas input[type=range]::-moz-range-thumb {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--pc); box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.pvas:not(.touched) input[type=range]::-webkit-slider-thumb { border-color: #9ca3af; }
.pvas-ticks { display: flex; justify-content: space-between; padding: 0 9px; margin-top: .25rem; }
.pvas-ticks span {
  width: 30px; height: 30px; margin: 0 -11px; display: grid; place-items: center; border-radius: 50%;
  font-size: .85rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.pvas-ticks span.active { background: var(--pc); color: #fff; }
.pvas-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.pvas-desc { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: #f9fafb; border-left: 5px solid var(--pc); min-height: 92px; }
.pvas-desc strong { display: block; font-size: 1.05rem; margin-bottom: .2rem; }
.pvas-desc p { margin: 0; color: #374151; }
.scale-details { margin-top: 1rem; }
.scale-details summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: .4rem 0; }
.scale-list { margin: .5rem 0; display: grid; gap: .6rem; }
.scale-list dt { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.scale-list dd { margin: .2rem 0 0 38px; color: #4b5563; font-size: .92rem; }

/* Ja/Nein */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0; }
.yesno-btn { position: relative; cursor: pointer; }
.yesno-btn input { position: absolute; opacity: 0; }
.yesno-btn span { display: grid; place-items: center; min-height: 56px; border-radius: 14px; border: 2px solid var(--border-strong); font-weight: 700; font-size: 1.1rem; background: #fff; transition: all .15s; }
.yesno-btn input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.yesno-btn input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15, 118, 110, .35); }

/* Körpermodell */
.bodymap { display: grid; gap: .75rem; margin: .75rem 0; }
.bodymap-view { margin: 0; text-align: center; }
.bodymap-view svg { width: 100%; height: auto; max-height: 340px; overflow: visible; }
.bodymap-view figcaption { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .2rem; }
.bodymap .region { fill: #ead9c6; stroke: #fff; stroke-width: 2; stroke-linejoin: round; transition: fill .15s; }
.bodymap .region.far { fill: #d8c2a8; }
.bodymap-cat .region { fill: #d5dae1; }
.bodymap-cat .region.far { fill: #bcc4ce; }
.bodymap .region[data-sev=mild] { fill: var(--mild); }
.bodymap .region[data-sev=severe] { fill: var(--severe); }
.bodymap.interactive .region { cursor: pointer; }
.bodymap.interactive .region:hover { filter: brightness(.93); }
.bodymap.interactive .region:focus { outline: none; stroke: var(--primary); stroke-width: 3; }
.bm-decor { pointer-events: none; }
.bm-eye { fill: #374151; }
.bm-line { fill: none; stroke: #374151; stroke-width: 1.5; stroke-linecap: round; }
.legend { display: flex; gap: 1rem; font-size: .875rem; font-weight: 600; margin-top: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 5px; }
.sw-mild { background: var(--mild); }
.sw-severe { background: var(--severe); }
.lesion-chips { display: grid; gap: .5rem; }
.lesion-chip { display: flex; align-items: center; gap: .5rem; padding: .4rem .4rem .4rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.lesion-chip.sev-mild { border-left: 5px solid var(--mild); }
.lesion-chip.sev-severe { border-left: 5px solid var(--severe); }
.lesion-name { flex: 1; font-weight: 600; }
.lesion-chip .seg button.on { color: #fff; }
.lesion-chip.sev-mild .seg button.on { background: #d4911a; }
.lesion-chip.sev-severe .seg button.on { background: var(--severe); }
.chip-x { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); cursor: pointer; }
.chip-x:hover { background: var(--bg); color: var(--text); }

/* Medikamente im Tagebuch */
.med-days { display: grid; gap: .75rem; margin: 1rem 0; }
.med-row-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.med-row-title { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.med-row .hint { margin-bottom: .6rem; }
.daychips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.daychip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .35rem .1rem .45rem;
  border-radius: 12px; border: 1.5px solid var(--border-strong); background: #fff; font: inherit; cursor: pointer; color: var(--text);
  -webkit-tap-highlight-color: transparent; min-height: 74px;
}
.daychip.planned:not(.on) { border-style: dashed; border-color: var(--primary); }
.dc-day { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.dc-date { font-size: .78rem; font-weight: 600; }
.dc-mark { width: 26px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; margin-top: 2px; background: var(--bg); }
.daychip.on { border-color: var(--primary); background: var(--primary-tint); }
.daychip.on .dc-mark { background: var(--primary); color: #fff; }
.daychip.partial .dc-mark { background: #5eead4; color: #134e4a; }
.med-add { margin-top: .5rem; }
.med-add-panel { margin-top: .75rem; display: flex; flex-direction: column; gap: .75rem; }

/* Nebenwirkungen */
.effect-row { margin-bottom: .75rem; }
.effect-med { display: block; margin-bottom: .6rem; }
.effect-other { margin-top: .6rem; }

/* Zusammenfassung */
.summary { display: grid; gap: .1rem; margin-bottom: 1rem; }
.sum-row { display: grid; grid-template-columns: 1fr; gap: .25rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.sum-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); }
.chips-inline { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 999px; background: #f3f4f6; font-size: .82rem; font-weight: 600; }
.tag .icon { width: 1em; height: 1em; }
.tag.sev-mild { background: #fdf0d5; color: #8a5a00; }
.tag.sev-severe { background: #fbe1de; color: #9b1c1c; }
.tag-med { background: #eef2ff; color: #3730a3; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Verlauf ---------- */
.seg-lg a { padding: .5rem .9rem; }
.chart-history { min-height: 280px; }
.day-list { display: grid; gap: .6rem; }
.day-card { display: grid; grid-template-columns: 70px 1fr auto; gap: .75rem; align-items: start; margin: 0; padding: .9rem; }
.day-date { display: flex; flex-direction: column; line-height: 1.25; font-size: .82rem; color: var(--muted); }
.day-date strong { color: var(--text); font-size: .95rem; text-transform: capitalize; }
.day-body { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.day-note { width: 100%; margin: .2rem 0 0; font-size: .9rem; color: #4b5563; font-style: italic; }

/* ---------- Medikamentenplan ---------- */
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-item { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plan-item:last-child { border-bottom: 0; }
.plan-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; line-height: 1.35; }
.plan-actions { display: flex; align-items: center; gap: .25rem; }
.plan-list.past .plan-main strong { color: var(--muted); }

/* ---------- Tierarzt ---------- */
.search { position: relative; flex: 1; max-width: 420px; min-width: 220px; }
.search .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 2.5rem; border-radius: 999px; }
.patient-table { padding: .25rem 0; overflow: hidden; }
.pt-row { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: .85rem 1rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); align-items: center; }
.pt-row:last-child { border-bottom: 0; }
a.pt-row:hover { background: #fafbfb; }
.pt-head { display: none; }
.pt-who { display: flex; align-items: center; gap: .75rem; grid-column: 1 / -1; }
.pt-who strong { display: block; }
.pt-who small { color: var(--muted); }
.pt-avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-tint); font-size: 1.4rem; flex: none; }
.pt-avatar.lg { width: 64px; height: 64px; font-size: 2.2rem; border-radius: 20px; }
.pt-last, .pt-pvas, .pt-n14 { font-size: .875rem; display: flex; align-items: center; gap: .4rem; }
.pt-last::before, .pt-pvas::before, .pt-n14::before { content: attr(data-label) ": "; color: var(--muted); font-size: .78rem; }
.pt-last.warn { color: var(--warn); font-weight: 600; }
.pt-go { display: none; color: var(--muted); }
.trend { font-size: .78rem; font-weight: 700; }
.trend.up { color: var(--severe); }
.trend.down { color: var(--ok); }
.bar { display: inline-block; width: 60px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.patient-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.patient-id h1 { margin: 0 0 .2rem; }
.patient-id p { margin: 0; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 0; }
.stats div { background: var(--bg); border-radius: 12px; padding: .6rem .8rem; }
.stats dt { font-size: .75rem; color: var(--muted); font-weight: 600; }
.stats dd { margin: 0; font-size: 1.15rem; font-weight: 700; }
.range-picker { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.range-custom { display: inline-flex; align-items: center; gap: .35rem; }
.range-custom input { width: 150px; min-height: 38px; padding: .3rem .5rem; font-size: .875rem; }
.chart-vet { min-height: 320px; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .5rem; }
.export-btns { display: inline-flex; gap: .35rem; }
#bodymap-heat .bodymap { grid-template-columns: 1fr; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); }
.heat-scale { display: inline-block; width: 140px; height: 12px; border-radius: 4px; background: linear-gradient(90deg, rgb(243, 239, 233), rgb(253, 230, 178), rgb(242, 153, 74), rgb(176, 30, 35)); }
.heat-range { display: inline-flex; justify-content: space-between; width: 140px; display: none; }
.region-stats { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .4rem; font-size: .875rem; }
.region-stats li { display: grid; grid-template-columns: 110px 1fr; gap: .2rem .6rem; align-items: center; }
.rs-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.rs-bar i { display: block; height: 100%; border-radius: inherit; }
.rs-val { grid-column: 2; color: var(--muted); font-size: .78rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.table td { padding: .5rem; border-bottom: 1px solid var(--border); }
.csv-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.med-admin-item.inactive { opacity: .65; }
.med-admin-form { display: flex; flex-direction: column; gap: .5rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.opt-list { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.opt-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-right: .25rem; }
.opt-chip { border: 1.5px solid var(--primary); background: var(--primary-tint); color: var(--primary-strong); border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.opt-chip.off { border-color: var(--border-strong); background: #fff; color: var(--muted); text-decoration: line-through; }
.opt-add { display: inline-flex; gap: .3rem; align-items: center; }
.opt-add select, .opt-add input { min-height: 34px; padding: .25rem .5rem; font-size: .85rem; width: auto; }
.opt-add input { width: 64px; }
.export-grid { display: grid; gap: .75rem; margin-top: .5rem; }
.export-tile {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; text-align: left; padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font: inherit; cursor: pointer;
}
.export-tile:hover { border-color: var(--primary); background: var(--primary-tint); }
.export-tile .icon { grid-row: span 2; color: var(--primary); width: 28px; height: 28px; }
.export-tile span { color: var(--muted); font-size: .875rem; }

/* ---------- Ab Tablet ---------- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
  .greeting { grid-template-columns: 1fr auto; align-items: center; }
  .greeting-action .btn-xl { width: auto; }
  .bodymap { grid-template-columns: 3fr 2fr; align-items: end; }
  .step-label { display: block; }
  .sum-row { grid-template-columns: 160px 1fr; align-items: center; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .export-grid { grid-template-columns: 1fr 1fr; }
  .daychips.many { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .date-switch .icon { display: block; }
}

/* ---------- Ab Desktop ---------- */
@media (min-width: 960px) {
  h1 { font-size: 1.85rem; }
  .container { padding: 1.5rem 1.25rem; }
  body.has-tabbar { padding-bottom: 0; }
  .tabbar { display: none; }
  .mainnav, body:not(.has-tabbar) .mainnav { display: flex; order: 0; width: auto; }
  .wizard-nav { bottom: 12px; }
  .hero { grid-template-columns: 1.1fr 1fr; padding: 2.5rem 0 3rem; }
  .hero h1 { font-size: 2.6rem; }
  .features { grid-template-columns: repeat(4, 1fr); }
  .grid-dash { grid-template-columns: 1fr 1.3fr 1fr; }
  .grid-2-wide { grid-template-columns: 1fr 1fr; }
  .wizard { max-width: 760px; margin: 0 auto; }
  .patient-head { grid-template-columns: auto 1fr auto; }
  .stats { grid-column: auto; grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .pt-row { grid-template-columns: 2.2fr 1fr 1fr 1fr 24px; }
  .pt-head { display: grid; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .6rem 1rem; }
  .pt-who { grid-column: auto; }
  .pt-last::before, .pt-pvas::before, .pt-n14::before { content: none; }
  .pt-go { display: block; }
  #bodymap-heat .bodymap { grid-template-columns: 3fr 2fr; }
  .switch-group { grid-template-columns: repeat(3, 1fr); column-gap: 1.5rem; }
  .switch-group legend { grid-column: 1 / -1; }
  .heat-range { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
