:root {
  --ink: #1c2433;
  --muted: #5e584e;
  --today: #d0122a;
  --frueh: #0c7a6b;
  --spaet: #c46a14;
  --nacht: #2a315f;
  --holiday: #2f4f8a;
  --urlaub: #1a7c8c;
  --krank: #9a3d5c;
  --overtime: #c98412;
  --early: #c24b32;
  --radius: 28px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e4d8c4;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mesh {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 8% -10%, rgba(255, 248, 230, 0.95), transparent 46%),
    radial-gradient(ellipse at 100% 0%, rgba(126, 168, 214, 0.55), transparent 42%),
    radial-gradient(ellipse at 80% 100%, rgba(46, 150, 128, 0.32), transparent 40%),
    radial-gradient(ellipse at 0% 90%, rgba(214, 146, 96, 0.38), transparent 38%),
    linear-gradient(165deg, #f6efe2, #d5e3f2 48%, #e5f0e6);
  z-index: 0;
}
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  min-height: 100dvh;
}
.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.28));
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 16px 40px rgba(28, 36, 51, 0.08);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255,255,255,0.95), rgba(255,255,255,0.08) 42%, rgba(255,255,255,0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.dock-side { padding: 18px 12px; align-self: start; position: sticky; top: 20px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 16px;
}
.logo { height: 42px; width: auto; display: block; }
.brand span {
  font-weight: 650;
  letter-spacing: -0.03em;
  font-size: 17px;
}
.nav-btn, .tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 16px;
  padding: 11px 12px;
  margin: 2px 0;
}
.nav-btn.active, .tab-btn.active {
  background: rgba(255,255,255,0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.dock-bottom { display: none; }
main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel { padding: 22px; }
.hero {
  display: grid;
  gap: 8px 24px;
}
.kicker { color: var(--muted); font-size: 14px; font-weight: 560; }
h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.04em;
  font-weight: 640;
}
.clock {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Avenir Next", sans-serif;
  font-size: clamp(56px, 8vw, 84px);
  font-weight: 520;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
  line-height: 0.95;
}
.sub { font-size: 20px; font-weight: 560; margin: 0; }
.note { color: var(--muted); margin: 0; }
.holiday-pill {
  display: inline-flex;
  align-self: start;
  color: white;
  background: var(--holiday);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 650;
}
.stamp {
  border: 0;
  color: white;
  height: 84px;
  border-radius: 26px;
  font-size: 32px;
  font-weight: 640;
  letter-spacing: -0.03em;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 46%),
    var(--tint, var(--frueh));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 14px 28px rgba(28, 36, 51, 0.14);
}
.stamp:active { transform: translateY(1px); }
.stamp.gehen { --tint: var(--early); }
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.pager { display: flex; align-items: center; gap: 8px; }
.pager h2 { margin: 0; font-size: 18px; letter-spacing: -0.03em; flex: 1; text-align: center; }
.icon-btn, .text-btn, .primary, .quiet {
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  padding: 8px 12px;
}
.primary, a.primary { background: var(--holiday); color: white; font-weight: 640; text-decoration: none; display: inline-block; }
a.text-btn { text-decoration: none; display: inline-block; }
.quiet { background: transparent; box-shadow: none; }
.danger { color: var(--early); }
.week-row, .ot-card, .editor, .legend, .settings p {
  padding: 14px 0;
  border-top: 1px solid rgba(28, 36, 51, 0.08);
}
.week-row:first-child, .panel > .week-row:first-of-type { border-top: 0; }
.week-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px;
}
.week-row.today { box-shadow: inset 0 0 0 2.5px var(--today); }
.week-main { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.week-label { width: 64px; font-weight: 680; flex: none; }
.dots { display: inline-flex; gap: 3px; width: 28px; flex: none; padding-top: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.trail { font-variant-numeric: tabular-nums; font-weight: 680; }
.detail { color: var(--muted); font-size: 14px; margin: 4px 0 0 100px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.calendar { display: grid; gap: 6px; }
.cal-row, .cal-head { display: grid; grid-template-columns: 32px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.kw, .cal-head span { font-size: 11px; font-weight: 720; color: var(--holiday); text-align: center; align-self: center; }
.cal-head span { color: var(--muted); }
.cell {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  background: rgba(255,255,255,0.34);
}
.cell b { font-size: 15px; font-weight: 680; }
.cell small { font-size: 10px; font-weight: 750; letter-spacing: -0.02em; }
.cell.today { box-shadow: inset 0 0 0 2.5px var(--today); }
.cell .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.tone-frueh { background: var(--frueh); color: white; }
.tone-spaet { background: var(--spaet); color: white; }
.tone-nacht { background: var(--nacht); color: white; }
.tone-holiday { background: var(--holiday); color: white; }
.tone-urlaub { background: var(--urlaub); color: white; }
.tone-krank { background: var(--krank); color: white; }
.tone-ink { background: var(--ink); color: white; }
.tone-missing { background: rgba(194, 75, 50, 0.28); }
.tone-empty { background: rgba(255,255,255,0.4); }
.tone-outside { background: transparent; color: rgba(28,36,51,0.38); box-shadow: none; }
.tone-split { background: linear-gradient(to bottom, var(--a), var(--b)); color: white; }
.legend-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; }
.swatch.ring { box-shadow: inset 0 0 0 2px var(--today); background: transparent; }
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(28, 36, 51, 0.28);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.sheet {
  width: min(640px, 100%);
  max-height: min(88dvh, 860px);
  overflow: auto;
  padding: 18px 18px 22px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-size: 14px; }
.field input, .field select, .field textarea {
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chips button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.chips button.on { background: var(--ink); color: white; }
.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(28, 36, 51, 0.88);
  color: white;
}
@media (min-width: 801px) {
  .hero { grid-template-columns: 1.3fr 0.7fr; align-items: center; }
  .stamp { height: 112px; }
  .cell { min-height: 72px; }
  .cell b { font-size: 18px; }
  .sheet-back { align-items: center; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; width: min(100% - 20px, 720px); padding: 12px 0 108px; }
  .dock-side { position: static; padding: 8px 12px; }
  .dock-side .nav-btn { display: none; }
  .brand { padding: 4px 6px; }
  .logo { height: 34px; }
  .dock-bottom {
    display: flex;
    position: fixed;
    z-index: 20;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 6px;
    gap: 2px;
  }
  .tab-btn { text-align: center; font-size: 11px; font-weight: 650; padding: 10px 2px; border-radius: 16px; }
  .detail { margin-left: 0; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .cell, .stamp { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass { background: rgba(255, 251, 245, 0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .stamp:active { transform: none; }
}
