/* FitCheck – clean, hell, High-End-App. Eine Schrift (Geist), Stein-Bühne für die Teile, extrem dünne große Zahlen. */
:root {
  --canvas: #F5F3EF;      /* App-Hintergrund, warmes Off-White */
  --surface: #FFFFFF;     /* Karten, Eingaben, Sheets */
  --stone: #ECE8E1;       /* Bühne für Kleidungsstücke */
  --stone-2: #DFD9CF;
  --ink: #161513;
  --ink-2: #4B4843;
  --muted: #918C84;
  --line: #E7E3DC;
  --accent: #161513;
  --good: #4F7A57;
  --warn: #B07B3C;
  --bad: #B0473A;
  --font: 'Geist', 'SF Pro Text', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --r-lg: 24px;
  --r: 16px;
  --r-sm: 12px;
  --nav-h: 72px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); }
body {
  font: 400 15px/1.45 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 40px); }

/* ---------- Typo ---------- */
h1, .h1 { font: 600 34px/1.05 var(--font); letter-spacing: -0.045em; margin: 0; text-wrap: balance; }
h2, .h2 { font: 600 22px/1.15 var(--font); letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
h3 { font: 600 17px/1.25 var(--font); letter-spacing: -0.02em; margin: 0; }
.eyebrow { font: 400 14px/1.3 var(--font); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; }
.serif { font: 600 22px/1.2 var(--font); letter-spacing: -0.03em; }
.menu-t { font: 500 20px/1.2 var(--font) !important; letter-spacing: -0.025em; }
.rank { font: 200 30px/1 var(--font); width: 28px; color: var(--muted); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head .count { font-size: 14px; color: var(--muted); }
.section { margin-top: 34px; display: grid; gap: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ink); color: #fff; font-weight: 500; font-size: 15px;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.soft { background: var(--stone); color: var(--ink); }
.btn.small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 0; background: var(--surface); color: var(--ink); flex: none; box-shadow: inset 0 0 0 1px var(--line);
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: var(--ink); color: #fff; box-shadow: none; }
.icon-btn.plain { box-shadow: none; background: transparent; color: var(--muted); }
.icon-btn:disabled { opacity: .3; }
.icon { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 15px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 450; color: var(--ink-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s ease, color .15s ease;
}
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--stone); font-size: 12.5px; color: var(--ink-2); }
.dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); flex: none; }

/* ---------- Flächen ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: 0 1px 2px rgba(22, 21, 19, .04); }
.studio-bg { background: var(--stone); }

/* ---------- Navigation: schwebende Kapsel ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 12px);
}
.nav-inner {
  pointer-events: auto; max-width: 400px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border-radius: 999px; padding: 6px; box-shadow: 0 10px 34px rgba(22, 21, 19, .12), inset 0 0 0 1px rgba(22, 21, 19, .06);
}
.nav button {
  height: 50px; border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 1px; padding: 0;
  color: var(--muted); font-size: 10px; font-weight: 500; border-radius: 999px; transition: background .2s ease, color .2s ease;
}
.nav button .icon { width: 21px; height: 21px; }
.nav button.on { color: #fff; background: var(--ink); }

/* ---------- Grid / Tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { border: 0; padding: 0; text-align: left; background: none; display: grid; gap: 9px; min-width: 0; }
.tile .ph { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; }
.tile .ph img { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; }
.tile .ph img.photo { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile:active .ph { transform: scale(.98); }
.tile .ph { transition: transform .15s ease; }
.tile .meta { display: grid; gap: 2px; min-width: 0; padding: 0 2px; }
.tile .name { font-size: 14px; font-weight: 500; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cut { filter: drop-shadow(0 14px 14px rgba(40, 32, 20, .13)) drop-shadow(0 2px 3px rgba(40, 32, 20, .08)); }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; height: 24px; padding: 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.9); font-size: 11.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.badge.dark { background: var(--ink); color: #fff; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bühne (Outfit) ---------- */
.board { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; width: 100%; }
.board::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 5%; height: 8%; background: radial-gradient(closest-side, rgba(40, 32, 20, .10), transparent); pointer-events: none; }
.board .piece { position: absolute; transition: all .45s cubic-bezier(.2,.75,.2,1); }
.board .piece img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.board .piece img.photo { object-fit: cover; border-radius: 12px; }
.board .piece.locked::after {
  content: ''; position: absolute; top: 4%; right: 6%; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px #fff;
}
.board .empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); font-size: 15px; z-index: 2; }
.board-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
.board-caption .eyebrow { font-size: 13.5px; }
.score { font: 200 40px/1 var(--font); letter-spacing: -0.05em; color: var(--ink); }
.score small { font: 400 13px var(--font); letter-spacing: 0; color: var(--muted); margin-left: 3px; }
.mini-board { display: flex; gap: 6px; }
.mini-board .m { width: 44px; aspect-ratio: 4/5; border-radius: 10px; overflow: hidden; position: relative; }
.mini-board .m img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; }

