:root {
  --bg: #0d0f13;
  --surface: #161a21;
  --surface2: #1e232c;
  --line: #2a303b;
  --text: #eef1f5;
  --muted: #8e97a6;
  --accent: #c5f04a;
  --accent-ink: #141a05;
  --accent-soft: rgba(197, 240, 74, .12);
  --cardio: #4cc9f0;
  --rest: #a594ff;
  --warn: #ffb547;
  --danger: #ff6b6b;
  --good: #5ee08f;
  --radius: 16px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  min-height: 100vh;
}
body.auth { padding-bottom: 24px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: .4em 0 .8em; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.ico { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; flex-wrap: wrap; }
.wrap-row { flex-wrap: wrap; }
.up { color: var(--warn); }
.down { color: var(--good); }
.good { color: var(--good) !important; }
.bad { color: var(--warn) !important; }

/* ---------- Top og bund ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: rgba(13, 15, 19, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent); }
.brand span { display: none; }
.toptitle { flex: 1; font-size: 1rem; font-weight: 700; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
.topbtn:active { background: var(--surface2); }
.avatar { background: var(--surface2); font-weight: 800; border: 1px solid var(--line); }
.avatar.on { background: var(--accent); color: var(--accent-ink); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(18, 21, 27, .95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.tabbar a.on { color: var(--accent); }
.tabbar .ico { width: 24px; height: 24px; }

#offline-bar { background: var(--warn); color: #1d1300; font-size: .85rem; font-weight: 600; padding: 8px 16px; text-align: center; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }

/* ---------- Kort og knapper ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.link { color: var(--accent); font-weight: 600; font-size: .9rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn .ico { width: 20px; height: 20px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: .78rem; font-weight: 700; font-style: normal; color: var(--muted); }
.badge.warn { color: var(--warn); }
.badge.phase.p0 { color: var(--cardio); }
.badge.phase.p1 { color: var(--accent); }
.badge.phase.p2 { color: var(--warn); }
.badge.phase.p3 { color: var(--rest); }
.pill { margin-left: auto; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.pill.st-done { background: var(--accent-soft); color: var(--accent); }
.pill.st-partial { background: rgba(255, 181, 71, .12); color: var(--warn); }
.pill.st-skipped { color: var(--danger); }
.pill.k-gym { color: var(--accent); }
.pill.k-cardio { color: var(--cardio); }
.pill.k-rest { color: var(--rest); }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.flash.err { background: rgba(255, 107, 107, .12); color: var(--danger); }
.hint { display: flex; gap: 8px; color: var(--muted); font-size: .85rem; }
.hint .ico { width: 18px; height: 18px; margin-top: 1px; }
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 10px; font-size: .92rem; margin: 12px 0; }
.note-card h3 { display: flex; align-items: center; gap: 8px; }
.tip { background: var(--surface2); padding: 10px 12px; border-radius: 10px; font-size: .92rem; }

/* ---------- Formularer ---------- */
label { display: block; font-size: .88rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
label small { font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 16px; /* undgår zoom på iOS */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.stack > * { margin-bottom: 12px; }
.grid2, .grid3 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.grid2 label, .grid3 label { margin-bottom: 4px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.field { margin-bottom: 14px; }
.lbl { display: block; font-size: .88rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 6px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: .92rem; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg.small span { padding: 8px 4px; font-size: .82rem; }
.seg input[value="cardio"]:checked + span { background: var(--cardio); color: #001820; }
.seg input[value="rest"]:checked + span { background: var(--rest); color: #120a33; }

.cards { display: grid; gap: 8px; margin-bottom: 8px; }
.opt { margin: 0; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span { position: relative; display: block; padding: 14px 44px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; }
.opt b { display: block; color: var(--text); font-size: 1rem; }
.opt small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; margin-top: 2px; }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.opt input:checked + span::after { content: ""; position: absolute; right: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141a05' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat; }
.goals .opt .rank { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 800; display: none; place-items: center; font-size: .8rem; z-index: 1; }
.goals .opt input:checked + span .rank:not(:empty) { display: grid; }
.goals .opt.disabled > span { opacity: .45; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-btn {
  display: inline-block; padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.neg input:checked + span { background: rgba(255, 107, 107, .15); border-color: var(--danger); color: var(--danger); text-decoration: line-through; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.presets .chip-btn { border-style: dashed; }
.presets .chip-btn.on { border-style: solid; }
.sub { margin: 10px 0 6px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

details > summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; padding: 6px 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
details.more { margin-top: 8px; }

/* Skjulte inputs i chips/kort må ikke skabe vandret scroll */
.seg label, .opt, .chip { position: relative; }
.seg input, .opt input, .chip input { width: 1px; height: 1px; left: 0; top: 0; }

/* Udstyrskort med billede og info-ark */
.eqgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.eqcard { position: relative; }
.eqcard label { margin: 0; position: relative; }
.eqcard input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; pointer-events: none; }
.eq-body { display: block; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; cursor: pointer; height: 100%; }
.eq-body img { display: block; width: 100%; height: 78px; object-fit: cover; opacity: .55; filter: grayscale(.6); transition: opacity .15s; }
.eq-body b { display: block; padding: 8px 10px 10px; color: var(--text); font-size: .85rem; line-height: 1.25; }
.eqcard input:checked + .eq-body { border-color: var(--accent); background: var(--accent-soft); }
.eqcard input:checked + .eq-body img { opacity: 1; filter: none; }
.eqcard input:checked + .eq-body::after { content: ""; position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141a05' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat; }
.eq-info { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(13, 15, 19, .85); color: var(--text); font: 700 .9rem/1 Georgia, serif; font-style: italic; cursor: pointer; }
.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box { position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-x { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 1.8rem; cursor: pointer; }
.sheet h2 { padding-right: 40px; }

/* ---------- Guide ---------- */
.steps { display: flex; gap: 4px; overflow-x: auto; margin: -4px -16px 14px; padding: 4px 16px; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.stepdot { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 11px 7px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.stepdot span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); font-size: .72rem; }
.stepdot.on { color: var(--text); border-color: var(--accent); }
.stepdot.on span, .stepdot.ok span { background: var(--accent); color: var(--accent-ink); }
.js .wizard .step { display: none; }
.js .wizard .step.on { display: block; }
.wiz-nav { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); display: flex; gap: 10px; z-index: 5; padding-top: 6px; }
.wiz-nav .btn { flex: 1; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.wiz-nav .btn.ghost { background: var(--surface2); }
.js .wizard[data-new="1"] #wiz-save { display: none; }
.js .wizard[data-new="1"].last #wiz-save { display: inline-flex; }
.js .wizard.last #wiz-next { display: none; }
.js .wizard.first #wiz-prev { visibility: hidden; }
.week-edit .wrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wday { width: 74px; font-weight: 700; font-size: .9rem; }
.week-edit .seg { flex: 1; }
.week-sum { font-weight: 600; }

/* ---------- I dag ---------- */
.hello { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.hello h2 { margin: 0; }
.today-card { border-color: var(--accent); background: linear-gradient(160deg, rgba(197, 240, 74, .13), var(--surface) 55%); }
.today-card.kind-cardio { border-color: var(--cardio); background: linear-gradient(160deg, rgba(76, 201, 240, .14), var(--surface) 55%); }
.today-card.kind-cardio .btn.primary { background: var(--cardio); border-color: var(--cardio); color: #001820; }
.today-card.kind-rest { border-color: var(--rest); background: linear-gradient(160deg, rgba(165, 148, 255, .13), var(--surface) 55%); }
.tc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tc-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface2); color: var(--accent); }
.kind-cardio .tc-ico { color: var(--cardio); }
.kind-rest .tc-ico { color: var(--rest); }
.tc-txt { flex: 1; min-width: 0; }
.tc-txt small { color: var(--muted); display: block; }
.tc-txt b { font-size: 1.15rem; display: block; }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface2) 0); }
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .78rem; font-weight: 800; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.wd small { font-size: .7rem; color: var(--muted); font-weight: 700; }
.wd-ico { color: var(--muted); }
.wd-ico .ico { width: 18px; height: 18px; }
.wd.k-gym .wd-ico { color: var(--accent); }
.wd.k-cardio .wd-ico { color: var(--cardio); }
.wd.k-rest .wd-ico { color: var(--rest); opacity: .6; }
.wd.today { border-color: var(--text); }
.wd.st-done { background: var(--accent-soft); border-color: var(--accent); }
.wd.st-done .wd-ico { color: var(--accent); }
.wd.st-partial { border-color: var(--warn); }
.wd.past.st-planned.k-gym, .wd.past.st-planned.k-cardio { opacity: .5; }
.kcal-line { display: flex; align-items: center; gap: 6px; }
.kcal-line .ico { color: var(--warn); }
.meal-mini { list-style: none; margin: 0; padding: 0; }
.meal-mini li { padding: 8px 0; border-top: 1px solid var(--line); }
.meal-mini small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats2 small, .stat small { display: block; color: var(--muted); font-weight: 600; }
.stats2 b { display: block; font-size: 1.4rem; }

/* ---------- Program ---------- */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wn-mid { text-align: center; }
.wn-mid b { display: block; font-size: 1.1rem; }
.wn-mid small { color: var(--muted); }
.weeknav a.topbtn { background: var(--surface); border: 1px solid var(--line); }
.phasebar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.phasebar i { font-style: normal; font-size: .68rem; font-weight: 700; text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--surface2); color: var(--muted); }
.phasebar i.past { opacity: .6; }
.phasebar i.on { background: var(--accent); color: var(--accent-ink); }
.daycard { padding: 14px; }
.daycard.today { border-color: var(--text); }
.dc-h { display: flex; align-items: center; gap: 12px; }
.dc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); color: var(--accent); flex: none; }
.daycard.k-cardio .dc-ico { color: var(--cardio); }
.daycard.k-rest .dc-ico { color: var(--rest); }
.daycard.k-rest { opacity: .75; }
.dc-t { min-width: 0; }
.dc-t small { color: var(--muted); display: block; }
.dc-t b { display: block; }
.dc-list { margin: 8px 0 0 52px; font-size: .85rem; color: var(--muted); }

/* ---------- Træning ---------- */
.wo-head { margin-bottom: 14px; }
.wo-head h2 { margin-bottom: 8px; }
.progress { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.why summary { color: var(--text); display: flex; align-items: center; gap: 8px; }
.why summary::before { content: none; }
.why summary .ico { color: var(--accent); }
.why .advice { background: rgba(255, 181, 71, .1); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.sec-h { margin: 18px 2px 10px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.ex { padding: 14px; }
.ex.paired { border-left: 3px solid var(--accent); }
.ex.circuit { border-left: 3px solid var(--cardio); }
.ex-h { display: flex; gap: 12px; align-items: center; }
.ex-img { position: relative; width: 76px; height: 58px; flex: none; border-radius: 12px; overflow: hidden; background: var(--surface2); border: 0; padding: 0; cursor: zoom-in; display: grid; place-items: center; color: var(--muted); }
.ex-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-img img.alt { animation: flip 2.4s infinite steps(1); }
@keyframes flip { 0% { opacity: 0; } 50% { opacity: 1; } }
.ex-t { min-width: 0; }
.ex-t b { display: block; font-size: 1.02rem; }
.ex-t small { color: var(--muted); }
.grp { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); margin-bottom: 3px; }
.circuit .grp { background: var(--cardio); color: #001820; }
.ex-target { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 4px; font-size: .95rem; }
.ex-target .ico { width: 17px; height: 17px; }
.ex-note { font-size: .88rem; margin: 4px 0; }
.last { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.last .ico { width: 15px; height: 15px; }
.sets { display: grid; gap: 8px; margin: 12px 0 6px; }
.set { display: flex; align-items: center; gap: 10px; }
.tick { position: relative; width: 50px; height: 50px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.tick .ico { display: none; width: 24px; height: 24px; stroke-width: 3; }
.set.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.set.done .tick span { display: none; }
.set.done .tick .ico { display: block; }
.set-lbl { font-size: .9rem; }
.in { position: relative; flex: 1; margin: 0; min-width: 0; }
.in input { margin: 0; padding: 12px 40px 12px 12px; text-align: right; font-weight: 700; }
.in span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; font-weight: 600; pointer-events: none; }
.set.done .in input { border-color: rgba(197, 240, 74, .4); }
.how { margin-top: 6px; }
.how p { font-size: .93rem; }
.how-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.how-imgs img { width: 100%; border-radius: 10px; display: block; }
.how-imgs.big { margin: 12px 0; }
.swap { margin-top: 6px; }
.zoom { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .9); display: grid; place-content: center; gap: 8px; padding: 16px; }
.zoom img { max-width: 100%; max-height: 42vh; border-radius: 12px; }

.timer { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 50; max-width: 616px; margin: 0 auto; background: var(--surface2); border: 1px solid var(--accent); border-radius: 18px; padding: 12px 16px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); text-align: center; }
.timer-label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.timer-time { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 8px 0 10px; }
.timer-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 1s linear; }
.timer-btns { display: flex; gap: 8px; }
.timer-btns button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.timer-x { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.timer.go { border-color: var(--good); }
.timer.go .timer-time { color: var(--good); }

/* ---------- Mad ---------- */
.targets .tg-main { display: flex; align-items: center; gap: 10px; }
.targets .tg-main .ico { width: 32px; height: 32px; color: var(--warn); }
.targets .tg-main b { font-size: 1.6rem; display: block; line-height: 1.1; }
.targets .tg-main small { color: var(--muted); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.macros div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.macros b { display: block; font-size: 1.1rem; }
.macros small { color: var(--muted); }
.daytabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 12px; position: sticky; top: 62px; z-index: 10; background: var(--bg); padding: 6px 0; }
.dtab { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 7px 0; font: inherit; cursor: pointer; }
.dtab small { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; }
.dtab b { font-size: 1rem; }
.dtab.today { border-color: var(--text); }
.dtab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dtab.on small { color: var(--accent-ink); }
.day-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .88rem; margin-bottom: 10px; }
.day-sum .pill { margin-left: 0; }
.meal-h small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.meal-h b { display: block; font-size: 1.05rem; margin: 2px 0; }
.ing { list-style: none; padding: 0; margin: 6px 0 10px; }
.ing li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.ing b { white-space: nowrap; }
.meal .btn { margin-top: 6px; }

/* ---------- Krop og historik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stat b { font-size: 1.25rem; }
.stat b span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat em { display: block; font-style: normal; font-size: .8rem; font-weight: 700; }
.chart { width: 100%; min-height: 180px; margin: 8px 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#cg); opacity: .5; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .bar { fill: var(--accent); }
.chart .bar.zero { fill: var(--surface2); }
.chart .val { fill: var(--text); font-weight: 700; }
.chart-pick { margin-bottom: 4px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.del-form { margin: 0; }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-top: 1px solid var(--line); }
.linklist li:first-child { border-top: 0; }
.linklist a, .li-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.linklist a > span:first-child, .li-row > span:first-child { flex: 1; min-width: 0; }
.linklist small { display: block; color: var(--muted); }
.linklist .ico { color: var(--muted); width: 18px; height: 18px; }
.li-ico { flex: none !important; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface2); }
.li-ico.k-gym .ico { color: var(--accent); }
.li-ico.k-cardio .ico { color: var(--cardio); }
.li-row form { margin: 0; }
.hl { border-color: var(--accent); }
.copy-src { margin: 8px 0 12px; font-size: .85rem; }

/* ---------- Log ind ---------- */
.auth .topbar { display: none; }
.auth-box { max-width: 400px; margin: 8vh auto 0; }
.auth-logo { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 18px; }
.auth-logo .ico { width: 36px; height: 36px; }
.auth-box h2 { font-size: 1.6rem; }

@media (min-width: 420px) { .brand span { display: inline; } }
@media (max-width: 360px) { .grid3 { grid-template-columns: 1fr 1fr; } .wday { width: 60px; font-size: .8rem; } }
