@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --papier: #f4f4f0;
  --weiss: #ffffff;
  --tinte: #000000;
  --grau: #6b6b66;
  --schatten: 4px 4px 0 var(--tinte);
  /* Vorder-/Hintergrund, den .tuer.heute umdreht */
  --vg: var(--tinte);
  --hg: var(--weiss);
}
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 880px;
  padding: 16px 16px 96px;
  background: var(--papier);
  color: var(--tinte);
  font: 400 17px/1.5 "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 3px; }

h1, h2 { margin: 0; font-weight: 500; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.6rem, 12vw, 4.75rem); line-height: 1; }
h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.riesig { font-size: clamp(4rem, 21vw, 8.5rem); line-height: .86; letter-spacing: -0.055em; }
.unterzeile { margin: 10px 0 28px; color: var(--grau); font-size: 1.1rem; }
.leiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  font: inherit; font-weight: 500; line-height: 1.1;
  color: var(--tinte); background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 999px;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .08s ease-out, box-shadow .08s ease-out;
}
.knopf.primaer { color: var(--weiss); background: var(--tinte); }
.knopf.klein { padding: 8px 14px; font-size: .9rem; }
.knopf.rund { width: 46px; height: 46px; padding: 0; font-size: 1.25rem; }
.knopf.aus, .knopf:disabled { opacity: .25; pointer-events: none; }
@media (hover: hover) {
  .knopf:hover { transform: translate(-2px, -2px); box-shadow: var(--schatten); }
}
.knopf:active { transform: none; box-shadow: none; }
summary.knopf { list-style: none; }
summary.knopf::-webkit-details-marker { display: none; }

.karte {
  background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 16px;
  box-shadow: var(--schatten);
  padding: 18px;
}

/* Formulare */
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; }
input, textarea {
  width: 100%;
  padding: 12px;
  font: inherit; font-weight: 400;
  color: var(--tinte); background: var(--papier);
  border: 2px solid var(--tinte); border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; box-shadow: var(--schatten); }
