@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Inter:wght@400;500;600&display=swap');

:root{
  --bg: #10141a;
  --surface: #1a2029;
  --surface-2: #222a35;
  --line: #2b3542;
  --text: #e9edf2;
  --text-muted: #8794a3;
  --teal: #49c9bd;
  --teal-dim: rgba(73,201,189,0.14);
  --amber: #f0a35e;
  --amber-dim: rgba(240,163,94,0.14);
  --red: #eb6d61;
  --red-dim: rgba(235,109,97,0.12);
}
*{box-sizing:border-box; -webkit-tap-highlight-color: transparent;}
html,body{margin:0; padding:0; background:var(--bg); font-family:'Inter',sans-serif; color:var(--text); min-height:100vh;}

.screen{ display:none; flex-direction:column; min-height:100vh; max-width:520px; margin:0 auto; position:relative; }
.screen.active{ display:flex; }

/* ---------- PIN SCREEN ---------- */
#pin{ align-items:center; justify-content:space-between; padding:0 0 36px; background:
  radial-gradient(120% 60% at 50% 0%, #161c25 0%, var(--bg) 60%); }
.pin-top{ display:flex; flex-direction:column; align-items:center; margin-top:64px; gap:8px;}
.pin-mark{ width:46px; height:46px; border-radius:13px; background:var(--teal-dim); display:flex; align-items:center; justify-content:center; margin-bottom:6px;}
.pin-mark svg{ width:22px; height:22px; stroke:var(--teal); }
.pin-title{ font-family:'Manrope',sans-serif; font-weight:800; font-size:20px; letter-spacing:0.2px;}
.pin-sub{ font-size:13px; color:var(--text-muted);}
.pin-error{ font-size:12.5px; color:var(--red); font-weight:600; min-height:16px; margin-top:10px;}
.dots{ display:flex; gap:16px; margin:34px 0 0;}
.dot{ width:14px; height:14px; border-radius:50%; border:1.5px solid var(--line); transition: all .15s;}
.dot.filled{ background:var(--teal); border-color:var(--teal); box-shadow:0 0 0 5px var(--teal-dim);}
.keypad{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; width:100%; padding:0 34px; max-width:340px;}
.key{ height:64px; border-radius:20px; background:transparent; border:none; color:var(--text); font-size:22px; font-family:'Manrope',sans-serif; font-weight:700; display:flex; align-items:center; justify-content:center;}
.key:active{ background:var(--surface-2); }
.key.ghost{ visibility:hidden; }
.key.del{ font-size:14px; color:var(--text-muted); font-weight:600; font-family:'Inter';}

/* ---------- HOME SCREEN ---------- */
.topbar{ padding:22px 22px 14px; display:flex; align-items:flex-end; justify-content:space-between;}
.eyebrow{ font-size:12px; color:var(--teal); letter-spacing:1.2px; text-transform:uppercase; font-weight:600;}
.h1{ font-family:'Manrope',sans-serif; font-weight:800; font-size:26px; margin-top:2px;}
.lock-btn{ width:36px; height:36px; border-radius:11px; background:var(--surface); display:flex; align-items:center; justify-content:center; cursor:pointer;}
.lock-btn svg{ width:16px; height:16px; stroke:var(--text-muted);}

.tabs{ display:flex; gap:6px; margin:0 22px 18px; background:var(--surface); padding:4px; border-radius:12px;}
.tab{ flex:1; text-align:center; padding:9px 0; border-radius:9px; font-size:13px; font-weight:600; color:var(--text-muted); cursor:pointer;}
.tab.active{ background:var(--surface-2); color:var(--text);}

.list{ flex:1; overflow-y:auto; padding:0 22px 100px; position:relative;}
.list:not(:empty)::before{ content:''; position:absolute; left:38px; top:6px; bottom:100px; width:2px; background:var(--line);}

.empty-hint{ color:var(--text-muted); font-size:13.5px; text-align:center; margin-top:60px;}

.item{ position:relative; padding-left:38px; margin-bottom:22px;}
.item .node{ position:absolute; left:31px; top:4px; width:16px; height:16px; border-radius:50%; background:var(--bg); border:2px solid var(--teal); z-index:2;}
.item.past .node{ border-color:var(--line); }
.item .datebadge{ position:absolute; left:-38px; top:0; width:32px; text-align:right; font-size:10px; color:var(--text-muted); line-height:1.3; font-weight:600;}
.item .datebadge b{ display:block; font-size:15px; color:var(--text); font-family:'Manrope',sans-serif;}
.item.past .datebadge b{ color:var(--text-muted);}

.card{ background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:14px 16px; cursor:pointer;}
.item.past .card{ opacity:0.55;}
.card-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px;}
.tag{ font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:7px; letter-spacing:0.3px; text-transform:uppercase;}
.tag.arzt{ background:var(--teal-dim); color:var(--teal);}
.tag.sonstiges{ background:var(--amber-dim); color:var(--amber);}
.countdown{ font-size:11.5px; color:var(--text-muted); font-weight:600;}
.card-title{ font-family:'Manrope',sans-serif; font-weight:700; font-size:15.5px; margin-bottom:2px;}
.card-meta{ font-size:12.5px; color:var(--text-muted); display:flex; gap:10px; align-items:center;}

