/* GYM im bySALTY-Stil (siehe DESIGN.md). Nur dunkel. Archivo: SIL OFL 1.1, lokal gehostet. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #0a0a0c; --bg-2: #101014; --surface: #17171d; --footer-bg: #070709; --line: rgba(255, 255, 255, .09);
  --text: #f4f4f6; --muted: #a6a6b2; --placeholder: #8e8e9a;
  --orange: #ff5517; --amber: #ff8a1f; --glow: rgba(255, 85, 23, .45);
  --grad: linear-gradient(100deg, #ff5517 0%, #ff8a1f 55%, #ffb347 100%);
  --ok: #3ddc84; --bad: #ff4d4f;
  --radius: 18px; --tap: 48px;
  --gutter: 16px; --max: 720px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; font-weight: 900; }
h1 { font-size: 1.9rem; text-transform: uppercase; }
h2 { font-size: 1.4rem; text-transform: uppercase; }
h3 { font-size: 1.15rem; text-transform: uppercase; }
::selection { background: var(--orange); color: #0a0a0c; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--orange); color: #0a0a0c; padding: 10px 16px; border-radius: 8px; z-index: 500; font-weight: 800; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }

/* Shell */
.header { position: sticky; top: 0; z-index: 100; background: rgba(10, 10, 12, .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 var(--gutter); max-width: var(--max); margin: 0 auto; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: 1.05rem; min-height: 44px; }
.brand img { width: 32px; height: auto; }
.syncchip { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .85rem; cursor: pointer; }
.syncdot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.syncchip.is-pending .syncdot { background: var(--amber); }
.syncchip.is-off .syncdot { background: var(--muted); }
.syncchip.is-bad .syncdot { background: var(--bad); }
.syncchip.is-busy .syncdot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.main { max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.page { display: grid; gap: 16px; }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 100; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(7, 7, 9, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h); color: var(--muted); font-size: .72rem; font-weight: 800; position: relative; }
.tab.is-on { color: var(--text); }
.tab.is-on::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 3px; background: var(--grad); border-radius: 0 0 3px 3px; }
.tab.is-on svg { color: var(--orange); }
body.is-auth .header, body.is-auth .tabbar { display: none; }
body.is-auth .main { padding-bottom: 24px; }
.foot { text-align: center; font-size: .88rem; color: var(--muted); padding: 12px 0 8px; }
.foot a { display: inline-block; padding: 12px 6px; text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--amber); }

