@font-face { font-family: 'Bricolage Grotesque'; src: url(fonts/BricolageGrotesque.ttf) format('truetype'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url(fonts/PlusJakartaSans.ttf) format('truetype'); font-weight: 200 800; font-display: swap; }
/* ALTE POST Physio – Patienten-App. Farben und Schriften aus dem Corporate Design (altepost.physio). */
:root {
  --linen: #F5F0E8; --bark: #2C2418; --moss: #4A5C3A; --moss-dark: #3D4E30; --terra: #B5622B; --stone: #8C8070; --mid: #E8E3DB;
  --bg: var(--linen); --surface: #FCFAF6; --fill: var(--mid); --text: var(--bark); --muted: #6F6455; --line: rgba(44, 36, 24, .11);
  --accent: var(--moss); --accent-text: var(--moss); --on-accent: var(--linen); --warm: var(--terra); --bar: rgba(245, 240, 232, .86);
  --display: 'Bricolage Grotesque', ui-rounded, system-ui, sans-serif; --body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --r: 6px; --r-btn: 4px; --pad: 20px; --tab-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.32, .72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1B1610; --surface: #261F17; --fill: #332A1F; --text: #F5F0E8; --muted: #B0A594; --line: rgba(245, 240, 232, .13);
    --accent: #5C7248; --accent-text: #A3BA8E; --warm: #DB8A52; --bar: rgba(27, 22, 16, .86); }
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea { user-select: text; -webkit-user-select: text; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; border-radius: var(--r-btn); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }

/* ---------- Hülle ---------- */
.app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; overflow: hidden; background: var(--bg); }
@media (min-width: 560px) { body { background: var(--fill); } .app { top: 20px; bottom: 20px; border-radius: 28px; box-shadow: 0 30px 80px rgba(44, 36, 24, .22); } }
.scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: calc(var(--safe-t) + 14px) var(--pad) calc(var(--tab-h) + var(--safe-b) + 28px); }
.app.auth #tabbar { display: none; }
.app:not(.ready) > * { visibility: hidden; }
.app:not(.ready)::after { content: ''; position: absolute; inset: 0; background: url(img/logo-altepost-bark.svg) center / 190px no-repeat; }
@media (prefers-color-scheme: dark) { .app:not(.ready)::after { background-image: url(img/logo-altepost-linen.svg); } }

#tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; padding: 6px 6px calc(var(--safe-b) + 4px); background: var(--bar); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line); }
.tab { flex: 1; min-height: 48px; display: grid; justify-items: center; gap: 2px; padding: 5px 0 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; transition: color .2s, transform .15s; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-text); }
.tab:active { transform: scale(.92); }
.tab .dot { position: absolute; margin-left: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--warm); }

