/* ============================================================
   JBFitness – Athletic Body Tracker · v2 (Professional UI)
   Mobile First · Bottom-Nav (Mobile) · Sidebar (Desktop)
   Keine externen Fonts/CDNs (DSGVO)
   ============================================================ */

:root {
    --ink:        #16202B;
    --ink-soft:   #64748B;
    --ink-faint:  #94A3B8;
    --paper:      #F1F4F8;
    --card:       #FFFFFF;
    --line:       #E4E9F0;
    --line-soft:  #EDF1F6;
    --navy:       #0B1F3A;
    --navy-2:     #10294A;
    --accent:     #1C69D4;
    --accent-deep:#0F4C9C;
    --accent-soft:#EAF1FB;
    --drop:       #E8590C;
    --drop-soft:  #FDEEE4;
    --ok:         #1F9D55;
    --ok-soft:    #E7F5EC;
    --danger:     #C92A2A;
    --radius:     16px;
    --radius-sm:  11px;
    --shadow:     0 1px 2px rgba(11,31,58,.05), 0 6px 20px rgba(11,31,58,.06);
    --shadow-lg:  0 8px 30px rgba(11,31,58,.12);
    --font:       "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-cond:  "IBM Plex Sans Condensed", "Arial Narrow", var(--font);
    --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --nav-h:      62px;
    --safe-b:     env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(560px 380px at 12% -6%, rgba(28,105,212,.16), transparent 60%),
        radial-gradient(640px 420px at 105% 12%, rgba(112,72,232,.11), transparent 60%),
        radial-gradient(520px 420px at 82% 105%, rgba(31,157,85,.10), transparent 60%),
        var(--paper);
}

h1, h2, h3 { margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
h3 small { font-weight: 400; color: var(--ink-soft); }
a { color: var(--accent); text-decoration: none; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.center { text-align: center; }
.warn { color: var(--danger); }

svg { display: block; }
.nav-ico svg, .session-ico svg, .topbar-settings svg { width: 21px; height: 21px; }

/* ---------- App-Gerüst ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.content {
    padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
    max-width: 780px;
    margin: 0 auto;
}
.sidebar { display: none; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
}
.topbar-title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar-settings { color: var(--ink-soft); }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
    font-family: var(--font-cond); font-weight: 700; font-size: 17px; letter-spacing: .02em;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff;
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(28,105,212,.35);
}
.brand-mark-sm { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
.brand-name { font-family: var(--font-cond); font-weight: 700; font-size: 18px; letter-spacing: .14em; line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font); font-weight: 400; font-size: 11px; letter-spacing: .01em; color: var(--ink-soft); }

/* ---------- Bottom-Nav (Mobile) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex;
    background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b);
    box-shadow: 0 -4px 20px rgba(11,31,58,.07);
}
.bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    height: var(--nav-h);
    color: var(--ink-faint);
    font-size: 10.5px; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.bottom-nav a.active { color: var(--accent); font-weight: 600; }
.bottom-nav a.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}

/* ---------- Karten ---------- */
.card {
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.65);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}
.card-hero { border-top: 3px solid var(--accent); }
.card-note { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.card-danger { border-color: #F1C4C4; }
.card-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    margin-bottom: 12px;
}
.card-head h3 { margin: 0; }
.card-link { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.eyebrow {
    text-transform: uppercase; letter-spacing: .1em;
    font-size: 11.5px; color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.hero-sub { font-size: 13.5px; font-weight: 400; color: var(--ink-soft); display: block; margin-top: 2px; }
.hero-exercises { color: var(--ink-soft); font-size: 14px; }

/* ---------- Seitenkopf & KPIs (Dashboard) ---------- */
.page-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
    gap: 10px; margin: 6px 2px 16px;
}
.page-head h1 { margin-bottom: 2px; }
.page-head .muted { font-size: 13.5px; margin: 0; }
.week-badge {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .03em;
    padding: 8px 14px; border-radius: 999px;
    box-shadow: 0 3px 10px rgba(28,105,212,.3);
    white-space: nowrap;
}

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi {
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
    padding: 14px 15px;
    display: flex; flex-direction: column; gap: 3px;
    position: relative; overflow: hidden;
}
.kpi::after {
    content: ''; position: absolute; top: -34px; right: -34px;
    width: 96px; height: 96px; border-radius: 50%;
    background: radial-gradient(circle, rgba(28,105,212,.14), transparent 70%);
}
.kpi-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--ink-faint);
}
.kpi-value {
    font-family: var(--font-mono); font-weight: 600; font-size: 24px; line-height: 1.15;
    color: var(--ink); letter-spacing: -0.02em;
}
.kpi-value small { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.kpi-foot { font-size: 11.5px; color: var(--ink-soft); }
.delta-down { color: var(--ok); font-weight: 600; }
.delta-up { color: var(--drop); font-weight: 600; }

.dash-cols { display: block; }

/* ---------- Heute: Session-Liste & Start-Panel ---------- */
.session-list, .activity-list { list-style: none; margin: 0 0 12px; padding: 0; }
.session-row, .activity-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 4px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink);
}
.session-list li:first-child .session-row, .activity-list li:first-child .activity-row { border-top: none; }
.session-ico {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.session-ico-strength { background: var(--accent-soft); color: var(--accent-deep); }
.session-ico-cardio { background: var(--ok-soft); color: var(--ok); }
.session-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.session-info strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-info small { font-size: 12px; color: var(--ink-soft); }
.mini-check { color: var(--ok); font-weight: 700; }

.start-quick { margin-bottom: 10px; }
.start-more summary { list-style: none; cursor: pointer; }
.start-more summary::-webkit-details-marker { display: none; }
.start-panel { margin-top: 12px; }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.start-opt {
    text-align: left; cursor: pointer;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 11px 12px; font-family: var(--font);
    display: flex; flex-direction: column; gap: 1px;
    transition: border-color .15s, box-shadow .15s;
}
.start-opt:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(28,105,212,.14); }
.start-opt strong { font-size: 13.5px; color: var(--accent-deep); }
.start-opt small { font-size: 11px; color: var(--ink-soft); }
.start-opt-free { grid-column: 1 / -1; border-style: dashed; }
.start-more > .btn { margin-top: 10px; }

