/* Abnehm-Plan – mobile first, no external fonts or frameworks (strict CSP) */
:root {
  --gruen: #15803d;
  --gruen-dunkel: #14532d;
  --gruen-hell: #dcfce7;
  --blau-hell: #dbeafe;
  --grau-hell: #f1f5f9;
  --rand: #d4d4d8;
  --text: #18181b;
  --leise: #71717a;
  --rot: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #f6f7f4;
  line-height: 1.5;
  overflow-wrap: break-word;
}
a { color: var(--gruen-dunkel); }
h1 { font-size: 1.6rem; margin: 0.5rem 0; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
small { color: var(--leise); }

/* Header + menu */
.kopf { background: var(--gruen-dunkel); color: #fff; }
.kopf-innen { max-width: 1100px; margin: 0 auto; padding: 0.6rem 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.marke { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.menu { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.menu a { color: #e4f5e9; text-decoration: none; padding: 0.35rem 0.7rem; border-radius: 999px; }
.menu a:hover { background: rgba(255,255,255,0.12); }
.menu a.aktiv { background: #fff; color: var(--gruen-dunkel); font-weight: 600; }

.seite { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.fuss { max-width: 1100px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--leise); font-size: 0.85rem; }

/* Cards and layout */
.karte { background: #fff; border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }
.raster { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.raster .karte { margin: 0; }
@media (min-width: 760px) { .raster.zwei { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.held { padding: 0.5rem 0 0.25rem; }
.held p { font-size: 1.05rem; max-width: 46rem; }
.untertitel { color: var(--leise); margin-top: 0; }
.leise { color: var(--leise); }
.hinweis { color: var(--leise); font-size: 0.9rem; }
.erfolg { border-color: var(--gruen); background: var(--gruen-hell); }
.fehler { border-color: var(--rot); }
.meldung { background: var(--gruen-hell); border-radius: var(--radius); padding: 0.5rem 0.9rem; display: inline-block; }
.schritte li { margin-bottom: 0.4rem; }

/* Forms */
.formular { display: grid; gap: 0.8rem; }
.formular.schmal { max-width: 26rem; }
label { display: grid; gap: 0.25rem; font-weight: 500; }
input, select, textarea, button { font: inherit; }
input, select, textarea { padding: 0.5rem 0.6rem; border: 1px solid var(--rand); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }
button { background: var(--gruen); color: #fff; border: 0; border-radius: 8px; padding: 0.6rem 1.1rem; font-weight: 600; cursor: pointer; justify-self: start; }
button:hover { background: var(--gruen-dunkel); }
button.zweitrangig { background: #fff; color: var(--gruen-dunkel); border: 1px solid var(--gruen); }
.zeile-formular { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.zeile-formular input[name=name] { flex: 1 1 12rem; width: auto; }
.zeile-formular select { width: auto; }
.haken-feld { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; }
.haken-feld input { width: auto; }
.haken-feld.gross { font-weight: 600; font-size: 1.05rem; }
.haken-feld.gross input { width: 1.4rem; height: 1.4rem; accent-color: var(--gruen); }
.liste-bearbeiten { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.liste-bearbeiten li.inaktiv { opacity: 0.55; }

/* Links section */
.link-zeile { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; margin-bottom: 0.6rem; align-items: center; }
.link-name { grid-column: 1 / -1; font-weight: 600; font-size: 0.9rem; }
.link-zeile input { font-family: ui-monospace, monospace; font-size: 0.85rem; }

/* Tabs (level, measurement) */
.reiter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.reiter a { padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--gruen); text-decoration: none; }
.reiter a.aktiv { background: var(--gruen); color: #fff; }

/* Day type badges */
.art { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.art-team { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.art-haus { background: var(--blau-hell); color: #1e3a8a; }
.art-ruhe { background: var(--grau-hell); color: var(--leise); }

/* Plan days */
.tage { display: grid; gap: 0.6rem; grid-template-columns: minmax(0, 1fr); }
.tag { background: #fff; border: 1px solid var(--rand); border-radius: var(--radius); }
.tag[open] { border-color: var(--gruen); }
.tag.erledigt { border-left: 5px solid var(--gruen); }
.tag summary { cursor: pointer; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; list-style: none; }
.tag summary::-webkit-details-marker { display: none; }
.tag summary::before { content: "▸"; color: var(--gruen); }
.tag[open] summary::before { content: "▾"; }
.tag > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
.tag-nr { font-weight: 700; }
.tag-datum { color: var(--leise); font-size: 0.9rem; }
.tag-titel { font-weight: 600; flex: 1 1 10rem; }
.heute-marke { background: #facc15; color: #422006; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; }
.ziel { margin-top: 0; }
.bloecke { padding-left: 1.2rem; margin: 0 0 1rem; }
.block { margin-bottom: 0.9rem; }
.block p { margin: 0.2rem 0; }
.block-kopf { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.phase { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--leise); }
.uebung { font-weight: 600; }
.menge { background: var(--gruen-hell); color: var(--gruen-dunkel); border-radius: 6px; padding: 0 0.4rem; font-size: 0.9rem; font-weight: 600; }
.tipp { color: var(--gruen-dunkel); font-style: italic; }
.material { color: var(--leise); font-size: 0.9rem; }
.abhaken { display: grid; gap: 0.7rem; background: var(--grau-hell); border-radius: var(--radius); padding: 0.9rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .abhaken { grid-template-columns: auto 14rem 1fr auto; align-items: end; } }

/* Status of a person */
.status { display: grid; gap: 0.5rem; }
@media (min-width: 760px) { .status { grid-template-columns: 1fr 1fr; align-items: center; } }
.status p { margin: 0.3rem 0; }
.fortschritt-balken { width: 100%; height: 0.9rem; accent-color: var(--gruen); }
.heute-text { font-size: 1.05rem; }

/* Tables */
.tabelle-rahmen { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { border-bottom: 1px solid var(--rand); padding: 0.4rem 0.5rem; text-align: left; vertical-align: middle; }
thead th { font-size: 0.85rem; background: var(--grau-hell); }
tfoot th, tfoot td { font-weight: 600; background: var(--grau-hell); }
.matrix td, .matrix thead th:not(:first-child) { text-align: center; min-width: 2.2rem; padding: 0.35rem 0.2rem; }
.matrix tbody th { white-space: nowrap; }
.matrix .spalte-team { background: #f0fdf4; }
.matrix .spalte-haus { background: #eff6ff; }
.matrix .spalte-ruhe { background: var(--grau-hell); }
.matrix .heute { outline: 2px solid #facc15; outline-offset: -2px; }
.matrix small { display: block; font-size: 0.7rem; line-height: 1; }
.niveau { font-size: 0.75rem; color: var(--leise); font-weight: 400; }
.haken { color: var(--gruen); font-weight: 700; }
.offen { color: var(--rot); }
.notiz-marke { font-size: 0.7rem; color: var(--leise); }
.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.legende { font-size: 0.85rem; color: var(--leise); }
.wert-feld { min-width: 5rem; max-width: 7rem; text-align: right; }
.werte td { white-space: nowrap; }

/* Progress tiles */
.kacheln { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.kachel { border: 1px solid var(--rand); border-radius: var(--radius); padding: 0.7rem; display: grid; gap: 0.2rem; }
.kachel-titel { font-size: 0.85rem; color: var(--leise); }
.kachel-wert { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel-fuss { font-size: 0.8rem; color: var(--leise); }
.besser { color: var(--gruen); }
.schlechter { color: var(--rot); }
.tendenz.gleich { color: var(--leise); }

/* Name picker */
.namen { list-style: none; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.namen a { display: block; background: #fff; border: 1px solid var(--rand); border-radius: var(--radius); padding: 0.9rem; text-decoration: none; font-weight: 600; font-size: 1.1rem; text-align: center; }
.namen a:hover { border-color: var(--gruen); background: var(--gruen-hell); }

/* --- Abnehm-Plan additions --- */
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.raster.seitlich { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .raster.seitlich { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.warnung { border-color: #b45309; background: #fffbeb; }
.hinweis-karte { border-color: #2a78d6; background: #eff6ff; }
fieldset { border: 1px solid var(--rand); border-radius: var(--radius); padding: 0.8rem 1rem 1rem; margin: 0; display: grid; gap: 0.7rem; }
legend { font-weight: 700; padding: 0 0.3rem; }
.feld-reihe { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); align-items: end; }
.auswahl-reihe { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
label.inline { display: flex; align-items: center; gap: 0.4rem; }
input.kurz { width: 7rem; }
button.klein { padding: 0.25rem 0.6rem; font-size: 0.85rem; font-weight: 500; }
.link-zeile { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; align-items: center; }
.link-zeile input { font-family: ui-monospace, monospace; font-size: 0.85rem; }
.heute-liste { padding-left: 1.1rem; margin: 1rem 0 0; }
.heute-liste li { margin-bottom: 0.3rem; }
table.zahlen td { text-align: right; font-variant-numeric: tabular-nums; }
table.zahlen tr.summe th, table.zahlen tr.summe td { font-weight: 700; border-top: 2px solid var(--text); }
.umbruch { white-space: normal; }
.tag-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.regeln { display: grid; gap: 0.5rem; }
.summen { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1rem; }
.summen > div { display: grid; gap: 0.2rem; }
.summen progress { width: 100%; height: 0.8rem; accent-color: var(--gruen); }
.unterkarte { background: var(--grau-hell); border-radius: var(--radius); padding: 0.9rem; margin-top: 1rem; }
.woche { margin: 1.5rem 0; }
.woche h2 { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.phase { font-size: 0.8rem; background: var(--gruen-hell); color: var(--gruen-dunkel); border-radius: 999px; padding: 0.1rem 0.6rem; }
.art-kraft { background: #ede9fe; color: #4c1d95; }
.art-ausdauer { background: var(--blau-hell); color: #1e3a8a; }
.inhalt { margin: 0 0 1rem; padding-left: 1.2rem; }
.inhalt li { margin-bottom: 0.25rem; }
.fortschritt-balken { margin-bottom: 0.5rem; }

/* Weight chart (palette slots 1 and 2 of the reference palette; text stays in text colours) */
.diagramm { margin: 0; }
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm .gitter { stroke: #e7e5e4; stroke-width: 1; }
.diagramm .achse { fill: var(--leise); font-size: 12px; font-variant-numeric: tabular-nums; }
.diagramm .zielpfad { stroke: #8a8984; stroke-width: 1.5; fill: none; stroke-linecap: round; }
.diagramm .trend { stroke: #eb6834; stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.diagramm .punkt { fill: #2a78d6; stroke: #fff; stroke-width: 2; }
.diagramm .treffer { fill: transparent; }
.diagramm .messung:hover .punkt { r: 6; }
.diagramm .beschriftung { fill: var(--text); font-size: 12px; font-weight: 600; }
.legende { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.85rem; color: var(--leise); }
.legende li { display: flex; align-items: center; gap: 0.4rem; }
.schluessel { display: inline-block; }
.schluessel.punkt { width: 10px; height: 10px; border-radius: 50%; background: #2a78d6; }
.schluessel.trend { width: 18px; height: 2px; background: #eb6834; }
.schluessel.zielpfad { width: 18px; height: 2px; background: #8a8984; }
