/* Ergänzungen zu Pico.css - App-spezifisches Styling */
/* gleiche Spezifität wie Pico (hell + dunkel), steht später -> gewinnt */
:root:not([data-theme]), :root:not([data-theme=dark]), [data-theme=light], [data-theme=dark] {
  --pico-primary: #e4572e;
  --pico-primary-background: #e4572e;
  --pico-primary-border: #e4572e;
  --pico-primary-hover: #c9461f;
  --pico-primary-hover-background: #c9461f;
  --pico-primary-focus: rgba(228, 87, 46, .35);
  --pico-primary-inverse: #fff;
  --pico-font-size: 100%;
  --accent-soft: rgba(228, 87, 46, .12);
  --ok: #2f9e44;
  --ok-soft: rgba(47, 158, 68, .14);
}
[x-cloak] { display: none !important; }
main.container {
  max-width: 640px;
  padding-top: max(.75rem, env(safe-area-inset-top));
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

/* ---------- Login ---------- */
.login { max-width: 360px; margin: 14vh auto 0; text-align: center; }
.login-icon { width: 76px; height: 76px; margin-bottom: .5rem; }
.login h1 { margin-bottom: 1.5rem; }

/* ---------- Allgemein ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.bar h1 { margin: 0; font-size: 1.6rem; }
.bar.sticky {
  position: sticky; top: 0; z-index: 5; background: var(--pico-background-color);
  padding: .5rem 0; margin: 0 0 .5rem; border-bottom: 1px solid var(--pico-muted-border-color);
}
button.small { padding: .4rem .8rem; font-size: .85rem; width: auto; margin: 0; }
button.narrow { width: auto; padding-inline: .8rem; }
button.icon { background: none; border: none; color: var(--pico-muted-color); width: auto; padding: .2rem .5rem; margin: 0; }
button.cta { width: 100%; padding: .85rem; font-size: 1.05rem; font-weight: 600; }
.error { color: var(--pico-del-color); margin-top: .75rem; }
.muted { color: var(--pico-muted-color); }
.center { text-align: center; }
.small-print { font-size: .85rem; }
article { padding: 1rem; margin-bottom: 1rem; }
details summary { font-size: .95rem; }
details { margin-bottom: .5rem; }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--pico-primary); border-radius: 999px; padding: .15rem .55rem;
}
.badge.live { background: var(--ok-soft); color: var(--ok); }

/* Chips (Mehrfachauswahl) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip {
  width: auto; margin: 0; padding: .4rem .75rem; font-size: .88rem; border-radius: 999px;
  background: transparent; color: var(--pico-color); border: 1px solid var(--pico-muted-border-color);
}
.chip.on { background: var(--pico-primary); border-color: var(--pico-primary); color: #fff; }
.chips.static .chip {
  font-size: .75rem; padding: .15rem .55rem; background: var(--pico-card-sectioning-background-color);
  border-color: transparent; color: var(--pico-muted-color);
}
fieldset legend { font-weight: 600; margin-bottom: .4rem; }

.hint { background: var(--accent-soft); border: 1px solid var(--pico-primary); }
.hint p { margin-bottom: .75rem; }
.hint button { width: 100%; margin: 0; }

/* ---------- Plan ---------- */
.empty-plan { text-align: center; padding: 2rem 1.25rem; }
.big-emoji { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.empty-plan h3 { margin-bottom: .5rem; }

.generating { text-align: center; padding: 2rem 1rem; }
.generating p { margin: .25rem 0; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 1rem; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--pico-primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.session.busy { opacity: .7; }
.session-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; font-size: .85rem; }
.session h3 { margin: 0 0 .2rem; font-size: 1.2rem; }
.focus { color: var(--pico-muted-color); margin: 0 0 .5rem; font-size: .92rem; }
.request { font-size: .85rem; font-style: italic; color: var(--pico-muted-color); margin: -.25rem 0 .5rem; }
.adapting { margin: .5rem 0; }
.coach-note {
  font-size: .9rem; background: var(--pico-card-sectioning-background-color); border-left: 3px solid var(--pico-primary);
  padding: .6rem .75rem; border-radius: 0 8px 8px 0; margin: .5rem 0 .75rem;
}
.coach-note::before { content: "💬 "; }

.exlist { list-style: none; padding: 0; margin: .25rem 0 .5rem; }
.exlist li {
  list-style: none; display: flex; align-items: center; gap: .7rem; padding: .35rem 0; cursor: pointer;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.exlist li:last-child { border-bottom: none; }
.exlist li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.exlist li strong { font-size: .95rem; font-weight: 600; }
.exlist li small { color: var(--pico-muted-color); font-size: .82rem; }
.exlist .group {
  font-size: .72rem; font-weight: 700; color: var(--pico-primary); border: 1px solid var(--pico-primary);
  border-radius: 6px; padding: 0 .35rem;
}
.thumb, .gif-sm {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; object-fit: cover; background: #fff;
}
.actions { display: flex; gap: .5rem; margin-top: .75rem; }
.actions button { margin: 0; flex: 1; }
.actions button.narrow { flex: 0 0 auto; }

/* ---------- Training ---------- */
.workout h2 { margin: .5rem 0 .2rem; font-size: 1.4rem; }
.timer { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.timer strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.timer small { color: var(--pico-muted-color); font-size: .75rem; }
.part { margin: 1.25rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pico-muted-color); }

.row-ex {
  display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--pico-muted-border-color);
}
.row-ex .grow { flex: 1; display: flex; flex-direction: column; line-height: 1.25; cursor: pointer; }
.row-ex small { color: var(--pico-muted-color); }
.row-ex.done .grow strong { text-decoration: line-through; color: var(--pico-muted-color); }
input.big-check { width: 1.6rem; height: 1.6rem; margin: 0; flex: 0 0 auto; }

.wex { padding: .85rem; }
.wex-top { display: flex; gap: .85rem; align-items: flex-start; }
.gif-lg {
  width: 132px; height: 132px; flex: 0 0 132px; border-radius: 12px; object-fit: cover; background: #fff; cursor: zoom-in;
}
.wex-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.wex-info h4 { margin: .1rem 0 0; font-size: 1.05rem; }
.wex-info .target { margin: .2rem 0 0; font-size: 1.05rem; }
.wex-info small { font-size: .82rem; }
.wex .badge { align-self: flex-start; }
.cues { margin: .6rem 0 .4rem; padding-left: 1.1rem; font-size: .88rem; }
.cues li { margin-bottom: .15rem; }

table.sets { margin: .5rem 0 .25rem; }
table.sets th, table.sets td { padding: .3rem .35rem; text-align: center; vertical-align: middle; }
table.sets th { font-size: .78rem; color: var(--pico-muted-color); font-weight: 600; }
table.sets td:first-child { width: 2.5rem; font-weight: 600; }
table.sets td:last-child { width: 3rem; }
table.sets input[type=text] { margin: 0; padding: .45rem .4rem; text-align: center; height: auto; font-size: 1rem; }
table.sets tr.done td { background: var(--ok-soft); }
.set-actions { display: flex; gap: .5rem; }

button.finish { margin-top: 1.5rem; }

.rest {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom));
  width: min(92vw, 600px); z-index: 20; overflow: hidden;
  display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem;
  background: #1f2430; color: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.rest span { flex: 1; position: relative; }
.rest strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; position: relative; }
.rest button { position: relative; }
.rest-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(228, 87, 46, .45); transition: width 1s linear; }

