:root {
  color-scheme: light;
  --ink: #181816;
  --muted: #69645c;
  --line: #ded8cc;
  --paper: #fbfaf7;
  --wash: #f0ede5;
  --coal: #20201d;
  --tomato: #d95f43;
  --moss: #6aa18a;
  --steel: #55718b;
  --gold: #c6923e;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(24, 24, 22, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

/* ── Shell layout ── */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

/* ── Sidebar ── */

.sidebar {
  background: var(--coal);
  color: var(--paper);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(251, 250, 247, 0.1);
  margin-bottom: 4px;
}

.brand-mark {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  /* filter: invert(1) brightness(2); */
}
.sidebar .brand-mark {
  filter: invert(1) brightness(2);
}

/* ── Nav items ── */

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(251, 250, 247, 0.66);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(251, 250, 247, 0.12);
  color: var(--paper);
}

.nav-item.active {
  background: rgba(251, 250, 247, 0.16);
  color: var(--paper);
  font-weight: 700;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-label {
  flex: 1;
}

/* ── Sidebar footer ── */

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(251, 250, 247, 0.1);
  display: grid;
  gap: 10px;
}

.footer-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: rgba(251, 250, 247, 0.7);
  padding: 0 4px;
}

.footer-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
  flex-shrink: 0;
}

/* ── Main content ── */

.main {
  padding: 28px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* ── Typography ── */

.eyebrow {
  margin: 0 0 4px;
  color: var(--tomato);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
  max-width: 880px;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.3rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

/* ── Hero ── */

.hero {
  min-height: 260px;
  max-height: 300px;
  background:
    linear-gradient(160deg, rgba(20, 20, 20, 0.72) 0%, rgba(20, 20, 20, 0.52) 50%, rgba(20, 20, 20, 0.84) 100%),
    url("icons/btttr_icons/wide.jpg");
  background-size: cover;
  background-position: center;
  color: var(--paper);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
}

.hero p {
  max-width: 640px;
  color: rgba(251, 250, 247, 0.78);
  font-size: 1.05rem;
  margin: 18px 0 0;
}

/* ── Grid ── */

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── Panels & Cards ── */

.panel,
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(24, 24, 22, 0.04);
}

.panel {
  padding: 20px;
}

.card {
  padding: 16px;
}

/* ── Stats ── */

.stat {
  display: grid;
  gap: 6px;
}

.stat strong {
  font-size: 2rem;
}

/* ── Actions / Buttons ── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--coal);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn.secondary {
  background: var(--wash);
  color: var(--ink);
}

.btn.warn {
  background: var(--tomato);
  color: var(--white);
}

.btn.icon {
  width: 40px;
  padding: 0;
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

/* ── Forms ── */

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--paper);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--coal);
  outline-offset: -1px;
  border-color: transparent;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

/* ── List / Row ── */

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: left;
}

.row-active {
  border-color: var(--coal);
  box-shadow: inset 0 0 0 1px var(--coal);
}

.row-end {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.row-main {
  min-width: 0;
}

.row-main strong {
  display: block;
}

/* ── Pills ── */

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 0.5rem;
}

.pill.green {
  background: rgba(106, 161, 138, 0.22);
  color: #305f4a;
}

.pill.orange {
  background: rgba(217, 95, 67, 0.18);
  color: #913b28;
}

/* Category pills */
.cat-crossfit {
  background: rgba(217, 95, 67, 0.15);
  color: #8a321e;
}

.cat-hyrox {
  background: rgba(85, 113, 139, 0.18);
  color: #2e4d66;
}

