/* Papier & Planer: Creme, Mint, Serifenüberschriften. Immer hell. */
:root { color-scheme: light; --bg:#f7f1e6; --karte:#fffdf8; --text:#2b2a26; --leise:#8a8575; --akzent:#2f9e83; --akzent-d:#1f6e5b; --weich:#dcefe7; --rand:#e6dcc8; --fehler:#c0462f; --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif; --nav:62px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, "SF Pro Text", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
.seite { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px calc(var(--nav) + env(safe-area-inset-bottom) + 28px); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
.kopf { margin: 6px 2px 4px; } .kopf h1 { font-size: 2.1rem; letter-spacing: -.01em; } .klein { font-size: .8rem; margin: 0; text-transform: uppercase; letter-spacing: .12em; color: var(--akzent-d); }
h2 { margin: 26px 2px 8px; font-size: .78rem; font-family: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--leise); }
a { color: var(--akzent-d); }
.leise { color: var(--leise); } .fehler { color: var(--fehler); }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; box-shadow: 0 1px 0 #fff inset, 0 6px 18px -12px rgba(80,60,20,.35); overflow: hidden; }
.zeile { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--rand); }
.zeile:last-child { border-bottom: 0; } .zeile form { margin: 0; } .zeile .text { flex: 1; min-width: 0; } .zeile small { display: block; font-size: .8rem; }
.zeile.termin { border-left: 5px solid var(--c, var(--akzent)); padding-left: 10px; }
.punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
button, input, select { font: inherit; color: inherit; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rand); border-radius: 12px; background: var(--karte); }
button { cursor: pointer; background: var(--akzent); color: #fff; border-color: var(--akzent); font-weight: 600; }
button:active { background: var(--akzent-d); }
button.haken { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; border: 2px solid var(--akzent); flex: none; }
button.haken:active { background: var(--weich); }
button.weg { background: transparent; color: var(--leise); border-color: transparent; min-width: 40px; padding: 0 6px; opacity: .55; font-weight: 400; }
.neu { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; } .neu input[name=titel], .neu input[name=name], .neu input[name=url] { flex: 1 1 100%; }
.neu input[type=date], .neu input[type=time] { flex: 1; min-width: 0; } .farbwahl { padding: 2px; width: 54px; }
.knopf { display: inline-block; padding: 10px 16px; border: 1px solid var(--rand); border-radius: 12px; background: var(--karte); text-decoration: none; }
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); background: rgba(247,241,230,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--rand); }
.leiste a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--leise); text-decoration: none; font-size: .7rem; font-weight: 600; }
.leiste svg { width: 24px; height: 24px; } .leiste a.an { color: var(--akzent-d); background: var(--weich); }
.login { text-align: center; padding-top: 12vh; } .login h1 { font-size: 2rem; margin: 14px 0 20px; } .login img { border-radius: 18px; } .login input { width: 100%; margin-bottom: 10px; text-align: center; } .login button.gross { width: 100%; min-height: 48px; }