/* ---------- Verlauf ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.stats div {
  background: var(--pico-card-background-color); box-shadow: var(--pico-card-box-shadow);
  border-radius: var(--pico-border-radius); padding: .6rem .3rem; text-align: center;
  display: flex; flex-direction: column;
}
.stats strong { font-size: 1.4rem; color: var(--pico-primary); }
.stats small { font-size: .72rem; color: var(--pico-muted-color); line-height: 1.2; }

.weight-head { display: flex; justify-content: space-between; align-items: baseline; }
.weight-head h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.weight progress { margin: .25rem 0 .2rem; }
.chart { width: 100%; height: 90px; margin: .5rem 0; }
.chart .line { fill: none; stroke: var(--pico-primary); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .target-line { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
form.inline { display: flex; gap: .5rem; margin: .5rem 0; }
form.inline input { margin: 0; flex: 1; }
form.inline button { margin: 0; width: auto; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .9rem; }
ul.plain li span { flex: 1; }

.hist { padding: .75rem 1rem; margin-bottom: .6rem; }
.hist.skipped { opacity: .6; }
.hist-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.hist-head > div { display: flex; flex-direction: column; line-height: 1.3; }
.hist .meta { color: var(--pico-muted-color); font-size: .82rem; }
.hist .meta span:not(:last-child)::after { content: " · "; }
.hist .meta span[style*="none"] + span::before { content: ""; }
.chev { color: var(--pico-muted-color); }
.hist-body { margin-top: .5rem; }
.feedback { font-size: .9rem; font-style: italic; }

/* ---------- Profil ---------- */
.grid2, .grid3 { display: grid; gap: 0 .75rem; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } }
label { font-size: .92rem; }
.coach-settings { margin-top: 1.5rem; }
.coach-settings h3 { margin-bottom: .25rem; }

/* ---------- Tabs, Toast, Dialoge ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  background: var(--pico-background-color); border-top: 1px solid var(--pico-muted-border-color);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  flex: 1; max-width: 213px; margin: 0; padding: .45rem 0 .55rem; border: none; border-radius: 0;
  background: none; color: var(--pico-muted-color); font-size: .75rem; display: flex; flex-direction: column; align-items: center; gap: .1rem;
}
nav.tabs button span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
nav.tabs button.active { color: var(--pico-primary); font-weight: 600; }
nav.tabs button.active span { filter: none; opacity: 1; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5rem + env(safe-area-inset-bottom)); z-index: 30;
  background: #1f2430; color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-size: .92rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); white-space: nowrap;
}

dialog article { width: min(94vw, 560px); max-height: 88vh; overflow-y: auto; padding: 1.1rem; }
dialog article > header { margin-bottom: .75rem; padding-bottom: .5rem; }
dialog article > header h3 { margin: 0; }
dialog footer, dialog form footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
dialog footer button { width: auto; margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.ex-detail header { position: relative; padding-right: 2rem; }
.ex-detail .close { position: absolute; right: 0; top: 0; font-size: 1.2rem; }
.gif-xl { display: block; width: 100%; max-width: 360px; margin: 0 auto .75rem; border-radius: 14px; background: #fff; }
.steps { font-size: .88rem; padding-left: 1.2rem; }