/* ---------- Teile-Liste im Studio ---------- */
.slots { display: grid; gap: 2px; background: var(--surface); border-radius: var(--r); padding: 6px; }
.slot {
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 6px; border-radius: var(--r-sm);
}
.slot + .slot { box-shadow: 0 -1px 0 var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.slot.off { opacity: .6; }
.slot .th { width: 50px; aspect-ratio: 4/5; border-radius: 10px; overflow: hidden; position: relative; border: 0; padding: 0; }
.slot .th img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.slot .info { min-width: 0; border: 0; background: none; text-align: left; padding: 0; }
.slot .info .eyebrow { font-size: 12.5px; }
.slot .info .n { font-weight: 500; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .acts { display: flex; gap: 4px; }
.slot .acts .icon-btn { width: 36px; height: 36px; box-shadow: none; background: var(--canvas); }
.slot .acts .icon-btn.on { background: var(--ink); }
.slot .acts .icon-btn.plain { background: transparent; }

/* ---------- Kontextleiste ---------- */
.ctx { display: grid; gap: 16px; }
.temp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.temp-big { font: 200 52px/1 var(--font); letter-spacing: -0.05em; min-width: 2.2ch; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 99px; background: var(--stone-2); border: 0; padding: 0; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(18px); }

/* ---------- Heute ---------- */
.weather { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; align-items: end; margin-top: 4px; }
.weather .t { font: 100 104px/.82 var(--font); letter-spacing: -0.07em; margin-left: -6px; }
.weather .t sup { font-size: 36px; font-weight: 200; vertical-align: top; position: relative; top: 10px; letter-spacing: 0; }
.weather .d { display: grid; gap: 2px; padding-bottom: 8px; }
.weather .d .eyebrow { color: var(--ink); font-weight: 500; }

/* ---------- Listen ---------- */
.list { display: grid; background: var(--surface); border-radius: var(--r); padding: 0 16px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 15px 0; box-shadow: 0 1px 0 var(--line);
  background: none; border: 0; width: 100%; text-align: left;
}
.row:last-child { box-shadow: none; }
.list > .row:last-child, .list > *:last-child .row { box-shadow: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-weight: 500; letter-spacing: -0.015em; }
.row .t2 { font-size: 13px; color: var(--muted); }
.row > .icon:last-child { color: var(--muted); }
.row.card { background: var(--surface); }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 48px; padding: 0 15px; border-radius: var(--r-sm); border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); -webkit-appearance: none; appearance: none; font-size: 15px;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
textarea.input { height: auto; min-height: 84px; padding: 13px 15px; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 999px; padding: 4px; background: var(--stone); }
.seg button { height: 36px; border: 0; background: none; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .2s ease, box-shadow .2s ease; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22,21,19,.12); }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; height: 38px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.scale button.on { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(22, 21, 19, .32); animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto;
  background: var(--canvas); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(22, 21, 19, .16);
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 28px); animation: up .32s cubic-bezier(.2,.8,.2,1);
  max-width: 560px; margin: 0 auto; overscroll-behavior: contain;
}
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 14px); }
.sheet .grab { width: 36px; height: 5px; border-radius: 99px; background: var(--stone-2); margin: 2px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Detail ---------- */
.detail-img { position: relative; aspect-ratio: 1 / 1.08; border-radius: var(--r-lg); overflow: hidden; }
.detail-img img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.detail-img img.photo { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.versions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.versions button { flex: none; width: 60px; border: 0; border-radius: 12px; padding: 0; overflow: hidden; background: var(--stone); position: relative; aspect-ratio: 4/5; }
.versions button.on { box-shadow: 0 0 0 2px var(--ink); }
.versions button img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.versions button span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; font-weight: 500; background: rgba(255,255,255,.85); text-align: center; padding: 2px 0; }
.match-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.match-row .tile { width: 108px; flex: none; }

/* ---------- Queue / Toast ---------- */
.queue { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--r); background: var(--ink); color: #fff; }
.queue .bar { height: 3px; border-radius: 9px; background: rgba(255,255,255,.18); overflow: hidden; }
.queue .bar i { display: block; height: 100%; background: #fff; transition: width .4s ease; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%);
  z-index: 80; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(22,21,19,.22); animation: up .25s ease; max-width: calc(100vw - 40px); text-align: center;
}
.toast.err { background: var(--bad); }

.notes { display: grid; gap: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.note::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); margin-top: 8px; flex: none; }
.why { font-size: 16px; line-height: 1.5; color: var(--ink-2); letter-spacing: -0.01em; }

.empty-state { text-align: center; padding: 44px 20px; display: grid; gap: 14px; justify-items: center; }
.empty-state.card { padding: 32px 22px; }

.day { display: grid; gap: 12px; padding: 18px 0; box-shadow: 0 1px 0 var(--line); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.day-head .date { font: 600 17px var(--font); letter-spacing: -0.02em; }
.day.today .date::after { content: 'Heute'; font: 500 11.5px var(--font); margin-left: 8px; padding: 3px 8px; border-radius: 99px; background: var(--ink); color: #fff; vertical-align: 2px; }
.day.past { opacity: .5; }

.bar-h { height: 4px; border-radius: 9px; background: var(--stone); overflow: hidden; }
.bar-h i { display: block; height: 100%; background: var(--ink); transition: width .3s ease; }
.check { display: flex; gap: 12px; align-items: center; padding: 11px 0; box-shadow: 0 1px 0 var(--line); }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.check.done .grow { text-decoration: line-through; color: var(--muted); }

.welcome h1 { font-size: 52px; letter-spacing: -0.06em; }
a { color: var(--ink); text-underline-offset: 3px; }
a.btn, a.icon-btn { text-decoration: none; }
.board img.fit-photo, .th img.fit-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

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