/* Unser Zuhause – Gestaltung nach Mockup (Übergabe Kap. 5, Anhang A/B) */
@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url(/fonts/figtree-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 500; font-display: swap; src: url(/fonts/figtree-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url(/fonts/figtree-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 700; font-display: swap; src: url(/fonts/figtree-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 800; font-display: swap; src: url(/fonts/figtree-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 400 800; font-display: swap; src: url(/fonts/figtree-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #F1F0EC; --card: #FFFFFF; --off: #E4E3DF; --on: #FFFFFF; --tx: #1B1B1D; --tx2: #5C5C62;
  --on-tx: #1B1B1D; --on-tx2: #5C5C62; --line: rgba(27,27,29,.12); --ic: #D3D2CD; --ic-tx: #3F3F44;
  --chip: #FFFFFF; --acc: #A85F00; --heat: #C2410C; --ok: #2F7A45; --warn: #B45309; --bad: #B42318;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113; --card: #1F1F22; --off: #232326; --on: #F4F2EC; --tx: #F2F2F4; --tx2: #A6A6AC;
    --on-tx: #1B1B1D; --on-tx2: #55555B; --line: rgba(255,255,255,.12); --ic: #38383C; --ic-tx: #D6D6DA;
    --chip: #232326; --acc: #F2A93B; --heat: #FB923C; --ok: #6CC388; --warn: #F2A93B; --bad: #F87171;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: Figtree, system-ui, sans-serif; }
body { min-height: 100vh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
input, select { font: inherit; }
svg { flex-shrink: 0; }

.page { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 40px); display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; }
.h1 { margin: 0; font-size: 30px; font-weight: 700; }
.h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--acc); font-size: 16px; font-weight: 600; }
.user { min-height: 36px; padding: 0 12px; border-radius: 6px; background: var(--chip); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.floorhead { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st { color: var(--tx2); font-size: 12.5px; line-height: 1.3; }
.center { text-align: center; }

.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: 6px; }
.row .grow { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.row .nm2 { font-size: 16px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--heat); }

.tile { color: var(--tx); border-radius: 6px; padding: 12px; min-height: 104px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tile.on { color: var(--on-tx); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tile > *:not(.fill) { position: relative; }
.tile .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(242,169,59,.34); pointer-events: none; transition: width .15s; }
.tile.dim { cursor: ew-resize; }
.tile.heat .fill { background: rgba(249,115,22,.24); }
.tile.heat.on .ic { background: #FB923C; color: #3A1A05; }
.tile.busy { opacity: .7; }
.tile .head { display: flex; justify-content: space-between; align-items: flex-start; }
.pen { width: 44px; height: 44px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--tx2); margin: -6px -6px 0 0; }
.tile.on .pen { color: var(--on-tx2); }
.tile.on .st { color: var(--on-tx2); }
.nm { font-weight: 600; font-size: 14px; line-height: 1.2; margin-top: auto; }
.ic { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--ic); color: var(--ic-tx); flex-shrink: 0; }
.tile.on .ic { background: #F2A93B; color: #3A2A08; }

.card { background: var(--chip); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 6px; background: var(--off); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; }
.chip.sel { background: var(--tx); color: var(--bg); }
.step { display: flex; align-items: center; gap: 6px; }
.sb { width: 44px; height: 44px; border-radius: 6px; background: var(--off); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 500; }
.sv { min-width: 64px; text-align: center; font-size: 20px; font-weight: 600; }
.primary { width: 100%; min-height: 52px; border-radius: 6px; background: var(--tx); color: var(--bg); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 14px; }
.primary:disabled { opacity: .5; }
.ghost { min-height: 44px; color: var(--acc); font-weight: 600; font-size: 15px; }
.danger { color: var(--bad); }
.add { width: 100%; min-height: 52px; border-radius: 6px; border: 1.5px dashed var(--line); color: var(--tx2); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.inp { width: 100%; min-height: 48px; border-radius: 6px; border: 1px solid var(--line); background: var(--chip); color: var(--tx); font-size: 16px; padding: 0 12px; }
.chk { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border-radius: 6px; }
.chk label { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-height: 44px; font-size: 16px; font-weight: 500; }
.chk input { width: 22px; height: 22px; accent-color: #2F6FE0; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 6px; background: var(--chip); }
.stat b { font-size: 20px; font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--off); overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.sr { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.big2 { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 6px; background: var(--chip); min-height: 110px; width: 100%; }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.toggle { width: 52px; height: 32px; border-radius: 16px; background: var(--off); position: relative; flex-shrink: 0; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.toggle[aria-checked="true"] { background: #2F7A45; }
.toggle[aria-checked="true"]::after { left: 23px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 20px); background: var(--tx); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; z-index: 10; max-width: calc(100% - 32px); }
.offline { background: color-mix(in srgb, #EF4444 18%, var(--card)); color: var(--tx); border-radius: 6px; padding: 10px 12px; font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.hint { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 6px; background: color-mix(in srgb, #F59E0B 22%, var(--card)); font-size: 14px; font-weight: 500; }
.hint svg { color: var(--warn); }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.login h1 { margin: 0 0 8px; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; }

/* Startseite (Variante B) */
.start { max-width: 560px; margin: 0 auto; }
.hero { position: relative; height: 300px; overflow: hidden; }
.hero svg.ill { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img.ill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.hero .over { position: absolute; left: 20px; right: 20px; top: calc(env(safe-area-inset-top) + 14px); display: flex; flex-direction: column; gap: 6px; color: #1B1B1D; }
.hero .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; gap: 8px; }
.hero .pill { background: rgba(255,255,255,.7); padding: 3px 8px; border-radius: 4px; font-size: 11px; color: #1B1B1D; }
.hero h1 { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; }
.hero .wx { display: flex; flex-direction: column; align-items: flex-end; }
.hero .wx .now { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hero .wx b { font-size: 44px; font-weight: 700; line-height: 1; }
.hero .wx small { font-size: 18px; font-weight: 600; }
.hero .wx span { font-size: 14px; font-weight: 600; }
.hero .spruch { font-size: 16px; font-weight: 500; line-height: 1.35; max-width: 280px; min-height: 44px; color: #1B1B1D; }
.startbody { padding: 0 16px calc(env(safe-area-inset-bottom) + 40px); margin-top: -34px; position: relative; display: flex; flex-direction: column; gap: 14px; }
.rad { background: var(--card); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.leg { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 6px; background: var(--bg); }
.leg b { font-size: 18px; font-weight: 700; }
.ktile { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 18px; border-radius: 6px; min-height: 96px; color: #1B1B1D; width: 100%; }
.ktile.col { flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; min-height: 128px; }
.ktile .kic { width: 44px; height: 44px; border-radius: 22px; flex-shrink: 0; background: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; }
.ktile .kt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ktile .kt b { font-size: 19px; font-weight: 800; line-height: 1.15; }
.ktile .kt span { font-size: 13px; font-weight: 500; color: rgba(27,27,29,.78); }
.persons { display: flex; gap: 6px; flex-wrap: wrap; }
.person { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,.7); color: #1B1B1D; }
.person.away { opacity: .55; }