.conflict-strip{ margin-top:9px; display:flex; align-items:center; gap:6px; background:var(--red-dim); border:1px solid rgba(235,109,97,0.35); color:#f0958c; border-radius:9px; padding:6px 9px; font-size:11.5px; font-weight:600;}
.conflict-strip.mild{ background:var(--amber-dim); border-color:rgba(240,163,94,0.35); color:var(--amber);}

.shift-pill{ display:flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:6px 11px; font-size:12px; font-weight:600; color:var(--text-muted); margin:2px 22px 14px;}
.shift-pill b{ color:var(--text); font-weight:700;}

.push-banner{ display:flex; flex-direction:column; gap:8px; background:var(--teal-dim); border:1px solid rgba(73,201,189,0.35); border-radius:12px; padding:12px 14px; font-size:12.5px; color:var(--text); margin:0 22px 14px;}
.push-banner .chip{ align-self:flex-start;}
.push-banner a{ color:var(--teal);}
.cron-url{ font-family:monospace; font-size:11px; background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:8px 10px; word-break:break-all; color:var(--text-muted); user-select:all;}

.section-label{ font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted); font-weight:700; margin:4px 0 12px 38px;}

.fab{ position:fixed; right:calc(22px + (100vw - min(100vw,520px))/2); bottom:28px; width:56px; height:56px; border-radius:18px; background:var(--teal); display:flex; align-items:center; justify-content:center; box-shadow:0 10px 24px -6px rgba(73,201,189,0.5); z-index:20; cursor:pointer;}
.fab svg{ width:24px; height:24px; stroke:#0b1512; stroke-width:2.4;}

/* ---------- ADD SCREEN ---------- */
#add{ padding:0;}
.sheet-head{ display:flex; align-items:center; justify-content:space-between; padding:22px 20px 16px;}
.sheet-head .h2{ font-family:'Manrope'; font-weight:800; font-size:18px;}
.close-btn{ width:30px; height:30px; border-radius:9px; background:var(--surface); display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-size:14px; cursor:pointer;}
.form{ flex:1; overflow-y:auto; padding:0 20px 40px; display:flex; flex-direction:column; gap:16px;}
.field label{ display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-muted); font-weight:700; margin-bottom:7px;}
.input{ width:100%; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; color:var(--text); font-size:14.5px; font-family:'Inter';}
.row2{ display:flex; gap:12px;}
.row2 .field{ flex:1;}
.chipset{ display:flex; gap:8px; flex-wrap:wrap;}
.chip{ padding:8px 13px; border-radius:10px; background:var(--surface); border:1px solid var(--line); font-size:13px; font-weight:600; color:var(--text-muted); cursor:pointer;}
.chip.sel{ background:var(--teal-dim); border-color:var(--teal); color:var(--teal);}
.reminder-row{ display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px 12px;}
.reminder-row span{ flex:1; font-size:13.5px;}
.reminder-row button{ background:none; border:none; color:var(--text-muted); font-size:16px; cursor:pointer;}
.add-reminder{ display:flex; align-items:center; gap:6px; color:var(--teal); font-size:13.5px; font-weight:700; padding:8px 2px; cursor:pointer;}
.add-reminder svg{ width:14px; height:14px; stroke:var(--teal);}
.save-btn{ margin-top:6px; background:var(--teal); color:#0b1512; text-align:center; padding:15px; border-radius:14px; font-weight:800; font-family:'Manrope'; font-size:15px; border:none; cursor:pointer;}
.delete-btn{ background:transparent; color:var(--red); text-align:center; padding:12px; border-radius:14px; font-weight:700; font-family:'Manrope'; font-size:14px; border:1px solid rgba(235,109,97,0.35); cursor:pointer;}

/* ---------- RHYTHMUS SCREEN ---------- */
.rhy-section{ display:flex; flex-direction:column; gap:10px; padding-bottom:22px; border-bottom:1px solid var(--line);}
.rhy-section:last-child{ border-bottom:none;}
.rhy-section-title{ font-family:'Manrope',sans-serif; font-weight:800; font-size:15px;}
.rhy-hint{ font-size:12px; color:var(--text-muted); margin:0;}
.rhy-list{ display:flex; flex-direction:column; gap:8px;}
.rhy-row{ display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px 12px; font-size:13px;}
.rhy-row .rhy-main{ flex:1;}
.rhy-row .rhy-main b{ font-family:'Manrope',sans-serif;}
.rhy-row .rhy-sub{ color:var(--text-muted); font-size:11.5px; margin-top:2px;}
.rhy-row button{ background:none; border:none; color:var(--text-muted); font-size:15px; cursor:pointer;}
.rhy-add-row{ display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
.rhy-add-row select.input{ appearance:none;}
.block-row{ display:flex; gap:8px; align-items:center;}
.block-row select{ flex:1;}
.block-row input{ width:80px;}
