@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('fonts/figtree-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('fonts/figtree-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('fonts/figtree-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 700; font-display: swap; src: url('fonts/figtree-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-display: swap; src: url('fonts/fraunces-latin-600-normal.woff2') format('woff2'); }

:root, :root[data-season="fruehling"] {
  --ground: #C4DACF;
  --card: #FFFFFF;
  --ink: #2E272B;
  --main: #63585E;
  --peri: #B9C0DA;
  --mauve: #998DA0;
  --mint: #C4E7D4;
}
:root[data-season="sommer"] {
  --ground: #CFE4E6;
  --ink: #1F2D30;
  --main: #2D5B61;
  --peri: #F2D49B;
  --mauve: #C97C5B;
  --mint: #F7E3B5;
}
:root[data-season="herbst"] {
  --ground: #EAD8C3;
  --ink: #2E211B;
  --main: #6B4636;
  --peri: #E3B48C;
  --mauve: #B07B5E;
  --mint: #F0D7B8;
}
:root[data-season="winter"] {
  --ground: #D8E0EA;
  --ink: #1E2533;
  --main: #34435E;
  --peri: #BCC9DD;
  --mauve: #7F8BA5;
  --mint: #D3DEEC;
}
:root {
  --top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { transition: background-color 0.3s; background: var(--ground); color: var(--ink); font-family: 'Figtree', system-ui, sans-serif; font-size: 16px; line-height: 1.3; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }
h1, h2, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; padding-top: var(--top); max-width: 560px; margin: 0 auto; }
#screen { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 4px 16px 24px; }

.head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 24px 20px 16px; }
.head.col { flex-direction: column; align-items: stretch; gap: 16px; padding: 24px 16px 12px; }
.head.col h1 { padding: 0 4px; }
h1 { font-size: 32px; font-weight: 700; line-height: 1.1; }
h1.mtitle { font-size: 26px; align-self: center; }
.kicker { font-size: 15px; font-weight: 600; color: var(--main); margin-bottom: 2px; }
h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--main); padding: 0 4px; }
section { display: flex; flex-direction: column; gap: 8px; }
.h2row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-right: 4px; font-size: 14px; color: var(--main); }

.chip { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--peri); color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; }
.hbtns { display: flex; align-items: center; gap: 8px; }
.round { flex: none; width: 48px; height: 48px; border-radius: 24px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.round.sm { width: 44px; height: 44px; }

.card { background: var(--card); border-radius: 20px; padding: 6px 0; display: flex; flex-direction: column; }
.card.pad { padding: 16px; gap: 14px; }
.sep { height: 1px; margin: 0 16px; background: var(--ground); }
.empty { padding: 14px 16px; font-size: 15px; color: var(--main); }
.note { padding: 0 4px; font-size: 14px; line-height: 1.45; color: var(--main); }
.mini { flex: none; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 22px; background: var(--main); color: #FFFFFF; font-size: 14px; font-weight: 700; }
.h2row { align-items: center; }
.arow { padding: 0 16px 4px 0; }

.bar { height: 6px; margin: 0 4px; border-radius: 3px; background: #FFFFFF; overflow: hidden; }
.bar > div { height: 6px; border-radius: 3px; background: var(--main); transition: width 0.2s; }
.prog { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--main); }
.prog > span { padding: 0 4px; }

/* Termine */
.ev { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 12px 16px; }
.etime { flex: none; width: 52px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.etime .tend { font-weight: 400; color: var(--main); }
.etime .tall { font-size: 13px; }
.ebody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.etitle { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.emeta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--main); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot.sq { border-radius: 3px; }

/* Aufgaben */
.task { display: flex; align-items: center; }
.tmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 0 6px 16px; }
.box { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--main); display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.task.done .box { background: var(--main); }
.ttext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ttitle { overflow-wrap: anywhere; }
.task.done .ttitle { color: var(--main); text-decoration: line-through; }
.tsub { font-size: 13px; color: var(--main); }
.more { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--main); }

.add { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 8px 4px 16px; }
.add label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--main); }
.add input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; color: var(--ink); outline: none; }
.add input::placeholder { color: var(--main); opacity: 1; }
.add button { flex: none; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--main); color: #FFFFFF; font-size: 15px; font-weight: 700; }

