/* Gleitzeit – Liquid Glass, Dark Mode, optimiert für 1920 × 1080 */

:root {
  color-scheme: dark;

  /* Apple-Systemfarben (dunkel) */
  --label: #fff;
  --label-2: rgba(235, 235, 245, .66);
  --label-3: rgba(235, 235, 245, .36);
  --sep: rgba(255, 255, 255, .09);
  --fill: rgba(255, 255, 255, .09);
  --fill-2: rgba(255, 255, 255, .06);
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;

  /* Glas */
  --glass-bg: linear-gradient(150deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045) 42%, rgba(255, 255, 255, .07));
  --glass-filter: blur(36px) saturate(190%) brightness(1.05);
  --glass-filter-s: blur(20px) saturate(210%) brightness(1.1);
  --glass-rim: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .05) 35%, rgba(255, 255, 255, .05));
  --glass-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55);

  --r-xl: 30px;
  --r-l: 24px;
  --r-m: 16px;
  --r-s: 12px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;

  /* Federn, berechnet aus Dämpfung und Reaktionszeit:
     --spring        Dämpfung 1.0, 0.4 s – ohne Überschwingen
     --spring-soft   Dämpfung 0.85, 0.5 s – ruhig, für große Flächen
     Nachfedern (Dämpfung < 1) nur bei Gesten mit Schwung – hier gibt es keine, also keins. */
  --spring: linear(0, 0.06, 0.186, 0.329, 0.466, 0.584, 0.682, 0.76, 0.821, 0.868, 0.903, 0.929, 0.949, 0.963, 0.973, 0.981, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 0.999, 1, 1, 1);
  --spring-soft: linear(0, 0.051, 0.167, 0.308, 0.45, 0.579, 0.689, 0.778, 0.847, 0.9, 0.938, 0.964, 0.982, 0.994, 1.001, 1.004, 1.006, 1.006, 1.006, 1.005, 1.004, 1.003, 1.003, 1.002, 1.001, 1.001, 1.001, 1, 1, 1, 1, 1, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background: #05060a;
  color: var(--label);
  font: 15px/1.45 var(--font);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p { margin: 0; }
h2, h3 { margin: 0; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; }

/* ---------- Licht hinter dem Glas ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1400px 900px at 50% 120%, rgba(30, 40, 90, .35), transparent 70%),
    #05060a;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  transition: background-color 1400ms ease, opacity 1400ms ease;
}
.b1 { width: 44vw; height: 44vw; left: -10vw; top: -14vw; background: #0a5cff; opacity: .32; }
.b2 { width: 34vw; height: 34vw; right: -6vw; top: -10vw; background: #6e44ff; opacity: .22; }
.b3 { width: 38vw; height: 38vw; right: 4vw; bottom: -22vw; background: #0fb5c9; opacity: .18; }
.b-mood { width: 30vw; height: 30vw; left: 6vw; top: 30vh; background: #0a84ff; opacity: .16; }
body[data-mood="green"] .b-mood { background: #22c55e; opacity: .18; }
body[data-mood="orange"] .b-mood { background: #ff8a00; opacity: .18; }

/* ---------- Glas-Material ---------- */

.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-xl);
}
/* Feine Lichtkante oben – nur an großen Glasflächen */
.glass::before, .sheet::before, .help-pop::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ---------- Bedienelemente ---------- */

button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { box-shadow: 0 0 0 3px rgba(10, 132, 255, .65); }
.glass:focus-visible { box-shadow: var(--glass-shadow), 0 0 0 3px rgba(10, 132, 255, .65); }