/* ---------- Wochenbalken ---------- */
.weekbar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wb-day {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 2px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--card); color: var(--ink);
    transition: border-color .15s;
}
.wb-day:hover { border-color: var(--accent); }
.wb-wd { font-size: 11px; font-weight: 700; color: var(--ink-soft); letter-spacing: .04em; }
.wb-dot {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--line-soft); color: var(--ink-faint);
    font-size: 13px; font-weight: 700;
}
.wb-done .wb-dot { background: var(--ok); color: #fff; }
.wb-open .wb-dot { background: var(--accent-soft); color: var(--accent); }
.wb-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wb-cardio { opacity: .75; }
.wb-name { font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; }

/* ---------- Sparkline & Aktivitäten ---------- */
.sparkline { width: 100%; height: 64px; margin: 2px 0 6px; }
.spark-foot { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-soft); }
.spark-foot strong { font-family: var(--font-mono); font-size: 16px; color: var(--ink); }

/* ---------- Wochen-Ribbon (Plan) ---------- */
.week-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.week-pills { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; flex: 1; scrollbar-width: none; }
.week-pills::-webkit-scrollbar { display: none; }
.pill {
    padding: 7px 13px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--ink-soft);
    white-space: nowrap; cursor: pointer;
}
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.current:not(.active) { border-color: var(--accent); color: var(--accent); }
.week-arrow { font-size: 22px; padding: 4px 10px; color: var(--accent); }
.week-arrow.disabled { opacity: .3; pointer-events: none; }
.plan-range { margin: 0 0 12px 4px; font-size: 13px; }
.session-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Plan-Karten ---------- */
.plan-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.plan-day { display: block; color: var(--ink); transition: box-shadow .15s, border-color .15s; }
.plan-day:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.plan-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-day.is-done { border-left: 4px solid var(--ok); }
.plan-day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.plan-wd { font-weight: 700; font-size: 13.5px; color: var(--accent-deep); text-transform: uppercase; letter-spacing: .05em; }
.plan-wd small { color: var(--ink-soft); font-weight: 400; text-transform: none; }
.plan-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 8px; }
.plan-ex-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.plan-ex-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--line-soft); }
.plan-scheme { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.plan-day-cardio h3 { color: var(--ink-soft); }
.plan-cardio-done { color: var(--ok); font-weight: 600; font-size: 14px; }

.tag {
    display: inline-block; font-size: 11px; font-weight: 700;
    padding: 3px 9px; border-radius: 999px;
    background: var(--line-soft); color: var(--ink-soft);
    vertical-align: middle; white-space: nowrap;
}
.tag-done { background: var(--ok-soft); color: var(--ok); }
.tag-open { background: var(--accent-soft); color: var(--accent); }
.tag-always { background: #FFF4D6; color: #8a6d00; }
.tag-custom { background: var(--accent-soft); color: var(--accent); }

/* ---------- Workout ---------- */
.wo-head { margin-bottom: 12px; }
.back-link { font-size: 14px; display: inline-block; margin-bottom: 6px; font-weight: 600; }
.wo-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; }
.wo-date { font-size: 13px; color: var(--ink-soft); }
.wo-done-tag { margin-top: 8px; }

.wex-head { display: flex; gap: 12px; align-items: flex-start; }
.wex-photo {
    flex: 0 0 56px; width: 56px; height: 56px;
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line); background: var(--line-soft);
    display: flex; align-items: center; justify-content: center;
}
.wex-photo img { width: 100%; height: 100%; object-fit: cover; }
.wex-photo-empty { font-size: 10.5px; color: var(--ink-faint); text-align: center; line-height: 1.2; }
.wex-info { flex: 1; min-width: 0; }
.wex-info h3 { margin-bottom: 2px; }
.wex-scheme { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.wex-last {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-radius: 9px;
    padding: 7px 10px;
    margin: 0;
    overflow-x: auto; white-space: nowrap;
    scrollbar-width: none;
}
.wex-last::-webkit-scrollbar { display: none; }
.wex-last.muted { background: var(--line-soft); color: var(--ink-soft); font-family: var(--font); white-space: normal; }
.last-label { font-family: var(--font); font-weight: 700; }
.wex-actions { display: flex; flex-direction: column; gap: 6px; }

.icon-btn {
    border: 1px solid var(--line); background: var(--card);
    border-radius: 9px; width: 32px; height: 32px;
    font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.always-btn.on { color: #C08A00; border-color: #E8CD7A; background: #FFF9E8; }

/* Set-Logger */
.set-table { margin-top: 12px; }
.set-row {
    display: grid;
    grid-template-columns: 30px 1fr 1fr 44px 58px;
    gap: 8px; align-items: center;
    padding: 5px 0;
}
.set-row-head {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--ink-faint); font-weight: 700;
    border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.set-group { border-bottom: 1px dashed var(--line-soft); }
.set-group:last-of-type { border-bottom: none; }
.set-no { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--accent-deep); text-align: center; }
.drop-no { color: var(--drop); font-size: 18px; }
.set-row input {
    width: 100%;
    font-family: var(--font-mono); font-size: 17px; text-align: center;
    padding: 10px 4px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card); color: var(--ink);
    min-height: 46px;
    transition: border-color .12s, background .2s;
}
.set-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,105,212,.14); }
.set-row input.saved { border-color: var(--ok); background: var(--ok-soft); }
.set-row-drop input { border-style: dashed; border-color: #EFC4A8; background: #FFFDFB; }
.set-row-drop input.saved { border-color: var(--drop); background: var(--drop-soft); }

.mv-btn {
    min-height: 46px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line); background: var(--card);
    font-weight: 800; font-size: 12.5px; letter-spacing: .03em;
    color: var(--ink-faint); cursor: pointer;
    transition: all .12s;
}
.mv-btn.on { background: var(--drop); border-color: var(--drop); color: #fff; box-shadow: 0 2px 8px rgba(232,89,12,.35); }
.drop-btn, .drop-del {
    min-height: 46px; border-radius: var(--radius-sm);
    border: 1.5px dashed var(--drop); background: transparent;
    color: var(--drop); font-size: 11.5px; font-weight: 800; cursor: pointer;
}
.drop-del { border-style: solid; border-color: var(--line); color: var(--ink-faint); }
.add-set-btn { margin-top: 8px; }

/* ---------- Buttons & Formulare ---------- */
.btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: var(--font); font-size: 15px; font-weight: 600;
    cursor: pointer; text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform .06s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(28,105,212,.3);
}
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--accent); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { color: var(--danger); background: transparent; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
label small { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    margin-top: 5px;
    padding: 11px 12px;
    font-family: var(--font); font-size: 16px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card); color: var(--ink);
    min-height: 46px;
    transition: border-color .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,105,212,.13); }
