/* Winter Arc – Web-App (iPhone). Farben wie in der Android-App (ui/theme/Theme.kt). */
:root {
  --bg: #070c1a;
  --surface: #0f1629;
  --surface-2: #151d33;
  --surface-3: #1c2640;
  --line: #2a3555;
  --text: #e8edf9;
  --muted: #8f9bb8;
  --primary: #7fd8ff;
  --primary-ink: #00293a;
  --aurora: #a78bfa;
  --teal: #5eead4;
  --ember: #ff9f5a;
  --rose: #ff6b9d;
  --lime: #b5f36b;
  --error: #ff6b6b;
  --radius: 22px;
  --aurora-brush: linear-gradient(135deg, #1b3a6b 0%, #3b2b7a 55%, #0e4c55 100%);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.gap4 { gap: 4px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji { font-size: 26px; line-height: 1; }
.big-emoji { font-size: 44px; line-height: 1; }
.teal { color: var(--teal); } .rose { color: var(--rose); } .ember { color: var(--ember); } .primary { color: var(--primary); } .aurora { color: var(--aurora); }

#app { min-height: 100vh; min-height: 100dvh; }
.screen { padding: calc(var(--safe-top) + 10px) 16px calc(96px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }
.screen.no-tabs { padding-bottom: calc(32px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; gap: 6px; min-height: 48px; margin: 0 -8px 6px; }
.topbar h2 { flex: 1; font-size: 20px; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--text); min-width: 40px; min-height: 40px; }
.icon-btn:active { background: var(--surface-2); }

.section-title { display: flex; align-items: center; margin: 22px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.section-title > span { flex: 1; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.card + .card, .list > * + * { margin-top: 8px; }
.card.tap:active, .tap:active { filter: brightness(1.15); }
.card.hero { background: var(--aurora-brush); position: relative; overflow: hidden; color: #fff; padding: 20px; }
.card.hero .muted { color: rgba(255, 255, 255, 0.78); }
.card.flat { background: var(--surface-2); }
.done-bg { background: rgba(94, 234, 212, 0.12) !important; }
.warn-bg { background: rgba(255, 159, 90, 0.10) !important; }

.btn { border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 700; background: var(--primary); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; }
.btn.block { width: 100%; }
.btn.tonal { background: var(--surface-3); color: var(--text); }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.text { background: transparent; color: var(--primary); padding: 8px 10px; min-height: 36px; }
.btn.danger { background: transparent; color: var(--rose); }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: 14px; }
.btn:disabled { opacity: 0.45; }

.chip { border: 0; border-radius: 12px; padding: 8px 12px; background: var(--surface-2); color: var(--text); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.chip.on { background: #273a6b; box-shadow: inset 0 0 0 1.5px var(--primary); }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }

input.field, textarea.field, select.field {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; font-size: 16px;
}
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--primary); }
textarea.field { min-height: 90px; resize: vertical; }
label.lbl { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.08em; }

/* Ziele */
.goal { display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; padding: 12px 14px; margin: 8px 0; transition: background .2s; }
.goal .icon { width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; font-size: 22px; flex: none; }
.check { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; transition: all .15s; }
.check.on { background: var(--teal); border-color: var(--teal); color: #00332d; font-weight: 900; }
.meter { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.streak { color: var(--ember); font-weight: 700; }

/* Ring */
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }

/* Tab-Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(15, 22, 41, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 6px 4px calc(6px + var(--safe-bottom));
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; position: relative; }
.tabbar a .ic { font-size: 22px; line-height: 28px; width: 56px; text-align: center; border-radius: 16px; filter: grayscale(1) opacity(0.75); }
.tabbar a.on { color: var(--text); }
.tabbar a.on .ic { background: #24335c; filter: none; }
.badge { position: absolute; top: 0; right: calc(50% - 26px); background: var(--rose); color: #fff; border-radius: 99px; font-size: 10px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }

/* Sheet / Dialog */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + var(--safe-bottom)); animation: up .2s ease-out; }
.sheet::before { content: ''; display: block; width: 40px; height: 5px; background: var(--line); border-radius: 9px; margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-bottom)); z-index: 60; background: #263357; color: var(--text); padding: 12px 18px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); font-size: 14px; animation: fade .2s; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--surface); border-radius: 18px; padding: 12px; min-width: 0; }
.tile .k { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.tile .v { font-size: 20px; font-weight: 700; margin-top: 4px; }

.avatar { border-radius: 50%; display: grid; place-items: center; flex: none; }
.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.heat > div { aspect-ratio: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.mood-btn { flex: 1; background: none; border: 0; border-radius: 14px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.mood-btn .e { font-size: 30px; }
.mood-btn.on { background: #24335c; color: var(--text); }
.rating { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rating button { aspect-ratio: 1; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.07); font-size: 13px; font-weight: 700; padding: 0; }
.rating button.on { background: var(--teal); color: #00332d; }
.photo { width: 100%; border-radius: 16px; display: block; object-fit: cover; background: rgba(255, 255, 255, 0.05); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.list-row + .list-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 4px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--surface-3); color: var(--text); }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-grid button { background: none; border: 0; font-size: 24px; padding: 6px; border-radius: 10px; }
.emoji-grid button.on { background: #24335c; }
.snow { position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 20%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 85% 65%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 10% 70%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 55% 50%, #fff 50%, transparent 51%); }
.banner { border-radius: 18px; padding: 12px 14px; background: rgba(255, 159, 90, 0.12); color: var(--ember); font-size: 14px; }
.banner.info { background: rgba(127, 216, 255, 0.10); color: var(--primary); }
.vision-grid { columns: 2; column-gap: 10px; }
.vision-grid > * { break-inside: avoid; margin-bottom: 10px; }
.vtile { border-radius: 20px; padding: 16px; color: #fff; overflow: hidden; position: relative; }
.vtile.wide { column-span: all; }
.vtile img { width: 100%; display: block; border-radius: 14px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; word-break: break-all; user-select: all; -webkit-user-select: all; }
ol.steps { padding-left: 20px; margin: 8px 0; } ol.steps li { margin: 6px 0; }
.set-row { display: grid; grid-template-columns: 28px 1fr 1fr 44px; gap: 8px; align-items: center; margin: 6px 0; }
.set-row input { text-align: center; padding: 10px 6px; }