/* ---------- Typo-Bausteine ---------- */
.eyebrow { font: 700 11px/1.3 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--warm); }
.lt { padding: 6px 0 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lt h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.lt h1 em { font-style: normal; color: var(--accent-text); }
.sec { margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
.sec h2 { font-size: 20px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 13.5px; line-height: 1.45; } .center { text-align: center; }
.link { color: var(--accent-text); font-weight: 600; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Karten ---------- */
.card { display: block; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; }
button.card, a.card, .press { transition: transform .18s var(--ease), opacity .18s; text-decoration: none; }
button.card:active, a.card:active, .press:active { transform: scale(.975); opacity: .85; }
.card + .card { margin-top: 12px; }
.card.dark { background: var(--bark); color: var(--linen); border-color: transparent; }
.card.dark .muted { color: rgba(245, 240, 232, .68); }
.card.moss { background: var(--moss); color: var(--linen); border-color: transparent; }
.card.moss .muted { color: rgba(245, 240, 232, .76); } .card.moss .eyebrow, .card.dark .eyebrow { color: rgba(245, 240, 232, .7); }
.card h3 { font-size: 21px; font-weight: 700; }
.mark { position: absolute; right: -34px; bottom: -44px; width: 170px; opacity: .1; pointer-events: none; }
.row { display: flex; align-items: center; gap: 14px; } .grow { flex: 1; min-width: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--fill); flex: none; }
.avatar.lg { width: 64px; height: 64px; }
.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }

/* ---------- Buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 20px; border-radius: var(--r-btn); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px; transition: transform .16s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.97); background: var(--moss-dark); }
.btn.light { background: var(--linen); color: var(--bark); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.quiet { background: var(--fill); color: var(--text); }
.btn.sm { min-height: 44px; width: auto; font-size: 14.5px; padding: 0 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; } .btns .btn { flex: 1; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); flex: none; position: relative; transition: transform .15s; }
.iconbtn:active { transform: scale(.9); } .iconbtn svg { width: 22px; height: 22px; }
.iconbtn .dot { position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--warm); border: 2px solid var(--bg); }

/* ---------- Heute ---------- */
.ring { width: 92px; height: 92px; flex: none; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke: rgba(245, 240, 232, .22); }
.ring .val { stroke: var(--linen); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring b { font: 800 24px/1 var(--display); letter-spacing: -.03em; } .ring small { font-size: 11px; opacity: .75; display: block; text-align: center; margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 14px; }
.day { display: grid; justify-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.day i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; color: transparent; }
.day i svg { width: 15px; height: 15px; }
.day.full i { background: var(--accent); border-color: var(--accent); color: var(--linen); }
.day.part i { border-color: var(--accent-text); background: linear-gradient(to top, color-mix(in srgb, var(--accent) 34%, transparent) 50%, transparent 50%); }
.day.rest i { border-style: dashed; }
.day.today { color: var(--text); } .day.today i { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--warm); }
.datebox { width: 58px; flex: none; text-align: center; border-radius: var(--r); background: var(--fill); padding: 8px 0 9px; }
.datebox b { display: block; font: 800 25px/1 var(--display); letter-spacing: -.03em; } .datebox span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--warm); }
.banner { background: var(--fill); border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.banner svg { width: 20px; height: 20px; flex: none; color: var(--warm); }

/* ---------- Listen ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 8px; min-height: 68px; width: 100%; position: relative; }
.item + .item::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; border-top: 1px solid var(--line); }
.item .t { font-weight: 600; font-size: 16px; line-height: 1.25; } .item .s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.item.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; transition: opacity .15s; } .item-main:active { opacity: .55; }
.check { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.check i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--stone); display: grid; place-items: center; color: transparent; transition: all .25s var(--ease); }
.check i svg { width: 16px; height: 16px; }
.check[aria-pressed="true"] i { background: var(--accent); border-color: var(--accent); color: var(--linen); transform: scale(1.08); }
.check:active i { transform: scale(.85); }
.seg { display: flex; background: var(--fill); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.seg button { flex: 1; min-height: 38px; border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--muted); text-align: center; transition: all .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(44, 36, 24, .14); }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--muted); }
.chip.ok { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); } .chip.warm { background: color-mix(in srgb, var(--warm) 16%, transparent); color: var(--warm); }
.empty { text-align: center; padding: 34px 20px; } .empty svg { width: 54px; opacity: .3; margin-bottom: 12px; } .empty h3 { font-size: 20px; margin-bottom: 6px; }
.skel { border-radius: var(--r); background: linear-gradient(100deg, var(--fill) 30%, var(--surface) 50%, var(--fill) 70%) 0 / 300% 100%; animation: sk 1.4s infinite; height: 120px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -150% 0; } }

/* ---------- Seiten (Push) ---------- */
.page { position: absolute; inset: 0; z-index: 10; background: var(--bg); transform: translateX(100%); transition: transform .42s var(--ease); box-shadow: -12px 0 40px rgba(44, 36, 24, .14); }
.page.in { transform: none; }
.page.full { transform: translateY(100%); } .page.full.in { transform: none; }
.page .scroll { padding-top: calc(var(--safe-t) + 60px); padding-bottom: calc(var(--safe-b) + 110px); }
.nav { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t) + 6px) 8px 6px; background: var(--bar); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.nav .back { min-height: 44px; display: flex; align-items: center; gap: 2px; padding: 0 10px 0 4px; font-weight: 600; color: var(--accent-text); } .nav .back svg { width: 24px; height: 24px; }
.nav .title { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 15px; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px var(--pad) calc(var(--safe-b) + 14px); background: linear-gradient(to top, var(--bg) 62%, transparent); }
.hero { height: 190px; border-radius: var(--r); background: var(--moss); color: var(--linen); position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 18px; margin-bottom: 20px; }
.hero.terra { background: var(--terra); } .hero.bark { background: var(--bark); }
.hero .mark { opacity: .16; width: 250px; right: -40px; bottom: -70px; }
.hero h1 { font-size: 30px; font-weight: 800; position: relative; }
.dose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.dose div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 8px; text-align: center; }
.dose b { display: block; font: 800 24px/1.1 var(--display); letter-spacing: -.03em; } .dose span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; padding: 12px 0; font-size: 16.5px; line-height: 1.5; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); font: 700 13px/1.9 var(--body); letter-spacing: .08em; color: var(--warm); flex: none; }
.note { border-left: 3px solid var(--warm); padding: 4px 0 4px 14px; margin: 18px 0; font-size: 15px; }
.prose p { font-size: 16.5px; line-height: 1.6; } .prose p + p { margin-top: 12px; }