textarea { resize: vertical; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.check-mid { align-items: center; margin-top: 22px; }
.form-section {
    text-transform: uppercase; letter-spacing: .09em;
    font-size: 11.5px; font-weight: 800; color: var(--accent-deep);
    border-bottom: 1px solid var(--line); padding-bottom: 5px; margin: 4px 0 0;
}
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { flex: 1; min-width: 200px; }

.msg { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.msg-error { background: #FBEBEB; color: var(--danger); }
.msg-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Auth ---------- */
.auth-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(28,105,212,.35), transparent 60%),
        radial-gradient(700px 500px at -10% 110%, rgba(15,76,156,.4), transparent 55%),
        linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 60%, #081627 100%);
    padding: 20px;
}
.auth-card {
    background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg);
    padding: 30px 26px; width: 100%; max-width: 420px;
}
.legal-card { max-width: 680px; max-height: 88vh; overflow-y: auto; }
.legal-card h2 { font-size: 16px; margin-top: 18px; }
.brand-auth { margin-bottom: 20px; }
.auth-alt, .auth-legal { text-align: center; font-size: 14px; margin-top: 14px; }
.auth-legal { font-size: 12.5px; }

/* ---------- Dashboard-Elemente ---------- */
.hws-row { display: flex; gap: 10px; margin: 8px 0 10px; }
.hws-chip {
    flex: 1; min-height: 48px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card); font-size: 15px; font-weight: 700;
    color: var(--ink-soft); cursor: pointer;
    transition: all .15s;
}
.hws-chip .hws-check { opacity: 0; }
.hws-chip.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.hws-chip.on .hws-check { opacity: 1; }
.mini-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line-soft); }
.cardio-sum { font-size: 15px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-row-4 { grid-template-columns: repeat(2, 1fr); }
.stat { text-align: center; padding: 13px 8px; margin-bottom: 0; }
.stat-v { font-family: var(--font-mono); font-weight: 600; font-size: 21px; display: block; color: var(--accent-deep); }
.stat-l { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ---------- Übungen ---------- */
.cat-title { margin: 20px 4px 8px; color: var(--accent-deep); text-transform: uppercase; font-size: 13px; letter-spacing: .08em; }
.ex-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.ex-card { margin-bottom: 0; }
.ex-card-top { display: flex; gap: 12px; align-items: flex-start; }
.ex-thumb {
    flex: 0 0 52px; width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line); background: var(--line-soft);
    display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.add-ex-row { display: flex; gap: 10px; }
.add-ex-row select { flex: 1; margin-top: 0; }

/* ---------- Workout-Meta ---------- */
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-rating { display: flex; gap: 6px; margin-top: 5px; }
.form-rating button {
    flex: 1; min-height: 46px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
    font-family: var(--font-mono); font-size: 15px; color: var(--ink-faint); cursor: pointer;
    transition: all .12s;
}
.form-rating button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#finishBtn { margin-top: 12px; }
.wo-delete { margin-top: 8px; }
.save-indicator {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
    background: var(--navy); color: #fff;
    font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
    box-shadow: var(--shadow-lg);
    opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50;
}
.save-indicator.show { opacity: .95; }

/* ---------- Fortschritt ---------- */
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
#progressChart { width: 100%; }
.photo-upload-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.photo-upload-row .grow { flex: 1; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-item { margin: 0; }
.photo-item img {
    width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.photo-item figcaption {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink-soft); margin-top: 4px;
}
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.data-table th { text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; }
.data-table td:first-child, .data-table th:first-child { text-align: left; }
.data-table td { font-family: var(--font-mono); }

/* ---------- Cardio ---------- */
.cardio-list { list-style: none; margin: 0; padding: 0; }
.cardio-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 0; border-top: 1px dashed var(--line-soft); font-size: 14px;
}


/* ---------- Challenge ---------- */
.ch-hero {
    position: relative; overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(600px 300px at 85% -20%, rgba(28,105,212,.5), transparent 60%),
        radial-gradient(420px 300px at -5% 115%, rgba(112,72,232,.42), transparent 60%),
        linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 60%, #0A1B33 100%);
    color: #fff;
    padding: 26px 22px;
    margin-bottom: 16px;
    display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    box-shadow: 0 12px 40px rgba(11,31,58,.35);
}
.ch-hero-glow {
    position: absolute; top: -60px; left: 30%;
    width: 300px; height: 160px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,.22), transparent 70%);
    pointer-events: none;
}
.ch-hero h1 { color: #fff; margin-bottom: 2px; font-size: 26px; }
.ch-dates { color: rgba(255,255,255,.72); font-size: 13.5px; margin-bottom: 10px; }
.eyebrow-light { color: #8FC1FF; }
.prize-badge {
    display: inline-block;
    background: linear-gradient(135deg, #F5B301, #E8590C);
    color: #fff; font-weight: 800; font-size: 14px;
    padding: 8px 16px; border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(245,179,1,.18), 0 4px 18px rgba(232,89,12,.5);
    margin-bottom: 8px;
}
.ch-lead { margin: 10px 0 0; font-size: 15px; color: rgba(255,255,255,.9); }
.ch-lead strong { color: #fff; }

.ch-ring-wrap { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.ch-ring { width: 118px; height: 118px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 8; }
.ring-fg {
    fill: none; stroke: #4D9BFF; stroke-width: 8; stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(77,155,255,.9));
    transition: stroke-dashoffset .6s ease;
}
.ch-ring-txt {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff;
}
.ch-ring-txt strong { font-family: var(--font-mono); font-size: 22px; }
.ch-ring-txt small { font-size: 10.5px; color: rgba(255,255,255,.65); }

.msg-monday, .msg-invite {
    display: block;
    background: linear-gradient(135deg, rgba(245,179,1,.16), rgba(232,89,12,.13));
    border: 1px solid rgba(232,89,12,.35);
    color: #A34406; font-weight: 600;
    margin-bottom: 14px;
    box-shadow: 0 0 22px rgba(245,179,1,.22);
    border-radius: var(--radius-sm); padding: 13px 15px; font-size: 14px;
}
.msg-invite {
    background: linear-gradient(135deg, rgba(28,105,212,.13), rgba(112,72,232,.12));
    border-color: rgba(28,105,212,.35); color: var(--accent-deep);
    box-shadow: 0 0 22px rgba(28,105,212,.2);
}

.vs-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 14px; }
.member-card { position: relative; margin-bottom: 0; border-top: 3px solid var(--mc, var(--accent)); }
.member-lead {
    box-shadow: 0 0 0 2px var(--mc), 0 0 28px color-mix(in srgb, var(--mc) 38%, transparent), var(--shadow);
}
.lead-flag {
    position: absolute; top: -11px; right: 14px;
    background: var(--mc); color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: .04em;
    padding: 4px 12px; border-radius: 999px;
    box-shadow: 0 3px 12px color-mix(in srgb, var(--mc) 55%, transparent);
}
.member-head { display: flex; gap: 11px; align-items: center; margin-bottom: 10px; }
.member-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; color: #fff;
    background: var(--mc);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 22%, transparent);
}
.member-name { font-size: 16px; display: block; }
.member-big {
    font-family: var(--font-mono); font-weight: 600; font-size: 40px; line-height: 1.05;
    color: var(--mc); letter-spacing: -0.02em;
    text-shadow: 0 0 24px color-mix(in srgb, var(--mc) 30%, transparent);
}
.member-big small { font-size: 19px; }
.member-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.member-proj {
    margin-top: 8px; font-size: 12.5px; color: var(--ink-soft);
    background: color-mix(in srgb, var(--mc) 8%, transparent);
    border-radius: 8px; padding: 6px 10px; display: inline-block;
}
.member-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.member-stats span { display: flex; flex-direction: column; align-items: center; text-align: center; }
.member-stats strong { font-family: var(--font-mono); font-size: 15px; }
.member-stats small { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.legend-item i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; box-shadow: 0 0 8px currentColor; }
.chart-tabs-sm .pill { padding: 5px 11px; font-size: 12px; }
#chChart { width: 100%; }

.checkin-table td, .checkin-table th { text-align: center; }
.checkin-table td:first-child, .checkin-table th:first-child { text-align: left; font-family: var(--font); }
.row-today { background: rgba(28,105,212,.06); }
.ci {
    display: inline-flex; width: 26px; height: 26px; border-radius: 50%;
    align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.ci-ok { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 10px rgba(31,157,85,.35); }
.ci-miss { background: #FBEBEB; color: var(--danger); }
.ci-future { color: var(--ink-faint); }

.ch-teaser {
    position: relative; overflow: hidden; display: block; color: #fff;
    background:
        radial-gradient(300px 170px at 90% -10%, rgba(245,179,1,.4), transparent 65%),
        linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%);
    border: none;
    box-shadow: 0 10px 32px rgba(11,31,58,.35);
}
.ch-teaser-glow {
    position: absolute; top: -50px; right: -30px;
    width: 170px; height: 130px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,.16), transparent 70%);
}
.ch-teaser-list { list-style: none; margin: 6px 0 10px; padding: 0; }
.ch-teaser-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 9px; font-size: 14px;
    color: rgba(255,255,255,.85);
}
.ch-teaser-list li.is-me { background: rgba(255,255,255,.1); font-weight: 700; color: #fff; }
.ch-teaser-list strong { margin-left: auto; font-family: var(--font-mono); }
.ch-rank {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.16); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 800;
}
.ch-teaser-list li:first-child .ch-rank { background: linear-gradient(135deg, #F5B301, #E8590C); box-shadow: 0 0 10px rgba(245,179,1,.6); }
.ch-teaser-note { color: rgba(255,255,255,.75); font-size: 13.5px; }
.ch-teaser-cta { font-size: 13px; font-weight: 700; color: #8FC1FF; }

.avatar-inline { width: 36px; height: 36px; font-size: 15px; background: var(--accent); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.btn-pair { display: flex; gap: 8px; }
.friend-pick { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.friend-pick legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.check-inline { display: inline-flex; margin: 4px 14px 4px 0; }
.ch-list-item { display: block; color: var(--ink); }


/* ---------- Verschieben / Verpasst ---------- */
.missed-card {
    border: 1px solid rgba(232,89,12,.4);
    box-shadow: 0 0 26px rgba(232,89,12,.16), var(--shadow);
}
.tag-missed { background: #FBEBEB; color: var(--danger); }
.shift-mark { color: var(--accent); font-weight: 800; }
.wb-missed .wb-dot { background: #FBEBEB; color: var(--danger); }
.wb-missed .wb-dot::before { content: '!'; }
.wb-wd em { font-style: normal; font-weight: 400; font-size: 9px; color: var(--ink-faint); display: block; }
.wo-date-btn {
    border: 1px dashed var(--line); background: transparent; cursor: pointer;
    border-radius: 999px; padding: 5px 12px; font-family: var(--font);
    transition: border-color .15s;
}
.wo-date-btn:hover { border-color: var(--accent); color: var(--accent); }
.date-panel {
    margin-top: 10px; padding: 13px 14px;
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.65); border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.date-quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.date-quick input[type=date] { flex: 1; min-width: 150px; margin-top: 0; min-height: 40px; padding: 7px 10px; }

/* ============================================================
   TABLET ≥ 768px
   ============================================================ */
@media (min-width: 768px) {
    .content { padding: 24px 26px calc(var(--nav-h) + var(--safe-b) + 26px); max-width: 960px; }
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .plan-grid { grid-template-columns: 1fr 1fr; }
    .ex-grid { grid-template-columns: 1fr 1fr; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-row-4 { grid-template-columns: repeat(4, 1fr); }
    .photo-upload-row { flex-direction: row; align-items: flex-end; }
    .start-grid { grid-template-columns: repeat(3, 1fr); }
    .start-opt-free { grid-column: auto; }
    .vs-2 { grid-template-columns: 1fr 1fr; }
    .vs-3 { grid-template-columns: repeat(3, 1fr); }
    .vs-4 { grid-template-columns: repeat(2, 1fr); }
    .ch-hero { padding: 32px 34px; }
    .ch-hero h1 { font-size: 32px; }
}

/* ============================================================
   DESKTOP ≥ 1024px – Sidebar
   ============================================================ */
@media (min-width: 1024px) {
    .bottom-nav, .topbar { display: none; }
    .app { display: grid; grid-template-columns: 262px 1fr; }
    .sidebar {
        display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh;
        background:
            radial-gradient(500px 300px at 110% -5%, rgba(28,105,212,.28), transparent 60%),
            linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
        color: #fff;
        padding: 28px 18px 22px;
    }
    .sidebar .brand-name { color: #fff; }
    .sidebar .brand-name small { color: rgba(255,255,255,.55); }
    .side-nav { margin-top: 34px; display: flex; flex-direction: column; gap: 3px; }
    .side-nav a, .side-footer a {
        display: flex; align-items: center; gap: 12px;
        padding: 11px 14px; border-radius: 11px;
        color: rgba(255,255,255,.72); font-size: 14.5px; font-weight: 500;
        transition: background .15s, color .15s;
        position: relative;
    }
    .side-nav a:hover, .side-footer a:hover { background: rgba(255,255,255,.07); color: #fff; }
    .side-nav a.active, .side-footer a.active { background: rgba(28,105,212,.28); color: #fff; font-weight: 600; }
    .side-nav a.active::before {
        content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
        width: 3px; border-radius: 3px; background: var(--accent);
    }
    .side-nav .nav-ico, .side-footer .nav-ico { opacity: .9; }
    .side-footer { margin-top: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
    .side-footer > a:not(:first-child) { padding: 7px 14px; font-size: 13px; color: rgba(255,255,255,.55); }
    .side-user {
        margin-top: 12px; padding: 14px 6px 0;
        border-top: 1px solid rgba(255,255,255,.12);
        display: flex; align-items: center; gap: 10px;
    }
    .side-avatar {
        width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
        background: rgba(255,255,255,.14); color: #fff;
        display: flex; align-items: center; justify-content: center;
        font-weight: 700; font-size: 14px;
    }
    .side-user-name { display: flex; flex-direction: column; font-size: 13.5px; color: #fff; font-weight: 600; }
    .side-user-name a { padding: 0; font-size: 12px; color: rgba(255,255,255,.55); font-weight: 400; }
    .side-user-name a:hover { background: none; color: #fff; }

    .content { padding: 36px 46px 60px; max-width: 1160px; }
    .page-head h1 { font-size: 28px; }
    .dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
    .plan-grid { grid-template-columns: repeat(3, 1fr); }
    .ex-grid { grid-template-columns: repeat(3, 1fr); }
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
    .set-row { grid-template-columns: 36px 150px 120px 52px 70px; }
    .save-indicator { bottom: 24px; }
    .card { padding: 22px 24px; }
    .kpi { padding: 17px 19px; }
    .kpi-value { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