/* Ansichten */
.view { display: grid; gap: 14px; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--grad); border-radius: 3px; }
.big-timer { font-size: 2rem; font-weight: 900; letter-spacing: -.02em; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-gap.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 4px; }
.col--end { align-items: flex-end; }

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); padding: 12px 24px; border-radius: 999px; font-weight: 800; cursor: pointer; border: 2px solid transparent; transition: transform .2s var(--ease), box-shadow .3s, background .3s, border-color .3s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--grad); color: #0a0a0c; box-shadow: 0 10px 34px -10px var(--glow); }
.btn--ghost { border-color: var(--line); background: rgba(255, 255, 255, .03); color: var(--text); }
.btn--ghost:hover { border-color: var(--orange); background: rgba(255, 85, 23, .1); }
.btn--danger { border-color: var(--bad); color: var(--bad); background: rgba(255, 77, 79, .08); }
.btn--sm { min-height: 44px; padding: 8px 18px; font-size: .92rem; }
.btn--block { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 1.4rem; font-weight: 800; }
.iconbtn:disabled { opacity: .3; }
.spinner { display: none; width: 1.1em; height: 1.1em; border-radius: 50%; border: 3px solid rgba(10, 10, 12, .25); border-top-color: #0a0a0c; animation: spin .75s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Formulare */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__l { font-weight: 800; font-size: .92rem; }
.input, input, select, textarea { width: 100%; min-height: var(--tap); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-size: 1rem; }
textarea { resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 85, 23, .2); }
::placeholder { color: var(--placeholder); }
input[type="checkbox"] { width: 24px; min-height: 24px; height: 24px; accent-color: var(--orange); flex: none; }
input[type="file"].sr { display: none; }
.checkrow { display: flex; gap: 12px; align-items: center; min-height: 44px; }
.alert { padding: 12px 14px; border-radius: 12px; background: rgba(255, 77, 79, .12); border: 1px solid rgba(255, 77, 79, .4); color: #ffb3b4; font-size: .94rem; }
.alert--ok { background: rgba(61, 220, 132, .1); border-color: rgba(61, 220, 132, .4); color: #b6f5d2; }
.alert--info { background: rgba(255, 138, 31, .1); border-color: rgba(255, 138, 31, .45); color: #ffd2a8; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Karten */
.card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; }
.card__top { display: flex; align-items: center; gap: 10px; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .3s; text-align: left; width: 100%; cursor: pointer; }
.row-card:hover, .row-card:focus-visible { border-color: rgba(255, 85, 23, .55); }
.row-card h3 { margin-bottom: 2px; }
.row-card--btn { font: inherit; color: inherit; }
.row-card.is-today { border-color: rgba(255, 85, 23, .5); background: radial-gradient(500px circle at 100% 0%, rgba(255, 85, 23, .18), transparent 60%), var(--surface); }
.row-card--machine.is-active { border-color: var(--orange); }
.row-card--machine.is-done { opacity: .8; }
.playbtn { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #0a0a0c; box-shadow: 0 10px 34px -10px var(--glow); flex: none; }
.banner { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--orange); background: rgba(255, 85, 23, .1); min-height: 56px; }
.banner .muted { margin-left: auto; }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(255, 59, 48, .7); animation: ring 1.8s infinite; flex: none; }
@keyframes ring { 70% { box-shadow: 0 0 0 12px rgba(255, 59, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); } }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; gap: 16px; justify-items: center; }
.pill { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .78rem; font-weight: 800; white-space: nowrap; color: var(--muted); }
.pill--ok { color: var(--ok); border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .08); }
.pill--live { color: var(--orange); border-color: rgba(255, 85, 23, .55); background: rgba(255, 85, 23, .1); }
.pill--warn { color: var(--amber); border-color: rgba(255, 138, 31, .5); background: rgba(255, 138, 31, .1); }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg-2); border: 1px solid var(--line); }
.thumb--lg { width: 96px; height: 96px; border-radius: 16px; }
.machine-head { display: flex; gap: 14px; align-items: center; }
.last { font-weight: 700; color: var(--amber); }

