:root {
    --ak: #C8913A; --grund: #F2F2F7; --karte: #fff; --ink: #000; --grau: #8E8E93; --linie: #E5E5EA; --ink2: #3C3C43;
    --zettel: #F9E27D; --zettel-ink: #3B3005; --zettel-meta: #7A6520;
    --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--grund); }
body { font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; }
svg { display: block; flex: none; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--grund); }
#seite { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }
#leiste { display: flex; justify-content: space-around; padding: 7px 0 calc(4px + var(--unten)); background: #F9F9F9EE; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: .5px solid #0002; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--grau); min-width: 60px; }
.tab.an { color: var(--ak); }

/* Kopf der Seiten */
.kopf { padding: calc(var(--oben) + 8px) 16px 0; }
.nav { display: flex; justify-content: space-between; align-items: center; color: var(--ak); font-size: 17px; min-height: 32px; }
.nav .r { display: flex; gap: 20px; align-items: center; }
.nav button { color: var(--ak); display: flex; align-items: center; gap: 2px; }
h1 { font-size: 34px; font-weight: 700; margin: 2px 0 10px; letter-spacing: .2px; }
.seg { background: #E3E3E8; border-radius: 9px; padding: 2px; display: flex; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.seg button { flex: 1; text-align: center; padding: 6px 0; border-radius: 7px; }
.seg button.an { background: #fff; box-shadow: 0 1px 3px #0002; }
.sek { font-size: 13px; color: var(--grau); margin: 18px 32px 6px; display: flex; justify-content: space-between; align-items: baseline; }
.sek.heute { color: var(--ak); font-weight: 600; }
.karte { background: var(--karte); border-radius: 12px; margin: 0 16px; overflow: hidden; }
.leer { color: var(--grau); text-align: center; padding: 40px 20px; font-size: 15px; }

/* Listenzeilen */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 52px; width: 100%; text-align: left; }
.row + .row { border-top: .5px solid var(--linie); }
.zeit { width: 44px; font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; flex: none; }
.tx { flex: 1; min-width: 0; }
.ti { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un { font-size: 13px; color: var(--grau); margin-top: 1px; }
.gold .ti { color: var(--ak); }
.vorbei .ti, .vorbei .zeit { color: #AEAEB2; text-decoration: line-through; }
.wer { display: flex; flex: none; }
.wer i, .av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.wer i { border: 2px solid #fff; margin-left: -8px; }
.av.gross { width: 44px; height: 44px; }

/* Monat */
.wt { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; font-weight: 600; color: var(--grau); text-align: center; padding: 10px 6px 2px; }
.raster { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 6px 8px; }
.t { height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.t span { width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 50%; font-size: 17px; }
.t.fremd span { color: #C7C7CC; }
.t.heute span { color: var(--ak); font-weight: 600; }
.t.gew span { background: #000; color: #fff; font-weight: 600; }
.t.fei span { color: var(--ak); }
.pk { display: flex; gap: 2px; height: 5px; margin-top: 1px; }
.pk i { width: 5px; height: 5px; border-radius: 50%; }

/* Start: Himmel */
.himmel { position: relative; padding: calc(var(--oben) + 18px) 22px 34px; color: #fff; overflow: hidden; min-height: 250px; }
.himmel > * { position: relative; }
.himmel .deko { position: absolute; inset: 0; pointer-events: none; }
.h-regen, .h-gewitter { background: linear-gradient(180deg, #4B5B78 0%, #6C7E9C 70%, var(--grund) 100%); }
.h-schnee { background: linear-gradient(180deg, #7D8CA3 0%, #A9B6C8 70%, var(--grund) 100%); }
.h-wolke, .h-nebel { background: linear-gradient(180deg, #6E8197 0%, #94A6BA 70%, var(--grund) 100%); }
.h-sonne { background: linear-gradient(180deg, #3D8BD8 0%, #7DB6EA 70%, var(--grund) 100%); }
.h-nacht { background: linear-gradient(180deg, #121C38 0%, #2D3E66 70%, var(--grund) 100%); }
.deko i.tropfen { position: absolute; top: -20px; width: 1.5px; height: 16px; background: linear-gradient(#fff0, #fffc); border-radius: 1px; animation: regen linear infinite; }
@keyframes regen { to { transform: translateY(330px) translateX(-18px); } }
.deko i.flocke { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .85; animation: schnee linear infinite; }
@keyframes schnee { to { transform: translateY(330px) translateX(20px); } }
.deko i.stern { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: funkeln 3s ease-in-out infinite; }
@keyframes funkeln { 50% { opacity: .2; } }
.deko .blitz { position: absolute; inset: 0; background: #fff; opacity: 0; animation: blitz 6s infinite; }
@keyframes blitz { 0%, 92%, 100% { opacity: 0; } 93% { opacity: .35; } 95% { opacity: 0; } 96% { opacity: .25; } }
.wxsym { position: absolute !important; right: 22px; top: calc(var(--oben) + 96px); }
.wxsym.schweb { animation: schweb 5s ease-in-out infinite; }
@keyframes schweb { 50% { transform: translateY(-6px); } }
.wxsym.dreh { animation: dreh 24s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.wxsym.zieh { animation: zieh 7s ease-in-out infinite; }
@keyframes zieh { 50% { transform: translateX(-10px); } }
.gruss .g1 { font-size: 15px; opacity: .85; }
.gruss .g2 { font-size: 31px; font-weight: 700; margin-top: 2px; }
.temp { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.temp b { font-size: 58px; font-weight: 200; line-height: 1; }
.temp span { font-size: 15px; opacity: .9; padding-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip2 { display: inline-flex; align-items: center; gap: 5px; background: #ffffff2e; border-radius: 14px; padding: 5px 10px; font-size: 12.5px; }

.hinweis { position: relative; z-index: 1; margin-top: -18px !important; box-shadow: 0 6px 18px #0000000f; }
.zeile-k { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; }
.zeile-k .un { font-size: 12.5px; }
.banner { margin: 10px 16px 0; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: #fff; background: linear-gradient(120deg, #C8913A, #E2B25E); font-size: 15px; }
.banner .un { color: #fffe; }
.tagwahl { display: flex; align-items: center; gap: 4px; text-transform: none; color: var(--ak); }
.tagwahl button { color: var(--ak); padding: 2px 4px; display: flex; }
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px; }
.k { background: #fff; border-radius: 14px; padding: 10px 12px; min-height: 108px; display: flex; flex-direction: column; text-align: left; }
.kk { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kk .av { width: 30px; height: 30px; }
.kn { font-size: 16px; font-weight: 600; }
.kt { font-size: 13.5px; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.kt .kz { color: var(--grau); font-variant-numeric: tabular-nums; }
.kt.vorbei { color: #AEAEB2; text-decoration: line-through; }
.ks { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--grau); font-style: italic; }
.morgen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; font-size: 14px; }
.morgen .ml { font-size: 11px; letter-spacing: 1.5px; color: var(--ak); font-weight: 600; }
.morgen .dot { color: #C7C7CC; }

/* Zettel */
.zettel { position: relative; background: linear-gradient(170deg, #FBE88F, #F2D561); background-color: var(--zettel); color: var(--zettel-ink); border-radius: 12px; padding: 26px 12px 10px; display: flex; flex-direction: column; box-shadow: 3px 6px 14px #0000002e; text-align: left; width: 100%; }
.zettel .nadel { position: absolute; left: 50%; top: 9px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 1.5px solid #0003; }
.zettel .zk { flex: 1; display: flex; gap: 8px; align-items: flex-start; }
.zettel .zt { flex: 1; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.zettel.kurz .zk { align-items: center; }
.zettel.kurz .zt { font-size: 19px; }
.zic { width: 34px; height: 34px; border-radius: 50%; background: #FFF8DC; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 0 0 1px #3B300522; }
.zettel.kurz .zic { width: 40px; height: 40px; }
.wackel { animation: wackel 3s ease-in-out infinite; }
@keyframes wackel { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
.zf { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--zettel-meta); margin-top: 6px; }
.zf .pf { opacity: .6; }
.zf .zu { flex: 1; margin-left: 3px; }
.schild { background: #3B300518; color: var(--zettel-ink); border-radius: 8px; padding: 2px 7px; font-size: 11px; font-weight: 500; }
.stapel { position: relative; margin: 4px 16px 0; height: 150px; display: block; width: calc(100% - 32px); }
.stapel .zettel, .stapel .unter { position: absolute; left: 0; right: 0; top: 0; height: 122px; }
.stapel .zettel { transform: rotate(-1.5deg); }
.unter { border-radius: 12px; }
.u1 { background: #E8CF66; transform: rotate(2.5deg) translateX(6px); }
.u2 { background: #D9BF55; transform: rotate(-3.5deg) translateX(-4px); }
.stapel .anz { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--grau); }
.pinnwand { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; padding: 8px 16px; }
.pinnwand .zettel { height: 156px; }
.pinnwand .zettel:nth-child(3n+1) { transform: rotate(-1.5deg); }
.pinnwand .zettel:nth-child(3n+2) { transform: rotate(1.2deg); }
.pinnwand .zettel:nth-child(3n) { transform: rotate(-.6deg); }

/* Overlay, Blätter-Popup und Formulare */
#schicht { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.dunkel { position: absolute; inset: 0; background: #000a; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; pointer-events: auto; }
.dunkel.an { opacity: 1; }
.blaettern { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); pointer-events: auto; }
.blaettern .bahn { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px 0; scrollbar-width: none; }
.blaettern .bahn::-webkit-scrollbar { display: none; }
.blaettern .seite { flex: none; width: 100%; scroll-snap-align: center; display: flex; justify-content: center; }
.blaettern .zettel { width: min(80vw, 420px); height: min(62vw, 300px); padding: 36px 20px 16px; transform: rotate(-1deg); }
.blaettern .zettel .zt { font-size: 22px; -webkit-line-clamp: 6; }
.blaettern .zettel.kurz .zt { font-size: 30px; }
.blaettern .zettel .zic { width: 52px; height: 52px; }
.blaettern .zettel .nadel { top: 14px; width: 16px; height: 16px; margin-left: -8px; }
.blaettern .info { text-align: center; color: #fffc; font-size: 13px; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: calc(100% - var(--oben) - 20px); background: var(--grund); border-radius: 14px 14px 0 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); pointer-events: auto; display: flex; flex-direction: column; }
.sheet.an { transform: none; }
.sheet .skopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; font-size: 17px; }
.sheet .skopf b { font-weight: 600; }
.sheet .skopf button { color: var(--ak); }
.sheet .skopf button.fett { font-weight: 600; }
.sheet .skopf button:disabled { color: #C7C7CC; }
.sheet .sinhalt { overflow-y: auto; padding: 0 0 calc(20px + var(--unten)); }
.sheet.zettelform { background: var(--zettel); }
.feld { width: 100%; border: 0; background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 17px; outline: none; }
textarea.feld { resize: none; min-height: 96px; line-height: 1.35; }
.zettelform .feld { background: #FFF8DC; color: var(--zettel-ink); }
.flabel { font-size: 13px; color: var(--grau); margin: 16px 16px 6px; }
.zettelform .flabel { color: var(--zettel-meta); }
.fblock { margin: 0 16px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--ink2); width: 58px; }
.badge .av { width: 48px; height: 48px; border: 2px solid transparent; transition: transform .15s; }
.badge.an .av { border-color: currentColor; }
.badge:active .av { transform: scale(.92); }
.pillen { display: flex; gap: 8px; flex-wrap: wrap; }
.pille { background: #fff; border-radius: 16px; padding: 7px 14px; font-size: 15px; }
.pille.an { background: var(--ink); color: #fff; }
.zettelform .pille { background: #FFF8DC; color: var(--zettel-ink); }
.zettelform .pille.an { background: var(--zettel-ink); color: var(--zettel); }
.loeschen { display: block; margin: 26px auto 0; color: #D3473B; font-size: 17px; }
.mkal { background: #fff; border-radius: 12px; padding: 6px 4px 8px; }
.mkal .mk-kopf { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px 2px; font-weight: 600; }
.mkal .mk-kopf button { color: var(--ak); padding: 4px; }
.mkal .t { height: 40px; }
.mkal .t span { width: 34px; height: 34px; line-height: 34px; font-size: 16px; }
.mkal .t.bereich span { background: #0000000f; border-radius: 0; width: 100%; }
.mkal .t.wahl span { background: var(--ink); color: #fff; border-radius: 50%; width: 34px; }
.mkal .t.vor span { color: #C7C7CC; }
.zettelform .mkal { background: #FFF8DC; }

/* Walzen für die Uhrzeit (wie am Echo) */
.walzen { position: relative; display: flex; justify-content: center; gap: 4px; background: #fff; border-radius: 12px; height: 180px; overflow: hidden; }
.walzen::before { content: ''; position: absolute; left: 10px; right: 10px; top: 70px; height: 40px; border-radius: 9px; background: #7676801f; pointer-events: none; }
.walzen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#fff 0%, #fff0 35%, #fff0 65%, #fff 100%); }
.walze { height: 180px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 70px 0; width: 110px; text-align: center; }
.walze::-webkit-scrollbar { display: none; }
.walze div { height: 40px; line-height: 40px; font-size: 21px; scroll-snap-align: center; font-variant-numeric: tabular-nums; }
.walze.std { width: 130px; }
.walzen .dp { line-height: 180px; font-size: 21px; font-weight: 600; }

.einst .row { cursor: pointer; }
.einst select { font: inherit; font-size: 17px; border: 0; background: none; color: var(--grau); text-align: right; }
.hinweistext { font-size: 13px; color: var(--grau); margin: 8px 32px 0; line-height: 1.4; }
.symbolwahl { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.symbolwahl button { height: 46px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.symbolwahl button.an { border-color: var(--ink); }
.farbwahl { display: flex; gap: 10px; flex-wrap: wrap; }
.farbwahl button { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mwahl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.twahl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mwahl button, .twahl button { background: #fff; border-radius: 9px; padding: 8px 0; font-size: 15px; }
.mwahl button.an, .twahl button.an { background: var(--ink); color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--unten)); transform: translateX(-50%); background: #000d; color: #fff; padding: 9px 16px; border-radius: 18px; font-size: 14px; z-index: 20; animation: toast 2.2s forwards; }
@keyframes toast { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
.einst select { flex: none; max-width: 55%; }
.einst label .ti { white-space: normal; }