input[type="file"] { background: var(--weiss); border-style: dashed; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 14px;
  font: inherit; font-weight: 500;
  color: var(--tinte); background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 999px; cursor: pointer;
}
.fehler {
  margin: 0; padding: 10px 14px; font-weight: 500;
  border: 2px solid var(--tinte); border-radius: 10px;
  background: repeating-linear-gradient(-45deg, var(--weiss) 0 7px, #e8e8e3 7px 14px);
}
.status { margin: -8px 0 0; font-size: .9rem; color: var(--grau); overflow-wrap: anywhere; }
.status:empty { display: none; }
progress {
  width: 100%; height: 16px; appearance: none; overflow: hidden;
  border: 2px solid var(--tinte); border-radius: 999px; background: var(--weiss);
}
progress::-webkit-progress-bar { background: var(--weiss); }
progress::-webkit-progress-value { background: var(--tinte); }
progress::-moz-progress-bar { background: var(--tinte); }

/* Login */
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { margin-bottom: 32px; }

/* Startseite */
.legende { display: flex; flex-wrap: wrap; gap: 16px; font-weight: 500; }
.legende > span { display: inline-flex; align-items: center; gap: 7px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.download { position: relative; }
.download .menue {
  position: absolute; left: 0; top: calc(100% + 12px); z-index: 2;
  display: grid; gap: 4px; min-width: 250px; padding: 8px;
}
.menue a { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.menue a:hover { background: var(--papier); }
.menue small { display: block; font-weight: 400; color: var(--grau); }

/* Kalender: jede Kachel ist ein Türchen mit Knauf */
.kalender {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (min-width: 640px) { .kalender { grid-template-columns: repeat(6, 1fr); gap: 16px; } }
.tuer {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 4 / 5;
  padding: 8px 10px 10px;
  color: var(--vg); background: var(--hg);
  border: 2px solid var(--tinte); border-radius: 12px;
  box-shadow: var(--schatten);
  text-decoration: none;
  transition: transform .08s ease-out, box-shadow .08s ease-out;
}
.tuer::after {
  content: "";
  position: absolute; right: 9px; top: 50%;
  width: 9px; height: 9px; margin-top: -4px;
  border: 2px solid var(--vg); border-radius: 50%;
}
.tuer .nr { font-size: clamp(1.6rem, 7vw, 2.1rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.tuer.heute { --vg: var(--weiss); --hg: var(--tinte); }
@media (hover: hover) {
  .tuer:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--tinte); }
}
.tuer:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--tinte); }
.marken { display: flex; gap: 4px; }
.speicher { margin: 32px 0 0; font-size: .9rem; color: var(--grau); }

/* Personen-Marke: Kreis bzw. Quadrat mit Initiale – Form statt Farbe */
.marke {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px;
  font-size: .72rem; font-weight: 700; line-height: 1;
  color: var(--vg); background: var(--hg);
  border: 2px dashed var(--vg); border-radius: 50%;
  opacity: .45;
}
.marke.u1 { border-radius: 5px; }
.marke.voll { color: var(--hg); background: var(--vg); border-style: solid; opacity: 1; }

/* Tagesseite */
.wochentag { margin: 0 0 4px; font-size: 1.1rem; color: var(--grau); }
.blaettern { display: flex; gap: 10px; }
.hinzufuegen { margin: 24px 0 40px; }
.hinzufuegen[open] summary { box-shadow: none; transform: none; }
.hinzufuegen form { margin-top: 16px; }

.personen { display: grid; gap: 40px; }
@media (min-width: 720px) { .personen { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; } }
.person { display: grid; gap: 18px; align-content: start; min-width: 0; }
.person h2 { padding-bottom: 10px; border-bottom: 2px solid var(--tinte); }
.person h2 .marke { width: 30px; height: 30px; font-size: .9rem; }

.eintrag { display: grid; justify-items: start; gap: 4px; }
.rahmen {
  display: block; width: 100%; overflow: hidden;
  background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 14px;
  box-shadow: var(--schatten);
}
.rahmen img, .rahmen video { display: block; width: 100%; }
.rahmen video { background: var(--tinte); }
.memo {
  width: 100%; display: grid; gap: 8px; padding: 12px 14px;
  background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 14px;
  box-shadow: var(--schatten);
  font-weight: 500;
}
.memo audio { width: 100%; }

/* Text als Sprechblase */
.blase {
  position: relative;
  width: 100%; margin: 0 0 16px; padding: 14px 16px;
  font-size: 1.05rem;
  background: var(--weiss);
  border: 2px solid var(--tinte); border-radius: 20px;
  box-shadow: var(--schatten);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.blase::after {
  content: "";
  position: absolute; left: 26px; bottom: -10px;
  width: 16px; height: 16px;
  background: var(--weiss);
  border-right: 2px solid var(--tinte); border-bottom: 2px solid var(--tinte);
  transform: rotate(45deg);
}
.loeschen {
  padding: 4px 2px;
  font: inherit; font-size: .85rem;
  color: var(--grau); background: none; border: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.loeschen:hover { color: var(--tinte); }
.leer {
  margin: 0; padding: 20px;
  color: var(--grau); text-align: center;
  border: 2px dashed #b9b9b3; border-radius: 14px;
}

/* Tagebuch */
.tag { padding: 32px 0 8px; border-top: 2px solid var(--tinte); }
.tag + .tag { margin-top: 24px; }
.tag-kopf {
  display: inline-flex; align-items: center; gap: 14px; margin-bottom: 24px;
  font-size: 1.25rem; font-weight: 500; text-decoration: none;
}
.tag-kopf .nr {
  display: inline-grid; place-items: center;
  min-width: 54px; height: 54px; padding: 0 8px;
  font-size: 1.7rem; letter-spacing: -0.05em;
  color: var(--weiss); background: var(--tinte); border-radius: 12px;
}
@media (hover: hover) { .tag-kopf:hover span:last-child { text-decoration: underline; text-underline-offset: 4px; } }
