@font-face{font-family:"Bricolage Grotesque";src:url(fonts/bricolage.woff) format("woff");font-weight:200 800;font-display:swap}
@font-face{font-family:"Figtree";src:url(fonts/figtree.woff) format("woff");font-weight:300 900;font-display:swap}

/* Layout: one-screen app – Kopfzeile, Personen-Leiste, Kalender; Dialoge als Overlay */
:root{
  --bg:#f5f6f4; --surface:#ffffff; --ink:#1c2321; --muted:#66716d; --line:#dfe3e0; --accent:#1f6f5c;
  --today:#e7f2ee;
  --font-display:"Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body:"Figtree", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#121615; --surface:#1b201f; --ink:#e8ecea; --muted:#9aa5a1; --line:#2c3331; --accent:#5cc3a6; --today:#1f2d29;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#121615; --surface:#1b201f; --ink:#e8ecea; --muted:#9aa5a1; --line:#2c3331; --accent:#5cc3a6; --today:#1f2d29;
  color-scheme: dark;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
.splash{position:fixed;inset:0;z-index:50;background:#ffffff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;transition:opacity .45s ease}
.splash .splogo{width:128px;height:128px;border-radius:30px;box-shadow:0 6px 24px rgba(0,0,0,.15);animation:pop .6s ease-out}
.splash .spname{font-family:var(--font-display);font-size:22px;font-weight:700;color:#1c2321;letter-spacing:.5px;animation:fadein .8s ease-out}
.splash.hide{opacity:0;pointer-events:none}
@keyframes pop{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes fadein{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){.splash .splogo,.splash .spname{animation:none}.splash{transition:none}}
input[type="date"],input[type="time"]{background-repeat:no-repeat;background-position:right 10px center;background-size:18px;padding-right:36px!important}
input[type="date"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231c2321%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M16%202v4M8%202v4M3%2010h18%22/%3E%3C/svg%3E")}
input[type="time"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231c2321%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpath%20d%3D%22M12%207v5l3%202%22/%3E%3C/svg%3E")}
input[type="date"]::-webkit-calendar-picker-indicator,input[type="time"]::-webkit-calendar-picker-indicator{opacity:0;cursor:pointer;width:22px;height:22px;margin-right:-26px}
:root[data-theme="dark"] input[type="date"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23e8ecea%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M16%202v4M8%202v4M3%2010h18%22/%3E%3C/svg%3E")}
:root[data-theme="dark"] input[type="time"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23e8ecea%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpath%20d%3D%22M12%207v5l3%202%22/%3E%3C/svg%3E")}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) input[type="date"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23e8ecea%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M16%202v4M8%202v4M3%2010h18%22/%3E%3C/svg%3E")}
  :root:not([data-theme="light"]) input[type="time"]{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23e8ecea%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cpath%20d%3D%22M12%207v5l3%202%22/%3E%3C/svg%3E")}
}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font-body);font-size:15px;line-height:1.4}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.app{max-width:1100px;margin:0 auto;padding:12px 16px 90px;display:flex;flex-direction:column;gap:12px;min-height:100%}
.note{font-size:13px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 12px}
header{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:space-between}
h1{font-family:var(--font-display);font-size:24px;margin:0;text-wrap:balance}
.nav{display:flex;gap:6px;align-items:center}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 14px}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
:root[data-theme="dark"] .btn.primary{color:#0d1513}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .btn.primary{color:#0d1513}}
.seg{display:flex;border:1px solid var(--line);border-radius:999px;overflow:hidden;background:var(--surface)}
.seg button{border:0;background:transparent;padding:7px 14px}
.seg button[aria-pressed="true"]{background:var(--accent);color:#fff}
:root[data-theme="dark"] .seg button[aria-pressed="true"]{color:#0d1513}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .seg button[aria-pressed="true"]{color:#0d1513}}
.members{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:5px 12px 5px 6px}
.chip .dot{width:16px;height:16px;border-radius:50%}
.chip[aria-pressed="false"]{opacity:.45}
.chip[aria-pressed="false"] .dot{background:transparent!important;border:2px solid var(--muted)}
.linkbtn{border:0;background:none;color:var(--accent);text-decoration:underline;padding:4px}
/* Monat */
.month{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.wd,.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.wd div{font-size:12px;color:var(--muted);text-align:center;padding:6px 0;border-bottom:1px solid var(--line)}
.cell{min-height:96px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:4px;display:flex;flex-direction:column;gap:3px;background:transparent;text-align:left;border-top:0;border-left:0}
.cell:nth-child(7n){border-right:0}
.cell.out{opacity:.45}
.cell.today{background:var(--today)}
.cell .num{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.cell.today .num{color:var(--accent)}
.pill{display:block;width:100%;font-size:12px;color:#fff;border-radius:5px;padding:1px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:0;text-align:left;text-shadow:0 1px 1px rgba(0,0,0,.25)}
.more{font-size:11px;color:var(--muted)}
/* Liste / Woche */
.list{display:flex;flex-direction:column;gap:14px}
.day h2{font-family:var(--font-display);font-size:16px;margin:0 0 6px}
.day.today h2{color:var(--accent)}
.ev{display:flex;gap:10px;align-items:stretch;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:0;overflow:hidden;width:100%;text-align:left}
.ev .bar{width:10px;flex:none}
.ev .body{padding:8px 10px 8px 0;display:flex;flex-direction:column;gap:2px;min-width:0}
.ev .t{font-weight:600}
.ev .meta{font-size:13px;color:var(--muted)}
.ev .who{display:flex;gap:4px;flex-wrap:wrap}
.tag{font-size:11px;border-radius:999px;padding:1px 8px;color:#fff}
.empty{color:var(--muted);font-size:13px}
.evc{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:7px;padding:0 8px 0 0;overflow:hidden;min-height:30px}
.evc .bar{width:6px;align-self:stretch;flex:none}
.evc .tm{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;flex:none;width:40px}
.evc .tt{font-size:14px;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.evc .dots{display:flex;gap:3px;flex:none}
.evc .dots span{width:17px;height:17px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:700;line-height:1;font-family:var(--font-body)}
.week .day{gap:4px!important;padding:6px 8px!important}
.week .day h2{margin:0 0 2px!important;font-size:13px!important}
.week .empty{font-size:12px}
.yeargrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.ymonth{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:8px}
.ymonth h3{font-family:var(--font-display);font-size:14px;margin:0 0 4px}
.ywd,.ydays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.ywd span{font-size:10px;color:var(--muted);text-align:center}
.yday{border:0;background:transparent;padding:2px 0;display:flex;flex-direction:column;align-items:center;gap:1px;border-radius:6px;font-size:11px;font-variant-numeric:tabular-nums;min-height:26px}
.yday.out{visibility:hidden}
.yday.today span{background:var(--accent);color:#fff;border-radius:50%;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center}
.yday i{display:flex;gap:1px;height:4px}
.yday i b{width:4px;height:4px;border-radius:50%}
.yday:hover{background:var(--today)}
@container (max-width:760px){.yeargrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}
@container (max-width:520px){.viewrow{gap:6px}.viewrow .seg{min-width:0}.viewrow .seg button{padding:0 9px!important;font-size:14px}}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.week .day{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px;min-height:200px}
.week .day h2{font-size:14px}
@container (max-width:760px){
  .week{grid-template-columns:1fr}
  .week .day{min-height:0}
  .cell{min-height:64px;padding:2px}
  .pill{font-size:10px;padding:0 3px}
}
.scroller{container-type:inline-size}
.toolbar{display:flex;justify-content:space-between;align-items:center}
.tleft{display:flex;gap:8px}
.gear{position:relative}
.calrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.calrow .nm{flex:1;min-width:120px;font-weight:600}
.calrow input[type=color]{width:44px;height:32px;padding:2px;border:1px solid var(--line);border-radius:6px;background:var(--bg)}
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.sw{width:34px;height:34px;border-radius:50%;border:2px solid var(--line);padding:0}
.sw[aria-pressed="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.sw.none{background:var(--surface);font-size:11px;color:var(--muted);width:auto;padding:0 10px;border-radius:999px}
.ev.hl .bar{width:10px}
.hlstar{font-size:12px}
.badge{position:absolute;top:4px;right:4px;width:10px;height:10px;border-radius:50%;background:var(--accent);border:2px solid var(--surface)}
.badge[hidden],.members[hidden]{display:none}
.viewrow{display:flex;justify-content:center;align-items:center;gap:10px}
.viewrow .seg{height:38px}
.viewrow .seg button{padding:0 16px}
.circ{width:38px;height:38px;border-radius:50%;padding:0;display:inline-flex;align-items:center;justify-content:center;flex:none}
.circ svg{width:22px;height:22px}
#title{cursor:pointer}
.search[hidden]{display:none}
.gear{width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;padding:0}
.gear svg{width:22px;height:22px}
.chip.none{justify-content:center;padding:5px 12px;color:var(--muted)}
.dlg h4{font-family:var(--font-display);font-size:16px;margin:6px 0 0}
.section{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:10px}
.cell.sel{box-shadow:inset 0 0 0 2px var(--accent)}
.daypanel{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.daypanel h2{font-family:var(--font-display);font-size:17px;margin:4px 0}
@container (max-width:520px){
  .cell{min-height:54px;gap:2px}
  .cell .pill{font-size:0;height:6px;padding:0;border-radius:3px}
  .cell .more{display:none}
  .members{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .members .chip{width:100%;min-width:0}
  .members .chip.wide{grid-column:1 / -1}
}
.fab{position:fixed;right:20px;bottom:20px;border-radius:999px;padding:14px 20px;font-size:16px;box-shadow:0 4px 14px rgba(0,0,0,.2)}
/* Dialog */
dialog{border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);padding:0;width:min(520px,calc(100% - 24px))}
dialog::backdrop{background:rgba(0,0,0,.4)}
.dlg{padding:16px;display:flex;flex-direction:column;gap:12px}
.dlg h3{font-family:var(--font-display);margin:0;font-size:20px}
.field{display:flex;flex-direction:column;gap:4px}
.field label,.lbl{font-size:13px;color:var(--muted)}
.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:8px;padding:8px;background-color:var(--bg)}
.field input{min-width:0;width:100%}
.field input[type="color"]{padding:3px;height:40px;width:100%;cursor:pointer}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row>.field{flex:1 1 130px}
.check{display:flex;gap:8px;align-items:center}
.pick{display:flex;flex-wrap:wrap;gap:6px}
.actions{display:flex;gap:8px;justify-content:space-between;flex-wrap:wrap}
.actions .right{display:flex;gap:8px}
.danger{color:#b3261e;border-color:#e3b4b0}
.hint{font-size:12px;color:var(--muted)}
.search{display:flex;gap:6px;align-items:center}
.search input{flex:1;border:1px solid var(--line);border-radius:999px;padding:7px 14px;background:var(--surface);min-width:0}
.res-count{font-size:13px;color:var(--muted);margin:0}
.typeseg{align-self:flex-start}
.pill.special{font-weight:600}
textarea.ics{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11px;height:220px}

/* Echte App */
.app{padding-bottom:110px}
.fab{bottom:max(20px,env(safe-area-inset-bottom))}
.toolbar .tright{display:flex;gap:8px;align-items:center}
.offline{font-size:12px;color:#fff;background:#b45309;border-radius:999px;padding:3px 10px}
.login{position:fixed;inset:0;z-index:40;background:var(--bg);display:flex;align-items:center;justify-content:center;padding:20px}
.login form{width:min(360px,100%);display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px}
.login .lhead{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:6px}
.login .lhead img{width:72px;height:72px;border-radius:18px;box-shadow:0 4px 14px rgba(0,0,0,.12)}
.login .lhead b{font-family:var(--font-display);font-size:20px}
.err{color:#b3261e;font-size:13px;margin:0}
.atts{display:flex;flex-direction:column;gap:6px}
.att{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:8px;padding:6px 8px;background:var(--bg)}
.att a{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--accent)}
.att.gone{opacity:.45;text-decoration:line-through}
.att button{border:0;background:none;font-size:18px;line-height:1;padding:0 4px;color:var(--muted)}
.progress{height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.progress i{display:block;height:100%;width:0;background:var(--accent);transition:width .2s}
.meta.small{font-size:12px;color:var(--muted)}
.clip{font-size:12px;flex:none}
.choice{display:flex;flex-direction:column;gap:8px}
.choice .btn{text-align:left;border-radius:10px;padding:10px 14px}
/* Breite Wochenansicht (PC): Titel umbrechen statt abschneiden */
@container (min-width:761px){
  .week .evc{position:relative;flex-wrap:wrap;align-items:center;gap:1px 6px;padding:4px 6px 4px 12px;min-height:0}
  .week .evc .bar{position:absolute;left:0;top:0;bottom:0;width:6px}
  .week .evc .tm{width:auto;flex:1}
  .week .evc .tt{order:3;flex:1 0 100%;white-space:normal;font-size:13px;line-height:1.25}
  .week .evc .dots span{width:15px;height:15px;font-size:9.5px}
}
/* Handy: nichts darf breiter als der Bildschirm werden */
@container (max-width:760px){.week{grid-template-columns:minmax(0,1fr)}}
.week .day,.daypanel,.list,.ev,.evc,.ev .body{min-width:0}
.ev .t{overflow-wrap:anywhere}
html,body{overflow-x:hidden}