/* Flache Kapsel-Buttons: nur Rückmeldung beim Drücken, keine Lichteffekte */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: var(--label);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 400ms var(--spring), background-color 200ms ease;
}
.pill:hover { background: rgba(255, 255, 255, .15); }
.pill:active { transform: scale(.96); transition-duration: 90ms; }
.pill.blue { background: var(--blue); }
.pill.blue:hover { background: #2b95ff; }
.pill.danger { color: #ff7b72; }
.pill.small { height: 30px; padding: 0 13px; font-size: 13px; }
.pill.large { height: 54px; padding: 0 32px; font-size: 17px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--label-2);
  transition: transform 400ms var(--spring), background-color 200ms ease, color 200ms ease;
}
.icon-btn:hover { background: var(--fill); color: var(--label); }
.icon-btn:active { transform: scale(.92); transition-duration: 90ms; }
.icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input[type="text"], select {
  border: 0;
  border-radius: var(--r-s);
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .08);
  color: var(--label);
  transition: box-shadow 250ms ease, background-color 250ms ease;
}
input[type="text"]:focus-visible, select:focus-visible {
  background: rgba(0, 0, 0, .3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px rgba(10, 132, 255, .6);
}
input[type="text"] { height: 38px; padding: 0 12px; }
input::placeholder { color: var(--label-3); }
select {
  height: 38px;
  padding: 0 34px 0 12px;
  appearance: none;
  background-image: url("../img/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
}
select option { background: #2c2c2e; }

.time-field { width: 90px; text-align: center; font-size: 17px; font-weight: 500; }
.time-field.xl {
  width: 156px;
  height: 64px;
  border-radius: var(--r-m);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -.035em;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--label-2);
  font: 600 11px/1.6 var(--font);
  text-align: center;
}
code { font: 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--label); }

/* Segment-Schalter mit gleitendem Glas-Daumen */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 .5px rgba(255, 255, 255, .06);
}
.seg label { position: relative; z-index: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span:not(.seg-thumb) {
  display: block;
  padding: 8px 12px;
  border-radius: 11px;
  color: var(--label-2);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 300ms ease;
}
.seg input:checked + span { color: var(--label); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10, 132, 255, .6); }
.seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transition: transform 450ms var(--spring);
}
.seg:has(> label:nth-of-type(2) input:checked) .seg-thumb { transform: translateX(100%); }
.seg:has(> label:nth-of-type(3) input:checked) .seg-thumb { transform: translateX(200%); }

