:root{--bg:#f5f7fb;--card:#fff;--text:#172033;--muted:#6b7280;--line:#e5e7eb;--accent:#2563eb;--danger:#dc2626}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}a{color:var(--accent);text-decoration:none}.topbar{position:sticky;top:0;z-index:10;background:#111827;color:#fff;display:flex;justify-content:space-between;gap:20px;align-items:center;padding:14px 24px}.brand{font-weight:800;font-size:20px}.navlinks{display:flex;gap:10px;flex-wrap:wrap}.navlinks a{color:#e5e7eb;padding:8px 10px;border-radius:8px}.navlinks a:hover{background:#1f2937}.container{max-width:1180px;margin:28px auto;padding:0 18px}.page-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:18px}h1{margin:0 0 6px;font-size:32px}h2{margin:0 0 16px}h3{margin-top:26px}.muted{color:var(--muted)}.small{font-size:13px}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 8px 30px rgba(17,24,39,.04);margin-bottom:18px}.grid{display:grid;gap:18px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.stat-card{display:flex;flex-direction:column;gap:4px;justify-content:center}.stat-card strong{font-size:34px}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:12px;color:var(--muted);font-weight:700}label{display:flex;flex-direction:column;gap:7px;font-weight:700;margin-bottom:15px}input,select{width:100%;padding:12px 13px;border:1px solid #cfd5df;border-radius:10px;font:inherit;background:#fff}button,.button-link{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:11px 15px;font:inherit;font-weight:800;cursor:pointer}.primary{background:var(--accent);color:white}.secondary{background:#eef2ff}.large{padding:14px 20px;font-size:17px}.danger{background:var(--danger);color:#fff}.ghost{background:#fff;color:var(--danger);border:1px solid #fecaca}.small-btn{padding:7px 9px}.danger-zone form{margin-bottom:12px}.narrow{max-width:520px;margin:auto}.flash{padding:12px 14px;border-radius:10px;margin-bottom:14px}.flash.success{background:#dcfce7}.flash.danger{background:#fee2e2}.chart-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.segmented{display:flex;gap:7px;flex-wrap:wrap}.segmented button,.date-filter button{background:#eef2f7}.date-filter{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.date-filter input{width:auto}.chart-wrap{height:400px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:11px 10px;border-bottom:1px solid var(--line)}th{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.pill{display:inline-flex;width:max-content;padding:5px 8px;border-radius:999px;font-size:13px;font-weight:800}.bmi-scale{overflow:hidden;border-radius:10px;border:1px solid #ddd}.bmi-scale div{padding:10px 12px;color:#111}.bmi-under{background:#12b8e8}.bmi-normal{background:#8fd34f}.bmi-over{background:#ffb000}.bmi-ob1{background:#f27c00}.bmi-ob2{background:#ff2b16}.bmi-ob3{background:#e00000;color:#fff!important}.compare-head{display:flex;justify-content:space-between;gap:15px;align-items:center}.compare-meta{font-size:20px}.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.compare-grid img{width:100%;max-height:650px;object-fit:contain;background:#f3f4f6;border-radius:12px}.photo-label{display:block;font-weight:800;margin-bottom:7px}.photo-empty{height:250px;display:grid;place-items:center;background:#f3f4f6;color:var(--muted);border-radius:12px}.photo-set-row{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.photo-set-row div{display:flex;flex-direction:column;gap:3px}.actions{display:flex;gap:8px;align-items:center}.actions form{margin:0}.auth-card{max-width:450px;margin:8vh auto;background:#fff;border-radius:18px;padding:28px;border:1px solid var(--line);box-shadow:0 20px 50px rgba(17,24,39,.08)}@media(max-width:800px){.topbar{align-items:flex-start;flex-direction:column}.stats,.grid.two,.grid.four,.compare-grid{grid-template-columns:1fr}.chart-wrap{height:320px}.stat-card strong{font-size:28px}}

/* WeightTrack Dark Mode */
:root{--input-bg:#fff;--soft:#eef2f7;--topbar:#111827;--topbar-text:#e5e7eb;--shadow:rgba(17,24,39,.04)}
html[data-theme="dark"]{--bg:#08111f;--card:#101a2b;--text:#f4f7fb;--muted:#a8b1c1;--line:#29364a;--input-bg:#111c30;--soft:#18243a;--topbar:#070d18;--topbar-text:#f4f7fb;--shadow:rgba(0,0,0,.22);color-scheme:dark}
body{background:var(--bg);color:var(--text)}.topbar{background:var(--topbar);color:var(--topbar-text)}.navlinks a{color:var(--topbar-text)}.navlinks a:hover{background:var(--soft)}.card,.auth-card{background:var(--card);border-color:var(--line);box-shadow:0 8px 30px var(--shadow)}.muted,.eyebrow,th{color:var(--muted)}input,select,textarea{background:var(--input-bg);color:var(--text);border-color:var(--line)}table th,table td{border-color:var(--line)}.segmented button,.date-filter button,.button-link.secondary{background:var(--soft);color:var(--text)}.theme-toggle{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);background:var(--soft);color:var(--text);border-radius:9px;padding:8px 10px;font:inherit;font-weight:800;cursor:pointer}html[data-theme="dark"] .flash.success{background:#123e2b;color:#b9f6d2}html[data-theme="dark"] .flash.danger{background:#4a171c;color:#ffc6cc}

/* WeightTrack v6 Update UI */
.update-status{padding:12px 14px;border-radius:10px;margin:0 0 16px;border:1px solid var(--line)}.status-ok{background:#dcfce7;color:#14532d}.status-error{background:#fee2e2;color:#7f1d1d}html[data-theme="dark"] .status-ok{background:#123e2b;color:#b9f6d2}html[data-theme="dark"] .status-error{background:#4a171c;color:#ffc6cc}


/* WeightTrack History Navigation */
.brand-link{color:inherit;text-decoration:none;cursor:pointer}
.brand-link:hover{opacity:.85}
.stat-card-link{color:var(--text);text-decoration:none;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;cursor:pointer}
.stat-card-link:hover{transform:translateY(-2px);border-color:#60a5fa;box-shadow:0 12px 32px var(--shadow)}
.stat-link-hint{margin-top:8px;font-size:12px;font-weight:700;color:#60a5fa}
.history-summary{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:18px}
@media(max-width:800px){.history-summary{grid-template-columns:1fr}}


/* WeightTrack v6.2.4 */
.navlinks{
  display:flex;
  align-items:center;
  gap:24px;
}


/* WeightTrack v6.2.5 */
.wt-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(2,6,23,.72);
  backdrop-filter:blur(5px);
}
.wt-modal-backdrop[hidden]{display:none}
.wt-modal{
  width:min(520px,100%);
  background:var(--card);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.4);
  padding:24px;
}
.wt-modal h3{
  margin:0 0 10px;
  font-size:24px;
}
.wt-modal p{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}
.wt-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:24px;
}
.restart-confirm-button{
  border:0;
  border-radius:10px;
  padding:11px 16px;
  background:#7c3aed;
  color:#fff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.restart-confirm-button:hover{filter:brightness(1.08)}
.restart-confirm-button:disabled{opacity:.65;cursor:wait}


/* WeightTrack v6.2.6 - regression fix only */

/* Top dashboard row: Aktuell | BMI | Wochen-Trend */
.dashboard-top-stats{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:18px !important;
  align-items:stretch !important;
}
.dashboard-top-stats > *{
  min-width:0 !important;
  width:auto !important;
  height:100% !important;
}
.dashboard-top-stats .seven-day-card{
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  align-items:flex-start !important;
  gap:6px !important;
}
.dashboard-top-stats .seven-day-card .eyebrow,
.dashboard-top-stats .seven-day-card strong,
.dashboard-top-stats .seven-day-card span{
  display:block !important;
  width:auto !important;
}

/* Goal card: full width with progress bar and three separated meta values */
.dashboard-goal-full{
  display:block !important;
  width:100% !important;
  margin:18px 0 !important;
}
.dashboard-goal-full .goal-card{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
}
.dashboard-goal-full .goal-head{
  display:flex !important;
  justify-content:space-between !important;
  align-items:flex-end !important;
  gap:20px !important;
}
.dashboard-goal-full .goal-head > div:first-child{
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
}
.dashboard-goal-full .goal-progress-track{
  display:block !important;
  width:100% !important;
  height:16px !important;
  margin:18px 0 12px !important;
  overflow:hidden !important;
  border-radius:999px !important;
}
.dashboard-goal-full .goal-progress-fill{
  display:block !important;
  height:100% !important;
  border-radius:999px !important;
}
.dashboard-goal-full .goal-meta{
  display:flex !important;
  flex-direction:row !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:16px !important;
  flex-wrap:wrap !important;
}

/* History: give weight column enough room so "126.45 kg" stays on one line. */
.history-table th:nth-child(2),
.history-table td:nth-child(2){
  min-width:130px !important;
  white-space:nowrap !important;
}

@media(max-width:1000px){
  .dashboard-top-stats{
    grid-template-columns:1fr !important;
  }
}