.cat-strength {
  background: rgba(32, 32, 29, 0.1);
  color: #20201d;
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tabs button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.tabs button.active {
  background: var(--coal);
  color: var(--paper);
}

/* ── Set row (client view) ── */

.workout-table {
  display: grid;
  gap: 6px;
}

/* ── Block Display (Klienten-Ansicht) ── */

.blocks-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.block-display {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.block-display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.block-display-name {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  flex: 1;
}

.block-display-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.block-display-meta {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.block-movements {
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mov-item {
  font-size: 0.88rem;
  padding: 2px 0;
  color: var(--text);
}

.mov-pause-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  margin: 2px 0;
  background: var(--wash);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mov-pause-bar svg {
  opacity: 0.5;
  flex-shrink: 0;
}

/* ── Block Form (Admin-Editor) ── */

.block-form {
  background: var(--wash);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-form-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.block-form-top .ex-name {
  flex: 1;
}

.block-form-top .ex-type-select {
  width: 120px;
  flex-shrink: 0;
}

.block-form-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
  margin-right: 46px;
  padding-top: 6px;
  padding-bottom: 12px;
}

.block-form-meta .ex-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  flex: 0 0 auto;
  width: 33%;
  max-width: 29.25%;
}

.block-form-meta .ex-field::before {
  content: attr(data-label);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.block-form-meta .ex-field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 0;
  min-height: 32px;
  outline: none;
  font-size: 0.88rem;
  min-width: 40px;
}

.movements-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 16px;
}

.movement-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.movement-row input {
  flex: 1;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.88rem;
}
.movement-row .mov-reps-input,
.movement-row .mov-load-input {
  flex: 0 0 80px;
  text-align: center;
}

.movement-row.is-pause {
  background: var(--wash);
  border-radius: 6px;
  padding: 2px 6px 2px 4px;
}

.pause-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pause-input {
  color: var(--muted) !important;
  font-style: italic;
}

.movement-actions {
  display: flex;
  gap: 6px;
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  color: var(--muted);
  cursor: grab;
  opacity: 0.5;
}
.drag-handle:active { cursor: grabbing; }

.movement-row.dragging,
.block-form.dragging {
  opacity: 0.35;
}

.movement-row.drag-over,
.block-form.drag-over {
  outline: 2px dashed var(--accent, #5a8a6a);
  outline-offset: 2px;
}

.sort-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.sort-btns .btn {
  padding: 2px 5px;
  min-height: 18px;
  line-height: 1;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.78rem;
  min-height: 28px;
}

.pill.muted-pill {
  background: var(--wash);
  color: var(--muted);
  border: 1px solid var(--line);
  align-self: flex-start;
}

/* ── Workout-Typ Pill & Selector ── */

.wtype-pill {
  display: inline-block;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--steel);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wtype-amrap     { background: #c0392b; }
.wtype-fortime   { background: #e67e22; }
.wtype-emom      { background: #8e44ad; }
.wtype-tabata    { background: #d35400; }
.wtype-interval  { background: #16a085; }
.wtype-endurance { background: #27ae60; }
.wtype-kraft     { background: #2980b9; }
.wtype-warmup    { background: #7f8c8d; }
.wtype-recovery  { background: #95a5a6; }

/* ── Workout note (comment style) ─────────────────────────────────────────── */
.workout-note-saved {
  margin-top: 16px;
  background: var(--surface, #f5f5f5);
  border: 1px solid var(--accent, #2980b9);
  border-radius: 4px;
  padding: 12px 12px 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.workout-note-saved p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  flex: 1;
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--ink);
}

.btn-link-small {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted, #888);
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
  position: relative;
  top: 2px;
}
.btn-link-small:hover { color: var(--danger, #c0392b); }

.wtype-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.wtype-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wtype-btn:hover {
  border-color: var(--steel);
  color: var(--steel);
}

.wtype-btn.active {
  background: var(--steel);
  border-color: var(--steel);
  color: #fff;
}

.wtype-btn.clear {
  border-color: transparent;
  color: var(--muted);
  font-size: 0.72rem;
}

/* ── Workout cards (admin editor) ── */

.workout-list {
  display: grid;
  gap: 16px;
}

/* ── Plan-Kalender ─────────────────────────────────────────────────────────── */
/* ── Plan workout list ────────────────────────────────────────────────────── */
.plan-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.plan-week-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-week-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.plan-week-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.plan-week-range {
  font-size: 0.82rem;
  color: var(--muted);
}

.plan-week-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-list-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.plan-list-row:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.plan-list-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.plan-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.plan-list-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.workout-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.workout-card-header {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.workout-card-meta {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
}

/* ── Exercise block ── */

.exercise-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}

.exercise-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.block-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.exercise-col-labels {
  display: grid;
  grid-template-columns: 1fr 72px 100px 100px 90px 40px;
  gap: 6px;
  padding: 0 0 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.exercise-rows {
  display: grid;
  gap: 6px;
}

.ex-row {
  display: grid;
  grid-template-columns: 1fr 72px 100px 100px 90px 40px;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  background: var(--wash);
  border-radius: 8px;
}

.ex-field {
  display: contents;
}

.ex-type-select {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.ex-row input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.88rem;
  background: var(--white);
}

.ex-name {
  font-weight: 600;
}

/* ── Progress ── */

.progress {
  height: 8px;
  background: var(--wash);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--moss), var(--steel));
}

/* ── Chart ── */

.chart {
  height: 160px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 20px;
}

.bar {
  min-height: 12px;
  border-radius: 8px 8px 0 0;
  background: var(--steel);
  position: relative;
}

.bar:nth-child(2n) {
  background: var(--moss);
}

.bar:nth-child(3n) {
  background: var(--gold);
}

.bar span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.74rem;
  color: var(--muted);
}

/* ── Calendar ── */

.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day {
  min-height: 100px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow: hidden;
}

.calendar-day:hover,
.calendar-day.active {
  border-color: var(--coal);
  box-shadow: inset 0 0 0 1px var(--coal);
}

.calendar-day.muted-day {
  opacity: 0.42;
}

.calendar-day span {
  font-weight: 900;
  font-size: 0.88rem;
}

/* Cal chips — category-colored */
.cal-chip {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 0.72rem;
  border-radius: 4px;
  padding: 3px 5px;
  font-weight: 600;
}

.cal-chip.cat-crossfit {
  background: rgba(217, 95, 67, 0.16);
  color: #8a321e;
}

.cal-chip.cat-hyrox {
  background: rgba(85, 113, 139, 0.18);
  color: #2e4d66;
}

.cal-chip.cat-strength {
  background: rgba(32, 32, 29, 0.1);
  color: #20201d;
}

.calendar-day small {
  display: block;
  background: rgba(106, 161, 138, 0.22);
  color: #305f4a;
  font-weight: 700;
  font-size: 0.68rem;
  border-radius: 4px;
  padding: 2px 5px;
}

/* ── Login ── */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-art {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.login-art-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.login-art-icon img {
  width: 55%;
  opacity: 0.07;
  filter: invert(1);
}

.login-copy {
  max-width: 620px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-panel {
  padding: 44px;
  display: grid;
  align-content: center;
  gap: 22px;
}

/* ── Auth flow ── */

.auth-step {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

.auth-heading {
  margin: 0;
  font-size: 1.3rem;
}

.auth-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--tomato);
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--ink);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.auth-confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-confirm h2 {
  margin: 0;
}

.auth-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  background: rgba(106, 161, 138, 0.14);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--moss);
}

.demo-notice {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-notice strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.demo-notice p {
  font-size: 0.85rem;
  margin: 0;
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(20, 20, 18, 0.22);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.modal-wide {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--wash);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
}

.modal-close:hover {
  background: var(--line);
  color: var(--ink);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Plan-Checkbox-Liste (Admin) ── */

.plan-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.plan-check-item:has(input:checked) {
  border-color: var(--coal);
  background: var(--wash);
}

.plan-check-item input[type="checkbox"] {
  accent-color: var(--coal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Plan tabs (multiple plans) ── */

.plan-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.plan-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--wash);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
}

.plan-tab.active {
  background: var(--coal);
  color: var(--paper);
  border-color: var(--coal);
}

.plan-tabs-multi .plan-tab:not(.active) {
  opacity: 0.4;
}

.plan-tabs-multi .plan-tab:not(.active):hover {
  opacity: 0.75;
}

/* ── Loading screen ── */

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--tomato);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Misc ── */

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 32px;
  background: #2d7a4f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 1000;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Mobile header + bottom nav (hidden on desktop) ── */

.mobile-header {
  display: none;
}

.bottom-nav {
  display: none;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  /* Desktop sidebar hidden */
  .sidebar {
    display: none;
  }

  .login {
    grid-template-columns: 1fr;
  }

  /* Shell becomes a 3-row layout: header / content / (fixed bottom nav) */
  .shell {
    grid-template-columns: 1fr;
  }

  /* Mobile top header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    background: var(--coal);
    color: var(--paper);
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .mobile-header .brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0;
    font-size: 0.9rem;
    gap: 8px;
  }

  .mobile-header .brand-mark {
    height: 22px;
    width: auto;
    filter: invert(1) brightness(2);
  }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .mobile-role {
    font-size: 0.78rem;
    color: rgba(251, 250, 247, 0.6);
    white-space: nowrap;
  }

  /* Bottom tab bar */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--coal);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 200;
  }

  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px;
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(251, 250, 247, 0.5);
    background: transparent;
  }

  .bottom-nav .nav-item.active {
    color: var(--paper);
    background: rgba(251, 250, 247, 0.12);
  }

  .bottom-nav .nav-item .nav-icon {
    width: auto;
  }

  .main {
    padding: 20px;
    padding-bottom: calc(68px + 20px);
  }

  .grid.two,
  .grid.three,
  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .hero,
  .login-art,
  .login-panel {
    padding: 24px;
  }

  .calendar-day {
    min-height: 88px;
  }

  .workout-card-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .workout-card-meta .field {
    width: 100% !important;
  }
}

@media (max-width: 560px) {
  .topbar,
  .row {
    align-items: center;
  }

  h1 {
    font-size: 2rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    min-height: 70px;
    padding: 5px;
  }

  .cal-chip {
    font-size: 0.64rem;
    padding: 2px 4px;
  }

  .set-row {
    grid-template-columns: 1fr;
  }

  .exercise-col-labels {
    display: none;
  }

  .ex-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px;
  }

  .ex-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px;
  }

  .ex-field::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    width: 48px;
    flex-shrink: 0;
  }

  .ex-field input,
  .ex-field select {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    min-height: 36px;
    outline: none;
    font-size: 0.88rem;
  }
}

.save-all-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.save-all-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.save-all-bar .btn {
  min-width: 200px;
}

.toast-success {
  background: #2d7a4f;
  color: #fff;
}

.push-hint {
  background: var(--wash);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.workout-plan-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent, #5a8a6a);
  background: color-mix(in srgb, var(--accent, #5a8a6a) 12%, transparent);
  border-radius: 4px;
  padding: 2px 7px;
  margin-top: 4px;
  margin-bottom: 10px;
}

.coach-note {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}