/* Hinweise */
.banner {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  -webkit-backdrop-filter: var(--glass-filter-s);
  backdrop-filter: var(--glass-filter-s);
}
.banner.warn { background: rgba(255, 159, 10, .14); color: #ffc062; }
.banner.error { background: rgba(255, 69, 58, .14); color: #ff8a80; }
.banner.info { background: rgba(255, 255, 255, .06); color: var(--label-2); font-weight: 400; }

/* ---------- Schwebende Werkzeugleiste ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 84px;
  padding: 16px 24px 0;
  pointer-events: none;
}
.toolbar > * { pointer-events: auto; }
.capsule {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;
  padding: 0 9px;
  border-radius: 999px;
}
.brand { justify-self: start; gap: 10px; padding: 0 22px 0 14px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.weeknav { justify-self: center; }
.week-label {
  min-width: 300px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  transition: background-color 200ms ease, color 300ms ease;
}
.week-label:hover { background: var(--fill-2); }
.week-label:not(.current) { color: #5eb3ff; }
.weeknav .pill { margin: 0 4px 0 6px; }
.tools { justify-self: end; gap: 6px; padding-left: 20px; }
.tools .pill { margin-left: 2px; }
.tools .icon-btn:first-of-type { margin-left: 6px; }
.clock { margin-right: 8px; color: var(--label-2); font-size: 15px; white-space: nowrap; }
.clock b { display: inline-block; color: var(--label); font-weight: 600; }
.clock small { color: var(--label-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* ---------- Seitenaufbau ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(560px, 40fr) 60fr;
  gap: 24px;
  height: calc(100dvh - 84px);
  padding: 20px 24px 24px;
}

/* Auftritt beim Laden: Glas materialisiert sich nacheinander */
@keyframes materialize {
  from { opacity: 0; transform: translateY(10px); }
}
.capsule, .hero, .tiles > *, .week, .controls > *, .notes, .foot {
  animation: materialize 700ms var(--spring) backwards;
}
.weeknav { animation-delay: 40ms; }
.tools { animation-delay: 80ms; }
.hero { animation-delay: 120ms; }
.tiles > :nth-child(1) { animation-delay: 180ms; }
.tiles > :nth-child(2) { animation-delay: 230ms; }
.tiles > :nth-child(3) { animation-delay: 280ms; }
.week { animation-delay: 330ms; }
.controls > :nth-child(1) { animation-delay: 400ms; }
.controls > :nth-child(2) { animation-delay: 450ms; }
.notes, .foot { animation-delay: 500ms; }

/* ---------- Hero mit Ring ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 0;
  padding: 32px;
  text-align: center;
}
.hero-label { color: var(--label-2); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.ring-wrap { position: relative; width: min(46vh, 30vw, 500px); aspect-ratio: 1; container-type: inline-size; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 15; }
.ring-bar {
  fill: none;
  stroke: url(#grad-blue);
  stroke-width: 15;
  stroke-linecap: round;
  transition: stroke-dashoffset 1100ms var(--spring-soft), opacity 400ms ease;
}
.ring-bar.green { stroke: url(#grad-green); }
.ring-bar.orange { stroke: url(#grad-orange); }
.ring-bar.empty { opacity: 0; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* Schriftgröße folgt der Ringbreite, damit die Zeit immer in den Ring passt */
.hero-big {
  font-size: clamp(40px, 24cqi, 124px);
  white-space: nowrap;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.045em;
}
.hero-big.small { font-size: clamp(22px, 9.5cqi, 48px); letter-spacing: -.03em; padding: 0 12%; white-space: normal; }
.hero-caption { color: var(--label-2); font-size: clamp(14px, 4.4cqi, 22px); font-weight: 500; letter-spacing: -.02em; }
.hero-caption.plus { color: var(--green); }
.hero-caption.minus { color: var(--red); }
.hero-sub { color: var(--label-2); font-size: 17px; max-width: 34em; }
.hero-action:empty { display: none; }
.hero .banner { max-width: 34em; }

/* Ziffern rollen beim Wechsel herein (wie Apples numericText) */
.roll { display: inline-block; animation: roll 450ms var(--spring) backwards; }
@keyframes roll { from { opacity: 0; transform: translateY(.3em); } }

/* ---------- Rechte Spalte ---------- */

.side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  overflow: hidden auto;
  padding: 2px;
  margin: -2px;
}

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border: 0;
  border-radius: var(--r-l);
  color: inherit;
  text-align: left;
}
button.tile { cursor: pointer; transition: transform 400ms var(--spring), background-color 200ms ease; }
button.tile:hover { background: rgba(255, 255, 255, .09); }
button.tile:active { transform: scale(.98); transition-duration: 90ms; }
.tile-label { color: var(--label-2); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.tile-value { font-size: 36px; font-weight: 600; line-height: 1.1; letter-spacing: -.035em; transition: color 500ms ease; }
.tile-value.plus { color: var(--green); }
.tile-value.minus { color: var(--red); }
.tile-sub { color: var(--label-2); font-size: 13px; letter-spacing: 0; min-height: 1.2em; }
.tile-sub.warn { color: #ffc062; }

/* Woche */
.week { flex: 1 1 auto; min-height: 0; overflow: hidden auto; padding: 6px 8px 8px; }
.days-head, .day, .total {
  display: grid;
  grid-template-columns: 10px minmax(150px, 1.1fr) 2fr 90px 130px 14px;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
}
.days-head {
  height: 40px;
  color: var(--label-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.days-head span:nth-child(4), .days-head span:nth-child(5) { text-align: right; }
.days { list-style: none; margin: 0; padding: 0; }
.days li { position: relative; }
.days li + li::before {
  content: "";
  position: absolute;
  left: 46px;
  right: 18px;
  top: 0;
  border-top: .5px solid var(--sep);
}
.days li:has(.is-today)::before, .days li:has(.is-today) + li::before { opacity: 0; }
.days.stagger li { animation: row-in 550ms var(--spring) backwards; }
.days.stagger.from-left li { animation-name: row-in-left; }
.days.stagger li:nth-child(2) { animation-delay: 40ms; }
.days.stagger li:nth-child(3) { animation-delay: 80ms; }
.days.stagger li:nth-child(4) { animation-delay: 120ms; }
.days.stagger li:nth-child(5) { animation-delay: 160ms; }
.days.stagger li:nth-child(6) { animation-delay: 200ms; }
.days.stagger li:nth-child(7) { animation-delay: 240ms; }
@keyframes row-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes row-in-left { from { opacity: 0; transform: translateX(-16px); } }

.day {
  position: relative;
  width: 100%;
  min-height: clamp(56px, 7vh, 78px);
  border: 0;
  border-radius: 18px;
  background: transparent;
  text-align: left;
  font-size: 17px;
  transition: background-color 200ms ease;
}
.day:hover { background: rgba(255, 255, 255, .05); }
.day:active { background: rgba(255, 255, 255, .08); }
.day.is-today { background: rgba(10, 132, 255, .14); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.today { background: var(--blue); }
.dot.done { background: rgba(255, 255, 255, .25); }
.dot.missing { background: var(--orange); }
.dot.future { border: 1.5px solid var(--label-3); }
.dot.off, .dot.flex { background: transparent; }
.day .d { font-weight: 600; letter-spacing: -.02em; }
.day .d small { margin-left: 8px; color: var(--label-2); font-size: 15px; font-weight: 400; }
.day .t { color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .t .sep { color: var(--label-3); margin: 0 8px; }
.day.future .t, .day.off .t, .day.flex .t { color: var(--label-3); }
.day .tag {
  margin-left: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--label-2);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}
.day .v { text-align: right; font-weight: 600; }
.day .x { text-align: right; font-weight: 600; color: var(--label-2); }
.day .x.goal { font-weight: 400; }
.day .x.plus { color: var(--green); }
.day .x.minus { color: var(--red); }
.day.missing .v, .day.missing .x { color: var(--orange); }
.day .chev {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--label-3);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 200ms ease;
}
.day:hover .chev { stroke: var(--label-2); }
.total { min-height: clamp(52px, 6vh, 68px); font-size: 17px; font-weight: 600; }
.total .t { color: var(--label-2); font-size: 15px; font-weight: 400; }
.total .v, .total .x { text-align: right; }
.total .x.plus { color: var(--green); }
.total .x.minus { color: var(--red); }

/* Freitag & Was wäre wenn */
.controls { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.controls.single { grid-template-columns: 1fr; }
.controls .tile { gap: 10px; }
.whatif-row { display: flex; align-items: center; gap: 20px; }
.whatif-result { color: var(--label-2); font-size: 17px; line-height: 1.4; }
.whatif-result b { color: var(--label); font-weight: 600; }
.whatif-result.fresh { animation: roll 400ms var(--spring) backwards; }

.notes { display: grid; gap: 10px; }
.notes:empty { display: none; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  color: var(--label-3);
  font-size: 12px;
  letter-spacing: 0;
}

/* ---------- Hilfe-Popup (wächst aus dem ?-Knopf) ---------- */

.help-pop {
  position: fixed;
  inset: 92px 24px auto auto;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100dvh - 120px);
  margin: 0;
  padding: 22px 24px 20px;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  color: var(--label);
  /* dichter als die Kacheln: liegt über unruhigem Inhalt und muss lesbar bleiben */
  background: linear-gradient(150deg, rgba(52, 56, 72, .86), rgba(26, 28, 36, .84));
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  backdrop-filter: blur(60px) saturate(200%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 40px 90px -20px rgba(0, 0, 0, .75);
  transform-origin: calc(100% - 64px) -12px;
  opacity: 0;
  transform: scale(.85);
  transition:
    opacity 220ms ease, transform 450ms var(--spring),
    overlay 450ms allow-discrete, display 450ms allow-discrete;
}
.help-pop:popover-open { opacity: 1; transform: none; }
@starting-style {
  .help-pop:popover-open { opacity: 0; transform: scale(.85); }
}
.help-pop::backdrop { background: transparent; }
.help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.help-pop h2 { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.help-pop h3 { margin: 16px 0 6px; color: var(--label-2); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.help-list { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: rgba(235, 235, 245, .82); font-size: 14px; line-height: 1.45; }
.help-list b { color: var(--label); font-weight: 600; }
.help-list li::marker { color: var(--label-3); font-weight: 600; }

/* ---------- Sheets (Dialoge) ---------- */

dialog.sheet {
  position: fixed;
  width: min(640px, calc(100vw - 48px));
  max-height: calc(100dvh - 64px);
  padding: 28px;
  overflow: auto;
  border: 0;
  border-radius: 32px;
  background: linear-gradient(155deg, rgba(62, 66, 82, .62), rgba(28, 30, 38, .6));
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  backdrop-filter: blur(50px) saturate(200%);
  color: var(--label);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 50px 120px -20px rgba(0, 0, 0, .8);
}
dialog.sheet[open] { animation: sheet-in 520ms var(--spring) both; }
dialog.sheet.closing { animation: sheet-out 220ms cubic-bezier(.4, 0, 1, 1) both; }
dialog.sheet::backdrop {
  background: rgba(3, 4, 10, .45);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
dialog.sheet[open]::backdrop { animation: fade-in 380ms ease both; }
dialog.sheet.closing::backdrop { animation: fade-out 280ms ease both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet h2 { margin-bottom: 18px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.sheet h3 { margin: 22px 0 8px; color: var(--label-2); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.sheet .seg { margin-bottom: 10px; }
.hint { margin-top: 8px; color: var(--label-2); font-size: 13px; letter-spacing: 0; }
.hint:empty { display: none; }
.sheet .banner { margin-top: 14px; }

.group {
  margin-top: 10px;
  border-radius: 18px;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}
.group .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 7px 16px;
}
.group .row + .row { border-top: .5px solid var(--sep); }
.group .row label { font-size: 15px; }
.row-controls { display: flex; gap: 8px; }
.field { display: block; padding: 12px 16px; }
.field > span { display: block; margin-bottom: 8px; color: var(--label-2); font-size: 13px; font-weight: 600; }
.field input { width: 100%; height: 46px; font-size: 19px; font-weight: 500; }

details { margin-top: 18px; }
summary { color: #5eb3ff; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "›"; display: inline-block; margin-left: 6px; transition: transform 300ms var(--spring); }
details[open] summary::after { transform: rotate(90deg); }
details[open] > .group { animation: materialize 600ms var(--spring) both; }

.row-end, .row-start { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.row-end { justify-content: flex-end; }
.row-start.wrap { flex-wrap: wrap; margin-top: 4px; }
.spacer { flex: 1; }
#day-now { margin: 12px 0 18px; }

/* Woche eintragen */
.group .week-row { display: grid; grid-template-columns: 150px 1fr 64px; }
.week-row label { font-weight: 600; }
.week-row label small { margin-left: 6px; color: var(--label-2); font-size: 13px; font-weight: 400; }
.week-row input { width: 100%; height: 42px; font-size: 17px; font-weight: 500; }
.wk-ist { text-align: right; color: var(--label-2); font-size: 17px; font-weight: 600; }
.wk-ist.bad { color: var(--orange); }

/* Import */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  border: 1.5px dashed rgba(235, 235, 245, .24);
  border-radius: var(--r-l);
  background: rgba(0, 0, 0, .14);
  text-align: center;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.drop:hover, .drop.over { border-color: #5eb3ff; background: rgba(10, 132, 255, .1); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #5eb3ff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drop strong { color: #5eb3ff; font-size: 17px; }
.drop span { color: var(--label-2); font-size: 13px; }
#import-input .hint { margin-top: 14px; }

.table-wrap { max-height: 46vh; overflow: auto; border-radius: 16px; background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 14px; text-align: left; white-space: nowrap; }
td:nth-child(2) { white-space: normal; }
tr + tr td { border-top: .5px solid var(--sep); }
th { position: sticky; top: 0; background: rgba(40, 42, 52, .96); color: var(--label-2); font-size: 12px; font-weight: 600; }
td.ok { color: var(--green); font-weight: 600; }
td.diff { color: var(--orange); }
.warnings { margin: 12px 0 0; padding-left: 18px; color: #ffc062; font-size: 13px; }
.warnings:empty { display: none; }

/* Mitteilung unten mittig: verdeckt keine Daten */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(58, 60, 72, .85);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6);
  font-size: 15px;
  font-weight: 600;
  transform: translateX(-50%);
  animation: toast-in 450ms var(--spring) both;
}
.toast.out { animation: toast-out 220ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Barrierefreiheit ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-delay: 0ms !important; }
  dialog.sheet[open], .toast { animation: fade-in 200ms ease both !important; }
  .toast { transform: translateX(-50%); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .pill, dialog.sheet, .help-pop, .toast, .banner {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .glass { background: #1c1c1e; }
  dialog.sheet, .help-pop, .toast { background: #2c2c2e; }
  .blob { opacity: .08; }
}

@media (prefers-contrast: more) {
  :root { --label-2: rgba(235, 235, 245, .85); --label-3: rgba(235, 235, 245, .6); --sep: rgba(235, 235, 245, .3); }
  .glass, .pill { box-shadow: inset 0 0 0 1px rgba(235, 235, 245, .45); }
  .blob { opacity: .08; }
}

/* ---------- Kleinere Bildschirme (zweitrangig) ---------- */

@media (max-height: 820px) and (min-width: 1201px) {
  .ring-wrap { width: min(40vh, 28vw); }
  .tile { padding: 16px 20px; }
  .tile-value { font-size: 28px; }
}

@media (max-width: 1440px) {
  .clock span, .clock small { display: none; }
}

@media (max-width: 1200px) {
  .toolbar { grid-template-columns: 1fr auto; height: auto; padding-bottom: 4px; }
  .weeknav { grid-column: 1 / -1; grid-row: 2; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .ring-wrap { width: min(60vw, 380px); }
  .side { overflow: visible; }
  .help-pop { inset: 84px 16px auto auto; }
}

@media (max-width: 760px) {
  .toolbar { padding: 10px 12px 0; gap: 10px; }
  .brand span, .clock, #today-btn, #open-week { display: none; }
  .week-label { min-width: 0; }
  .layout { padding: 16px 12px; gap: 16px; }
  .tiles, .controls { grid-template-columns: 1fr; }
  .days-head { display: none; }
  .day, .total { grid-template-columns: 8px 1fr auto 70px 14px; gap: 10px; padding: 8px 12px; font-size: 15px; }
  .day .t { grid-column: 2 / -1; grid-row: 2; font-size: 13px; }
  .whatif-row { flex-direction: column; align-items: flex-start; }
  .foot { flex-direction: column; }
}