/* Listen */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 26px; background: var(--card); }
.seg button { flex: 1; height: 44px; border-radius: 22px; font-size: 15px; font-weight: 700; text-align: center; }
.seg button[aria-pressed="true"] { background: var(--main); color: #FFFFFF; }
.period { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plabel { flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.plabel strong { font-size: 20px; }
.plabel span { font-size: 14px; color: var(--main); }

/* Kalender */
.grid { flex: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 12px; }
.grid.wd { font-size: 13px; font-weight: 700; color: var(--main); text-align: center; padding-bottom: 6px; }
.grid.days { padding-bottom: 12px; }
.day { height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 15px; font-weight: 500; }
.day .dots { display: flex; gap: 3px; height: 6px; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; }
.day.out { color: var(--main); }
.day.today { font-weight: 700; box-shadow: inset 0 0 0 2px var(--main); }
.day.sel { background: var(--main); color: #FFFFFF; font-weight: 700; box-shadow: none; }
.day.sel .dots i { box-shadow: 0 0 0 1.5px #FFFFFF; }
.agenda { flex: 1; min-height: 0; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 0 16px; }
.atitle { font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--ink); padding: 0 20px; }


/* Nextcloud */
.conn { display: flex; align-items: center; gap: 12px; }
.conn .tile { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--mint); display: flex; align-items: center; justify-content: center; }
.conn div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conn strong { font-size: 17px; }
.conn span { font-size: 14px; color: var(--main); overflow-wrap: anywhere; }
dl { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
dl > div { display: flex; justify-content: space-between; gap: 12px; }
dt { color: var(--main); }
dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.primary, .secondary, .ghost, .danger { min-height: 48px; padding: 0 20px; border-radius: 24px; font-weight: 700; text-align: center; }
.primary { background: var(--main); color: #FFFFFF; }
.secondary { background: var(--peri); }
.ghost { color: var(--ink); }
.danger { color: #8A2C2C; }
button:disabled { opacity: 0.6; }
.sw { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 16px; }
.swname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.swname small { color: var(--main); }
.track { flex: none; width: 48px; height: 28px; padding: 3px; border-radius: 14px; background: var(--mauve); display: flex; justify-content: flex-start; }
.track span { width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; }
.sw[aria-checked="true"] .track { background: var(--main); justify-content: flex-end; }

.fields { display: flex; flex-direction: column; gap: 14px; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--main); }
.fields input[type=text], .fields input[type=url], .fields input[type=password], .fields input[type=date], .fields input[type=time], .fields select {
  height: 48px; padding: 0 12px; border: 2px solid var(--ground); border-radius: 12px; background: #FFFFFF; color: var(--ink); font-size: 16px; font-weight: 400; width: 100%; min-width: 0;
}
.fields label.chk { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 500; }
.fields label.chk input { width: 22px; height: 22px; accent-color: var(--main); }
.two { display: flex; gap: 10px; }
.two label { flex: 1; min-width: 0; }
form.allday .tm { display: none; }
.btns { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.btns .danger { margin-right: auto; padding-left: 4px; }
.hint, .wait { font-size: 14px; line-height: 1.45; color: var(--main); }
.info { margin-bottom: 12px; }

/* Anmeldung */
.login { padding-top: 48px; }
.login .lead { font-size: 16px; line-height: 1.45; color: var(--main); }
.err { padding: 12px 14px; border-radius: 12px; background: #FFFFFF; color: #8A2C2C; font-weight: 600; }

/* Navigation */
#nav { flex: none; display: flex; padding: 8px 8px calc(10px + var(--bottom)); background: var(--card); border-top: 1px solid var(--ground); }
#nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; color: var(--main); font-size: 12px; font-weight: 600; }
#nav .pill { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
#nav button[aria-current] { color: var(--ink); font-weight: 700; }
#nav button[aria-current] .pill { background: var(--mint); }

/* Blatt und Hinweis */
#sheet { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; }
.backdrop { position: absolute; inset: 0; background: rgba(46, 39, 43, 0.45); }
.panel { position: relative; max-height: 92%; overflow-y: auto; width: 100%; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + var(--bottom)); display: flex; flex-direction: column; gap: 16px; }
.panel h2 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); padding: 0; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--bottom)); z-index: 20; max-width: 528px; margin: 0 auto; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #FFFFFF; font-size: 15px; }

.nolist { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.nolist p { color: var(--main); font-size: 15px; }

/* ---------- Erweiterungen ---------- */
.chips { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.fchip[aria-pressed="true"] { background: var(--main); color: #FFFFFF; }
.fchip .dot { width: 9px; height: 9px; }
.fchip[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px #FFFFFF; }

.chead { padding-bottom: 8px; }
.ctools { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 12px 10px; }
.seg.sm button { height: 38px; font-size: 14px; }

.evrow { display: flex; align-items: center; }
.evrow .ev { flex: 1; min-width: 0; }
.evcheck { flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.evcheck span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--main); display: flex; align-items: center; justify-content: center; color: transparent; }
.evrow.done .evcheck span { background: var(--main); color: #FFFFFF; }
.evrow.done .etitle { text-decoration: line-through; color: var(--main); }
.etitle .rep { display: inline-flex; vertical-align: middle; margin-left: 6px; color: var(--main); }
.emeta .dot { width: 12px; height: 12px; }

.tsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.prio { padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--peri); color: var(--ink); }
.prio.p1 { background: var(--main); color: #FFFFFF; }
.tagl { display: inline-flex; align-items: center; gap: 5px; }
.tagl i { width: 9px; height: 9px; border-radius: 50%; }
.task.tpl .tmain { cursor: default; padding-left: 20px; }
.more.sm { width: 40px; height: 44px; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick button { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 20px; background: var(--card); min-height: 64px; }
.quick strong { font-size: 15px; }
.quick span { font-size: 14px; color: var(--main); }

.wday { gap: 6px; }
.wdhead { align-self: flex-start; min-height: 36px; padding: 0 4px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--main); }
.wdhead.today { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.wday .empty { padding: 10px 16px; }

.picker { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.picker legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--main); }
.picker .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.picker .opt { position: relative; }
.picker .opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picker .opt span { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 2px solid var(--ground); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.picker .opt span i { width: 12px; height: 12px; border-radius: 50%; }
.picker .opt input:checked + span { border-color: var(--main); background: var(--main); color: #FFFFFF; }
.picker .opt input:checked + span i { box-shadow: 0 0 0 1.5px #FFFFFF; }
.picker .opt input:focus-visible + span { outline: 3px solid var(--main); outline-offset: 2px; }
form.norepeat .until { visibility: hidden; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.danger.solid { background: #8A2C2C; color: #FFFFFF; }
.filebtn { position: relative; align-items: center; justify-content: center; min-height: 48px; border-radius: 24px; background: var(--main); color: #FFFFFF !important; font-size: 16px !important; font-weight: 700 !important; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.card.pad .lead { font-size: 15px; line-height: 1.45; color: var(--ink); }
.add .more.sm { flex: none; width: 40px; height: 44px; padding: 0; border-radius: 22px; background: none; color: var(--main); }
.chead h1.mtitle { font-size: 22px; line-height: 1.15; }

/* Monatsansicht: Kalender und Terminliste in einer Scrollflaeche */
.mscroll { gap: 0; padding: 0 12px 24px; position: relative; }
.mscroll .grid { padding: 0; }
.mscroll .grid.days { padding-bottom: 16px; }
.mscroll .day { height: 44px; }
.mscroll #agenda { gap: 8px; min-height: calc(100% - 8px); padding-top: 4px; }
.mscroll .atitle { padding: 0 4px; }
.totop { align-self: center; font-size: 14px; color: var(--main); }
