/* Gemeinsames CSS. Mobile-first (720px), responsive nach oben mit Maximalbreite. */
:root {
  --green: #2e7d5b;
  --green-soft: #e6f3ec;
  --ink: #1f2a26;
  --muted: #6b7a72;
  --line: #d7e0db;
  --bg: #f6f8f7;
  --radius: 16px;
  --touch: 52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", "Noto Sans Thai", "Sarabun", sans-serif;
  font-size: 18px;            /* grosse Grundschrift (Spec 1.1) */
  line-height: 1.5;
}

/* ---- Yings Layout: eine Spalte, zentriert, Maximalbreite (Spec 1.1) ---- */
.wrap {
  max-width: 520px;           /* am Laptop mittig, am Handy volle Breite */
  margin: 0 auto;
  padding: 16px 16px 56px;
}
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 16px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.topbar.wide {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 20px; margin: 0 0 20px;
}
.topbar.wide nav { display: flex; gap: 18px; align-items: center; }
.topbar.wide nav a { color: var(--green); text-decoration: none; font-weight: 600; }
.hello { color: var(--muted); }

.brand { text-align: center; margin: 24px 0 16px; }
.brand img { border-radius: 22%; }
.brand h1 { font-size: 1.5rem; margin: 10px 0 0; }

.card, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
}
.panel h2 { margin-top: 0; }

/* ---- Eingabe-Elemente: grosse Touch-Targets (>=48px) ---- */
.big-label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 1.05rem; }
.small-label { display:block; color: var(--muted); margin-bottom: 6px; }
.big-input, select.big-input {
  width: 100%;
  min-height: var(--touch);
  font-size: 1.25rem;         /* Zahlen/Thai gross & lesbar */
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.big-input:focus { outline: none; border-color: var(--green); }

button { font-family: inherit; cursor: pointer; }
.btn-primary {
  width: 100%;
  min-height: var(--touch);
  margin-top: 18px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: 12px;
}
.btn-secondary {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 1rem;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 10px;
}
.btn-quiet {
  min-height: 44px; padding: 8px 14px;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 10px;
}
.link-quiet { background: none; border: none; color: var(--muted); font-size: 0.95rem; }

/* ---- Stats (Streak/Woche) — nur positiv ---- */
.stats { display: flex; gap: 12px; margin: 8px 0; }
.stat {
  flex: 1; background: var(--green-soft); border-radius: var(--radius);
  text-align: center; padding: 16px 8px;
}
.stat-num { font-size: 2.4rem; font-weight: 800; color: var(--green); line-height: 1; }
.stat-label { color: var(--muted); margin-top: 6px; }

.section-title { font-size: 1.1rem; margin: 0 0 12px; }

/* ---- Fortschrittsbalken: waechst, keine Soll-Linie ---- */
.bar-row { margin: 12px 0; }
.bar-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 6px;
  overflow-wrap: anywhere; word-break: break-word;   /* lange Thai-Namen umbrechen */
}
.bar-track { background: var(--green-soft); border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill {
  height: 100%; background: var(--green); border-radius: 999px;
  transition: width .5s ease;       /* nur wachsen/leise sinken, keine Dramatik */
}
.bar-min { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* ---- Korrektur-Eintraege ---- */
.entry { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 4px 12px; }
.entry summary {
  list-style: none; cursor: pointer; padding: 12px 0;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.entry summary::-webkit-details-marker { display: none; }
.entry-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-course { font-weight: 600; overflow-wrap: anywhere; }
.entry-min { margin-left: auto; font-weight: 700; }
.entry-edit { display: flex; gap: 10px; align-items: center; padding: 8px 0 14px; flex-wrap: wrap; }
.inline-edit { display: flex; gap: 10px; align-items: center; flex: 1; }
.inline-edit .big-input { flex: 1; }
.inline { display: inline; }

.tz-card { background: transparent; border-style: dashed; }

/* ---- Hinweise ---- */
.notice { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.notice.gentle { background: var(--green-soft); border-color: var(--green); color: var(--ink); }

/* ============ Michaels Seite (Deutsch, nuechtern) ============ */
body.michael { background: #fff; }
.wrap-wide h1 { font-size: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.grid { width: 100%; border-collapse: collapse; margin: 12px 0; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.grid th.num, .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid tr.inactive { opacity: 0.55; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row-form input, .row-form select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.th-input { font-family: "Noto Sans Thai", "Sarabun", system-ui, sans-serif; }
.tag { font-size: 0.75rem; background: #eee; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
code { background: #f0f3f1; padding: 1px 6px; border-radius: 6px; }

/* Stiller Ampelstatus (Spec 8.1) */
.ampel { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.ampel-gruen { background: #3aa66b; }
.ampel-gelb { background: #e0b400; }
.ampel-rot { background: #c1574e; }
