/* Familienkalender – Wandoberfläche
   Ziel: iPad Air 1 / Safari 12, 1024×768 quer.
   Bewusst ohne flex-"gap", "inset" o. ä. (erst ab Safari 14). Abstände über margin. */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1b1b1b; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #2d2a26; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}
input, select, button, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
/* iOS-Safari schickt "click" an divs nur, wenn sie als klickbar gelten (cursor: pointer) */
[data-a], #modal { cursor: pointer; }

#app {
  position: absolute; left: 0; top: 0; width: 1024px; height: 768px; overflow: hidden;
  background: #fbf7f0; -webkit-transform-origin: 0 0; transform-origin: 0 0;
}
#view { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }

.row { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.col-flex { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }
.grow { -webkit-flex: 1; flex: 1; min-width: 0; min-height: 0; }
.ml-auto { margin-left: auto !important; }
.muted { color: #8a8174; }

/* ---------- Kopfzeile ---------- */
.top { height: 92px; padding: 0 22px; background: #fff; border-bottom: 1px solid #eee3d2; -webkit-flex-shrink: 0; flex-shrink: 0; }
.top > * + * { margin-left: 16px; }
.clock { font-size: 56px; font-weight: 300; letter-spacing: -1px; white-space: nowrap; }
.date { font-size: 22px; line-height: 1.2; white-space: nowrap; }
.date small { display: block; font-size: 15px; color: #8a8174; }
.weather { white-space: nowrap; font-size: 18px; }
.weather .ico { font-size: 44px; margin-right: 8px; }
.weather small { display: block; color: #8a8174; font-size: 13px; }
.homebtn, .iconbtn {
  width: 62px; height: 62px; border-radius: 18px; background: #f3ece0; border: 0; font-size: 30px; -webkit-flex-shrink: 0; flex-shrink: 0;
}
.navbtn { width: 54px; height: 54px; border-radius: 14px; border: 0; background: #f3ece0; font-size: 30px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.navbtn.txt { width: auto; padding: 0 14px; font-size: 16px; font-weight: 700; }
.lockstate { font-size: 14px; color: #8a8174; white-space: nowrap; }
.lockstate.open { color: #2e9e57; font-weight: 700; }

.avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--l); border: 4px solid var(--c);
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  font-size: 34px; -webkit-flex-shrink: 0; flex-shrink: 0;
}
.avatar.s { width: 38px; height: 38px; font-size: 20px; border-width: 3px; }
.avatar.l { width: 84px; height: 84px; font-size: 46px; }
.avatar.xl { width: 110px; height: 110px; font-size: 60px; }

/* ---------- Vorfreude-Hinweis ---------- */
.vf-pill { background: #fff4d6; border: 2px solid #f2c45a; border-radius: 20px; padding: 6px 16px; max-width: 430px; min-width: 0; -webkit-flex-shrink: 1; flex-shrink: 1; }
.vf-pill .e { font-size: 42px; margin-right: 10px; }
.vf-pill b { font-size: 34px; color: #b5700a; margin-right: 10px; }
.vf-pill span { font-size: 16px; line-height: 1.2; font-weight: 600; overflow: hidden; }
.vf-pill small { display: block; color: #8a8174; font-size: 13px; font-weight: 400; white-space: nowrap; }

/* ---------- Ruhebildschirm ---------- */
.famstrip { margin: 10px 14px 0; background: #fff; border-radius: 14px; padding: 8px 14px; font-size: 16px; border-left: 8px solid #6b6258; }
.famstrip b { margin-right: 10px; }
.famstrip .fe { margin-right: 18px; white-space: nowrap; }
.cols { padding: 10px 14px 8px; }
.cols > .pcol + .pcol { margin-left: 10px; }
.pcol {
  -webkit-flex: 1; flex: 1; min-width: 0; background: #fff; border-radius: 18px; padding: 10px 8px;
  border-top: 8px solid var(--c); box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; position: relative;
}
.pcol.animals { -webkit-flex: 1.25; flex: 1.25; background: #fffdf7; }
.pcol .who { text-align: center; margin-bottom: 8px; }
.pcol .who .avatar { margin: 0 auto 4px; }
.pcol .who span { font-weight: 700; font-size: 17px; color: var(--c); }
.ev { background: var(--l); border-radius: 12px; padding: 7px 8px; font-size: 14px; line-height: 1.25; margin-bottom: 7px; display: -webkit-flex; display: flex; -webkit-align-items: flex-start; align-items: flex-start; }
.ev .e { font-size: 24px; line-height: 1; margin-right: 7px; }
.ev .t { font-size: 12px; color: #6f665a; display: block; }
.ev.kid { border: 2px dashed var(--c); padding: 5px 6px; }
.ev.warn { background: #fde3dd; }
.ev.past { opacity: .5; }
.pcol .more { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; color: #a59b8c; }
.pcol .empty { text-align: center; font-size: 13px; color: #b3a998; margin-top: 18px; }
.strip { height: 92px; padding: 0 14px 12px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.strip .wd + .wd { margin-left: 8px; }
.wd { -webkit-flex: 1; flex: 1; min-width: 0; height: 100%; background: #fff; border-radius: 14px; padding: 7px 8px; overflow: hidden; }
.wd b { font-size: 14px; display: block; }
.wd b small { font-weight: 400; color: #8a8174; }
.wd .icons { font-size: 20px; white-space: nowrap; overflow: hidden; margin: 2px 0; }
.wd .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; background: var(--c); }
.errbadge { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: #b33; background: #fff; padding: 2px 8px; border-radius: 8px; }

/* ---------- Kindergarten ---------- */
.kg-head { height: 110px; padding: 0 24px; background: var(--l); border-bottom: 6px solid var(--c); -webkit-flex-shrink: 0; flex-shrink: 0; }
.kg-head > * + * { margin-left: 20px; }
.kg-head h1 { font-size: 40px; color: var(--c); }
.kg-vf { background: #fff; border-radius: 22px; padding: 6px 18px; font-size: 48px; box-shadow: 0 2px 6px rgba(0,0,0,.08); white-space: nowrap; }
.kg-vf b { font-size: 42px; color: var(--c); margin: 0 6px; }
.kg-weather { font-size: 60px; }
.kg-body { padding: 18px 22px; }
.kg-day { -webkit-flex: 1.15; flex: 1.15; margin-right: 18px; }
.kg-slot {
  -webkit-flex: 1; flex: 1; border-radius: 26px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.07);
  padding: 0 22px; position: relative; overflow: hidden; margin-bottom: 12px;
}
.kg-slot:last-child { margin-bottom: 0; }
.kg-slot .tod { font-size: 48px; width: 64px; text-align: center; margin-right: 16px; }
.kg-slot .pic { font-size: 76px; margin-right: 14px; }
.kg-slot .pic.s { font-size: 52px; }
.kg-slot.now { box-shadow: 0 0 0 6px var(--c); }
.kg-slot .spk { position: absolute; right: 16px; top: 10px; font-size: 22px; opacity: .45; }
.kg-tasks { -webkit-flex: 1; flex: 1; }
.kg-tasks h2 { font-size: 26px; margin-bottom: 10px; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 14px; -webkit-flex: 1; flex: 1; }
.tgrid.three { grid-template-columns: 1fr 1fr 1fr; }
.task {
  border-radius: 26px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.07); position: relative;
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  font-size: 72px; -webkit-transition: -webkit-transform .15s; transition: transform .15s;
}
.task:active { -webkit-transform: scale(.95); transform: scale(.95); }
.task .chk {
  position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 4px solid #ddd;
  font-size: 26px; color: #fff; text-align: center; line-height: 36px;
}
.task.ok { background: #eaf8ee; }
.task.ok .chk { background: #2e9e57; border-color: #2e9e57; }
.stars { font-size: 38px; text-align: center; margin-top: 10px; letter-spacing: 4px; }
.foot { height: 96px; padding: 0 22px 14px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.foot > * + * { margin-left: 18px; }
.bigbtn {
  height: 76px; border-radius: 24px; border: 0; font-size: 26px; font-weight: 700; padding: 0 28px;
  background: var(--c, #2d2a26); color: #fff; white-space: nowrap;
}
.bigbtn.ghost { background: #fff; color: var(--c, #2d2a26); border: 3px solid var(--c, #2d2a26); }
.bigbtn.m { height: 56px; font-size: 19px; border-radius: 18px; padding: 0 20px; }
.bigbtn:disabled { opacity: .4; }

/* ---------- Grundschule ---------- */
.gs-body { padding: 16px 20px; }
.gs-col { -webkit-flex: 1; flex: 1; background: #fff; border-radius: 22px; padding: 16px; overflow: hidden; }
.gs-col + .gs-col { margin-left: 16px; }
.gs-col h2 { font-size: 26px; margin-bottom: 10px; }
.gs-col h2 small { font-size: 16px; color: #8a8174; font-weight: 400; }
.gs-ev { padding: 9px 14px; border-radius: 16px; background: var(--l); font-size: 23px; font-weight: 600; margin-bottom: 9px; }
.gs-ev .e { font-size: 38px; margin-right: 14px; }
.gs-ev .t { font-size: 17px; font-weight: 400; color: #6f665a; display: block; }
.gs-ev.fam { background: #f3ece0; }
.gs-task { padding: 9px 14px; border-radius: 16px; background: #f7f3ec; font-size: 23px; margin-bottom: 9px; }
.gs-task .e { font-size: 36px; margin-right: 14px; }
.gs-task .chk { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 4px solid #d5cdbf; color: #fff; font-size: 22px; text-align: center; line-height: 32px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.gs-task.ok { background: #eaf8ee; }
.gs-task.ok .chk { background: #2e9e57; border-color: #2e9e57; }
.gs-task.ok .n { text-decoration: line-through; color: #6f9a7c; }
.progress { height: 22px; background: #eee6d8; border-radius: 11px; overflow: hidden; margin-top: 6px; }
.progress div { height: 100%; background: #ee8a12; background: -webkit-linear-gradient(left, #f6c343, #ee8a12); background: linear-gradient(90deg, #f6c343, #ee8a12); border-radius: 11px; }

/* ---------- Woche ---------- */
.wk { padding: 10px 14px 12px; }
.wk-head, .wk-row { display: -webkit-flex; display: flex; }
.wk.slide-l { -webkit-animation: slideL .25s ease-out; animation: slideL .25s ease-out; }
.wk.slide-r { -webkit-animation: slideR .25s ease-out; animation: slideR .25s ease-out; }
@-webkit-keyframes slideL { from { opacity: .3; -webkit-transform: translateX(60px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes slideL { from { opacity: .3; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@-webkit-keyframes slideR { from { opacity: .3; -webkit-transform: translateX(-60px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes slideR { from { opacity: .3; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
.wk-head { margin-bottom: 6px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.wk-head > div, .wk-row > div { margin-left: 6px; }
.wk-head > div:first-child, .wk-row > div:first-child { margin-left: 0; }
.wk-head .d { -webkit-flex: 1; flex: 1; min-width: 0; text-align: center; font-size: 14px; font-weight: 700; padding: 6px 0; border-radius: 10px; background: #fff; }
.wk-head .d.today { background: #2d2a26; color: #fff; }
.wk-head .d .vfh { display: block; font-size: 11px; font-weight: 600; color: #b5700a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.wk-head .d.today .vfh { color: #f6c343; }
.wk-head .lab, .wk-row .lab { -webkit-flex: 0 0 96px; flex: 0 0 96px; }
.wk-row { -webkit-flex: 1; flex: 1; margin-bottom: 6px; min-height: 0; }
.wk-row:last-child { margin-bottom: 0; }
.wk-row .lab { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; font-size: 14px; font-weight: 700; color: var(--c); }
.wk-row .lab .avatar { margin-right: 8px; }
.cell { -webkit-flex: 1; flex: 1; min-width: 0; background: #fff; border-radius: 10px; padding: 4px; overflow: hidden; }
.cell.today { box-shadow: inset 0 0 0 2px #2d2a26; }
.past { opacity: .55; }
.chip {
  display: block; background: var(--l); border-left: 4px solid var(--c); border-radius: 5px; font-size: 11px; padding: 2px 5px; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.ro { border-left-style: dotted; }
.chip.warn { background: #fde3dd; }
.chip.vf { background: #fff4d6; border-left-color: #f2c45a; font-weight: 700; }
.chip.del { box-shadow: inset 0 0 0 1px #d9487f; }

/* ---------- Assistent ---------- */
.wz-steps { padding: 14px 22px 0; -webkit-flex-shrink: 0; flex-shrink: 0; }
.wz-steps div { -webkit-flex: 1; flex: 1; text-align: center; padding: 10px; border-radius: 16px; background: #fff; font-size: 22px; font-weight: 700; color: #b3a998; }
.wz-steps div + div { margin-left: 10px; }
.wz-steps div.on { background: #2d2a26; color: #fff; }
.wz-steps div.ok { color: #2e9e57; }
.wz-body { padding: 16px 22px; }
.pgrid { display: grid; grid-gap: 14px; height: 100%; }
.pgrid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.pgrid.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.pick {
  background: #fff; border-radius: 24px; box-shadow: 0 2px 6px rgba(0,0,0,.07); border: 5px solid transparent;
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  font-size: 60px; text-align: center;
}
.pick span { font-size: 20px; font-weight: 600; margin-top: 4px; }
.pick small { font-size: 14px; color: #8a8174; }
.pick.sel { border-color: #2d2a26; }
.wz-done { text-align: center; }
.wz-done .big { font-size: 120px; }
.wz-done .card { display: inline-block; background: #fff; border-radius: 28px; padding: 22px 40px; font-size: 40px; font-weight: 700; margin: 10px 0 18px; }

/* ---------- Sterne ---------- */
.st-body { padding: 16px 20px; }
.st-kid { -webkit-flex: 1; flex: 1; background: #fff; border-radius: 24px; padding: 18px; min-width: 0; }
.st-kid + .st-kid { margin-left: 16px; }
.st-kid h2 { font-size: 28px; color: var(--c); margin-bottom: 12px; }
.st-kid h2 .avatar { margin-right: 14px; }
.st-week { margin-bottom: 12px; }
.st-week div { -webkit-flex: 1; flex: 1; text-align: center; background: #f7f3ec; border-radius: 12px; padding: 6px 0; font-size: 13px; }
.st-week div + div { margin-left: 6px; }
.st-week div b { display: block; font-size: 22px; }
.st-week div.today { background: var(--l); box-shadow: inset 0 0 0 2px var(--c); }
.meter { font-size: 15px; color: #6f665a; margin-bottom: 12px; }
.badges { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; grid-gap: 10px; -webkit-flex: 1; flex: 1; }
.badge { background: #fbf5e6; border-radius: 20px; text-align: center; font-size: 54px; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-justify-content: center; justify-content: center; }
.badge span { display: block; font-size: 13px; color: #6f665a; line-height: 1.2; }
.badge.locked { opacity: .3; -webkit-filter: grayscale(1); filter: grayscale(1); }

/* ---------- Einstellungen / Formulare ---------- */
.tabs { padding: 12px 20px 0; -webkit-flex-shrink: 0; flex-shrink: 0; }
.tab { padding: 10px 20px; border-radius: 14px 14px 0 0; background: #eee6d8; font-size: 18px; font-weight: 700; border: 0; margin-right: 6px; }
.tab.on { background: #fff; }
.set-body { padding: 0 20px 16px; }
.panel { background: #fff; border-radius: 0 22px 22px 22px; padding: 14px 16px; overflow: hidden; }
.panel + .panel { margin-left: 16px; border-radius: 22px; }
.panel h2 { font-size: 21px; margin-bottom: 10px; }
.list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.li { padding: 8px 12px; border-radius: 14px; background: #f7f3ec; font-size: 17px; font-weight: 600; margin-bottom: 7px; }
.li .e { font-size: 32px; margin-right: 12px; }
.li .d { font-size: 13px; color: #8a8174; display: block; font-weight: 400; }
.li .n { margin-left: auto; text-align: right; font-weight: 700; font-size: 21px; white-space: nowrap; }
.li .n small { display: block; font-size: 12px; font-weight: 400; color: #8a8174; }
.li.feat { background: #fff4d6; box-shadow: inset 0 0 0 2px #f2c45a; }
.li h3 { font-size: 16px; }
.delbtn { border: 0; background: #fde3dd; color: #b33; border-radius: 10px; width: 38px; height: 38px; font-size: 18px; margin-left: 10px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.f { margin-bottom: 9px; }
.f label { font-size: 14px; color: #6f665a; display: block; margin-bottom: 3px; }
.f input[type=text], .f input[type=date], .f input[type=time], .f input[type=number], .f select {
  font-size: 19px; padding: 8px 12px; border-radius: 12px; border: 2px solid #e6dccb; width: 100%; background: #fff; -webkit-appearance: none; height: 46px;
}
.f input.bad { border-color: #d9487f; }
.two > div { -webkit-flex: 1; flex: 1; }
.two > div + div { margin-left: 10px; }
.emo span, .opt {
  display: inline-block; font-size: 26px; width: 46px; height: 46px; line-height: 40px; text-align: center; border-radius: 12px;
  background: #f7f3ec; border: 3px solid transparent; margin: 0 5px 5px 0; vertical-align: top;
}
.opt { width: auto; padding: 0 12px; font-size: 16px; font-weight: 700; }
.emo span.sel, .opt.sel { border-color: #2d2a26; background: #fff4d6; }
.chkline { font-size: 17px; }
.chkline input { width: 24px; height: 24px; margin-right: 10px; }

/* ---------- Modal, PIN, Toast ---------- */
.modal-bg { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(30,25,20,.55); display: none; z-index: 20; }
.modal-bg.on { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; }
.box { background: #fff; border-radius: 28px; padding: 24px 30px; max-width: 700px; }
.pin { width: 380px; text-align: center; }
.pin h3 { font-size: 22px; margin-bottom: 12px; }
.pd { margin-bottom: 18px; }
.pd i { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #2d2a26; margin: 0 7px; }
.pd i.f { background: #2d2a26; }
.pd.shake { -webkit-animation: shake .4s; animation: shake .4s; }
@-webkit-keyframes shake { 25% { -webkit-transform: translateX(-10px); } 75% { -webkit-transform: translateX(10px); } }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.keys { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 10px; }
.keys button { height: 62px; border-radius: 16px; border: 0; background: #f3ece0; font-size: 26px; }
.pin p { font-size: 13px; color: #8a8174; margin-top: 12px; }
.pin .err { color: #b33; font-size: 15px; min-height: 20px; margin-top: 8px; }
.evform { width: 640px; }
.evform h3 { font-size: 24px; margin-bottom: 12px; }
.btnrow { margin-top: 14px; -webkit-justify-content: flex-end; justify-content: flex-end; }
.btnrow > * + * { margin-left: 12px; }
#toast {
  position: absolute; left: 50%; bottom: 30px; width: 600px; margin-left: -300px; text-align: center; z-index: 40;
  background: #2d2a26; color: #fff; font-size: 20px; padding: 14px 20px; border-radius: 18px; display: none;
}
#toast.on { display: block; }

/* ---------- Nacht ---------- */
#night { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #000; color: #555; z-index: 50; display: none; text-align: center; }
#night.on { display: block; }
#night .nclock { font-size: 160px; font-weight: 200; margin-top: 220px; }
#night .nhint { font-size: 24px; color: #333; }
.stretch { -webkit-align-items: stretch !important; align-items: stretch !important; }