/* Kalender */
body.vollbild .seite { max-width: 1100px; height: 100dvh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 8px) 8px calc(var(--nav) + env(safe-area-inset-bottom)); }
#kal { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.kk { padding: 0 4px 6px; } .kk-zeile { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .kk h1 { flex: 1; text-align: center; font-size: 1.35rem; }
.rund { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; background: var(--karte); color: var(--akzent-d); border-color: var(--rand); }
.seg { display: flex; flex: 1; background: #ece3d0; border-radius: 12px; padding: 3px; } .seg button { flex: 1; min-height: 34px; padding: 0; background: transparent; color: var(--leise); border: 0; border-radius: 9px; }
.seg button.an { background: var(--karte); color: var(--akzent-d); box-shadow: 0 1px 3px rgba(80,60,20,.2); }
.heute-knopf { min-height: 40px; background: var(--karte); color: var(--akzent-d); border-color: var(--rand); }
.pillen { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; } .pillen button { min-height: 30px; padding: 2px 10px; font-size: .8rem; background: var(--karte); color: var(--text); border-color: var(--c); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pillen button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); } .pillen button.aus { opacity: .45; text-decoration: line-through; }
.ansicht { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; overflow: hidden; }
.plus { position: absolute; right: 14px; bottom: 14px; width: 56px; height: 56px; padding: 0; border-radius: 50%; font-size: 2rem; line-height: 1; box-shadow: 0 8px 20px -6px rgba(31,110,91,.6); z-index: 5; }
/* Monat */
.m-kopf, .m-gitter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.m-kopf div { text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--leise); padding: 7px 0; border-bottom: 1px solid var(--rand); }
.m-gitter { flex: 1; grid-auto-rows: minmax(0, 1fr); }
.m-tag { border-right: 1px solid var(--rand); border-bottom: 1px solid var(--rand); padding: 3px 2px; overflow: hidden; cursor: pointer; min-width: 0; }
.m-tag:nth-child(7n) { border-right: 0; } .m-tag.fremd { background: #faf6ec; } .m-tag.fremd .n { color: #bdb6a3; }
.m-tag .n { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-size: .8rem; font-weight: 600; margin: 0 0 1px 1px; }
.m-tag.heute .n { background: var(--akzent); color: #fff; }
.chip { display: block; font-size: .68rem; line-height: 1.25; margin: 1px 1px 2px; padding: 1px 4px; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, var(--karte)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chip.voll { background: var(--c); color: #fff; border-left-color: transparent; } .mehr { font-size: .65rem; color: var(--leise); padding-left: 5px; }
/* Woche/Tag */
.w { display: flex; flex-direction: column; flex: 1; min-height: 0; --hh: 52px; }
.w-kopf, .w-ganz, .w-gitter { display: grid; grid-template-columns: 38px repeat(var(--n), minmax(0, 1fr)); }
.w-kopf div { text-align: center; padding: 6px 0 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); border-left: 1px solid var(--rand); cursor: pointer; }
.w-kopf div:first-child { border: 0; } .w-kopf b { display: flex; margin: 2px auto 0; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; font: 600 1.05rem var(--serif); color: var(--text); letter-spacing: 0; }
.w-kopf .heute b { background: var(--akzent); color: #fff; }
.w-ganz { border-bottom: 1px solid var(--rand); } .w-ganz > div { border-left: 1px solid var(--rand); padding: 2px 1px; min-height: 8px; } .w-ganz > div:first-child { border: 0; }
.w-body { flex: 1; overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; }
.w-gitter { height: calc(24 * var(--hh)); }
.stunden { position: relative; } .stunden span { position: absolute; right: 4px; font-size: .65rem; color: var(--leise); transform: translateY(-50%); }
.spalte { position: relative; border-left: 1px solid var(--rand); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hh) - 1px), var(--rand) calc(var(--hh) - 1px), var(--rand) var(--hh)); }
.ev { position: absolute; border-radius: 7px; padding: 2px 5px; font-size: .72rem; line-height: 1.25; overflow: hidden; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 20%, var(--karte)); cursor: pointer; box-shadow: 0 0 0 1px var(--karte); }
.ev b { display: block; font-weight: 600; } .ev small { opacity: .75; }
.jetzt { position: absolute; left: 0; right: 0; height: 2px; background: #d9534f; z-index: 3; pointer-events: none; } .jetzt::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d9534f; }
.leer { padding: 24px; text-align: center; color: var(--leise); }
/* Dialog */
dialog { border: 0; border-radius: 20px; padding: 18px; width: min(440px, calc(100vw - 24px)); background: var(--karte); color: var(--text); box-shadow: 0 30px 60px -20px rgba(40,30,10,.5); }
dialog::backdrop { background: rgba(43,42,38,.4); } dialog h3 { font-size: 1.3rem; margin-bottom: 10px; } dialog input, dialog select { width: 100%; margin-bottom: 8px; }
.paar { display: flex; gap: 8px; } .paar label { flex: 1; font-size: .72rem; color: var(--leise); text-transform: uppercase; letter-spacing: .08em; } .paar .zeitfeld { flex: 0 0 38%; }
.schalter { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .schalter input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--akzent); }
.knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; } .leise-knopf { background: transparent; color: var(--leise); border-color: transparent; font-weight: 500; }
#dlg-weg { margin-right: auto; color: var(--fehler); }
.ro p { margin: 4px 0; }