/* Suche, Kacheln */
.search { border-radius: 999px; padding-left: 18px; }
.group-title { margin: 18px 0 10px; color: var(--amber); font-size: .85rem; letter-spacing: .14em; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { position: relative; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); cursor: pointer; aspect-ratio: 1; display: block; width: 100%; }
.tile.is-on { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(61, 220, 132, .4); }
.tile__img { width: 100%; height: 100%; object-fit: cover; }
.tile__cap { position: absolute; inset: auto 0 0 0; padding: 28px 10px 10px; font-weight: 800; font-size: .86rem; line-height: 1.2; text-align: left; background: linear-gradient(transparent, rgba(10, 10, 12, .94)); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* Dialoge */
.dlg { width: min(100% - 24px, 460px); max-height: calc(100dvh - 24px); padding: 0; border-radius: 24px; border: 1px solid rgba(255, 85, 23, .35); background: linear-gradient(160deg, #1b1210, #0f0f13 70%); color: var(--text); box-shadow: 0 40px 90px -30px #000; overflow: auto; overscroll-behavior: contain; }
.dlg--wide { width: min(100% - 16px, 640px); }
.dlg::backdrop { background: rgba(5, 5, 7, .72); backdrop-filter: blur(4px); }
.dlg__body { display: grid; gap: 14px; padding: 22px; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dlg__actions.sticky { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, #0f0f13 40%); }
.dlg__actions.sticky .btn { width: 100%; }
.detail__img { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.detail__photo { width: 100%; max-height: 320px; object-fit: cover; }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 600; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(255, 85, 23, .5); box-shadow: 0 16px 40px -12px #000; font-weight: 700; }
.toast--bad { border-color: var(--bad); }

/* Plan-Editor */
.sortlist { display: grid; gap: 12px; }
.sortable { position: relative; transform: translateY(var(--dy, 0px)); touch-action: pan-y; }
.sortable.is-dragging { z-index: 5; box-shadow: 0 20px 50px -10px #000; border-color: var(--orange); transition: none; }
.grip { display: grid; place-items: center; width: 40px; min-height: 48px; color: var(--muted); touch-action: none; cursor: grab; flex: none; }
.setchips { display: grid; gap: 8px; }
.setchip { display: flex; align-items: center; gap: 8px; }
.setchip__n { width: 22px; text-align: center; font-weight: 800; color: var(--amber); }
.input--num { max-width: 96px; text-align: center; }
.input--reps { max-width: 84px; text-align: center; }

/* Training */
.rest { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--amber); background: rgba(255, 138, 31, .08); }
.rest .big-timer { margin-right: auto; }
.sets { display: grid; gap: 12px; padding-bottom: 96px; }
.setrow { position: relative; display: grid; grid-template-columns: 28px 1fr 56px; align-items: center; gap: 8px 10px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.setrow.is-done { border-color: rgba(61, 220, 132, .5); background: rgba(61, 220, 132, .06); }
.setrow__n { font-weight: 900; color: var(--amber); text-align: center; }
.setrow__meta { grid-column: 2 / 4; display: flex; align-items: center; gap: 12px; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; align-items: center; }
.input--big { text-align: center; font-size: 1.4rem; font-weight: 800; padding: 8px 4px; }
.setrow .input--reps { width: 110px; max-width: none; padding: 10px 6px; }
.check { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; color: var(--muted); }
.check.is-on { background: var(--ok); border-color: var(--ok); color: #0a0a0c; }
.actionbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 90; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 10px var(--gutter); max-width: var(--max); margin: 0 auto; background: linear-gradient(transparent, var(--bg) 35%); }
.list { display: grid; gap: 10px; }

/* Auswertung */
.chartbox { position: relative; height: 240px; }
.chartbox--tall { height: 360px; }

/* Auth */
.authwrap { min-height: 100dvh; display: grid; align-content: center; gap: 8px; max-width: 460px; margin: 0 auto; padding: 24px 0; background: radial-gradient(600px circle at 90% 0%, rgba(255, 85, 23, .22), transparent 60%); }
.authcard { display: grid; gap: 14px; padding: 28px 22px; border-radius: 28px; border: 1px solid rgba(255, 85, 23, .3); background: radial-gradient(700px circle at 90% 0%, rgba(255, 85, 23, .2), transparent 60%), linear-gradient(160deg, #1b1210, #0f0f13 70%); box-shadow: 0 40px 90px -40px rgba(255, 85, 23, .45); }
.authlogo { width: 56px; height: auto; }
.authcard a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.authcard a.btn { text-decoration: none; color: var(--text); }
.authcard .btn--primary { color: #0a0a0c; }

/* Onboarding */
.onb { position: fixed; inset: 0; z-index: 400; display: grid; grid-template-rows: auto 1fr auto auto; background: var(--bg); padding: env(safe-area-inset-top, 0) var(--gutter) calc(var(--safe-b) + 12px); max-width: none; }
.onb > * { max-width: 560px; width: 100%; margin-inline: auto; }
.onb__top { display: flex; justify-content: flex-end; padding-top: 12px; }
.onb__skip { border-color: var(--amber); color: var(--amber); }
.onb__stage { overflow: auto; display: grid; align-content: center; }
.onb__slide { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 8px 0; }
.onb__slide h2 { font-size: 1.6rem; }
.onb__img { width: min(100%, 320px); height: auto; border-radius: 24px; }
.onb__points, .onb__steps { text-align: left; margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; color: var(--muted); }
.onb__slide.from-right { animation: slide-r .35s var(--ease); }
.onb__slide.from-left { animation: slide-l .35s var(--ease); }
@keyframes slide-r { from { opacity: 0; transform: translateX(40px); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-40px); } }
.onb__dots { display: flex; justify-content: center; gap: 10px; padding: 12px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.dot.is-on { width: 28px; border-radius: 999px; background: var(--grad); }
.onb__nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.onb__nav .btn[hidden] + .btn { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
}

/* Rechtstexte (impressum.html, datenschutz.html) */
.legal { max-width: 760px; margin: 0 auto; padding: 20px var(--gutter) 40px; display: grid; gap: 18px; }
.legal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legal h1 { font-size: clamp(2rem, 8vw, 3rem); }
.prose h2 { font-size: 1.1rem; margin: 1.8em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #d0d0d8; }
.prose p { margin-bottom: 1em; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }
.prose ul { padding-left: 1.2rem; }