/* ---------- Übungs-Player ---------- */
.player { display: flex; flex-direction: column; height: 100%; padding: calc(var(--safe-t) + 10px) var(--pad) calc(var(--safe-b) + 18px); background: var(--bark); color: var(--linen); }
.player .top { display: flex; align-items: center; gap: 12px; }
.bars { flex: 1; display: flex; gap: 4px; } .bars i { flex: 1; height: 4px; border-radius: 2px; background: rgba(245, 240, 232, .2); overflow: hidden; } .bars i b { display: block; height: 100%; background: var(--linen); transition: width .4s var(--ease); }
.player .x { width: 44px; height: 44px; display: grid; place-items: center; color: var(--linen); margin-right: -10px; } .player .x svg { width: 24px; }
.player .mid { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; overflow-y: auto; padding: 16px 0; }
.player h1 { font-size: 34px; font-weight: 800; margin: 8px 0 14px; }
.player .step { font-size: 18px; line-height: 1.5; color: rgba(245, 240, 232, .86); }
.player .eyebrow { color: #E0A070; }
.count { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 6px; } .count b { font: 800 76px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; } .count span { font-size: 16px; color: rgba(245, 240, 232, .7); font-weight: 500; }
.pips { display: flex; gap: 8px; margin-top: 12px; } .pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(245, 240, 232, .5); } .pips i.on { background: var(--linen); border-color: var(--linen); }
.player .btn { min-height: 60px; font-size: 17.5px; } .player .sub { display: flex; justify-content: space-between; margin-top: 6px; } .player .sub button { min-height: 44px; padding: 0 4px; color: rgba(245, 240, 232, .72); font-weight: 600; font-size: 14.5px; }
.finish { text-align: center; } .finish .big { width: 96px; height: 96px; border-radius: 50%; background: var(--moss); display: grid; place-items: center; margin: 0 auto 22px; animation: pop .6s var(--ease); } .finish .big svg { width: 46px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- Sheets ---------- */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(28, 22, 14, .45); opacity: 0; transition: opacity .3s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 92%; overflow-y: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 10px var(--pad) calc(var(--safe-b) + 20px); transform: translateY(105%); transition: transform .42s var(--ease); }
.open > .scrim { opacity: 1; } .open > .sheet { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; } .sheet .muted { margin-bottom: 16px; }
label.f { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
.input { width: 100%; min-height: 52px; border-radius: var(--r-btn); border: 1.5px solid var(--line); background: var(--surface); padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .2s; resize: none; }
.input:focus { border-color: var(--accent-text); }
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; } .scale button, .opts button { min-height: 46px; border-radius: var(--r-btn); background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; text-align: center; font-size: 15px; transition: all .15s; }
.scale button[aria-pressed="true"], .opts button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--linen); transform: scale(1.06); }
.scale-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; } .opts button { padding: 0 14px; font-weight: 600; font-size: 14.5px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 76px; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: 16px; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; user-select: text; -webkit-user-select: text; animation: rise .3s var(--ease); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--linen); border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.urgent { border-color: var(--warm); border-width: 1.5px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; margin-bottom: 4px; }
.typing { display: flex; gap: 4px; padding: 15px 16px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.composer { position: absolute; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 6px); z-index: 4; display: flex; gap: 8px; padding: 8px 14px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.page .composer { bottom: 0; padding-bottom: calc(var(--safe-b) + 12px); }
.composer .input { border-radius: 26px; min-height: 48px; padding: 11px 18px; } .composer .send { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--linen); display: grid; place-items: center; flex: none; transition: transform .15s; } .composer .send:active { transform: scale(.88); } .composer .send svg { width: 22px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }

/* ---------- Login ---------- */
.login { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding-bottom: calc(var(--safe-b) + 8px); position: relative; }
.login .logo { width: 150px; margin-top: 10px; } .login .logo.d { display: none; }
@media (prefers-color-scheme: dark) { .login .logo.l { display: none; } .login .logo.d { display: block; } }
.login h1 { font-size: 44px; font-weight: 800; letter-spacing: -.035em; line-height: 1.02; } .login h1 em { font-style: normal; color: var(--accent-text); }
.login .bgmark { position: absolute; right: -90px; top: 12%; width: 300px; opacity: .06; pointer-events: none; color: var(--text); }
.login > :not(.bgmark) { position: relative; z-index: 1; }
.code { text-align: center; font: 800 26px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; min-height: 64px; }
.code::placeholder { letter-spacing: .1em; font-weight: 600; font-size: 17px; text-transform: none; color: var(--stone); font-family: var(--body); }
.err { color: #B3401F; font-size: 14px; font-weight: 600; min-height: 22px; margin: 8px 0; }
@media (prefers-color-scheme: dark) { .err { color: #F0A183; } }
.shake { animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

#toast { position: absolute; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 22px); z-index: 40; transform: translate(-50%, 30px); opacity: 0; background: var(--bark); color: var(--linen); padding: 12px 18px; border-radius: 99px; font-size: 14.5px; font-weight: 600; transition: all .35s var(--ease); pointer-events: none; max-width: 88%; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-color-scheme: dark) { #toast { background: var(--linen); color: var(--bark); } }
