/*
 * Unser Space: privates Editorial-Produkt für Jenny und Daven.
 * System: fast scharfe Flächen, Pillen nur für Aktionen, ein Terrakotta-Akzent.
 */

:root {
  color-scheme: light dark;
  --paper: #f3efe7;
  --paper-deep: #e8e1d5;
  --surface: #faf7f1;
  --surface-muted: #ece5d9;
  --ink: #211d18;
  --muted: #6b6259;
  --soft: #887f75;
  --line: rgba(33, 29, 24, 0.18);
  --line-strong: rgba(33, 29, 24, 0.34);
  --accent: #ad4d31;
  --accent-ink: #fff8ef;
  --feature: #241f1a;
  --feature-ink: #f8f3e9;
  --danger: #a2392c;
  --overlay: rgba(20, 17, 26, 0.55);

  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --radius-surface: 4px;
  --radius-control: 999px;
  --shadow-soft: 0 22px 70px rgba(53, 40, 28, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17151b;
    --paper-deep: #100f14;
    --surface: #201d24;
    --surface-muted: #28242d;
    --ink: #eee8dc;
    --muted: #b8b0a5;
    --soft: #978f86;
    --line: rgba(238, 232, 220, 0.17);
    --line-strong: rgba(238, 232, 220, 0.32);
    --accent: #d27451;
    --accent-ink: #17151b;
    --feature: #ede5d7;
    --feature-ink: #17151b;
    --danger: #ec8b78;
    --overlay: rgba(5, 4, 7, 0.72);
    --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.24);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, transparent 0 74%, rgba(173, 77, 49, 0.025) 74% 100%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
fieldset,
legend {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

.app {
  display: grid;
  grid-template-columns: minmax(12rem, 14.5rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(2.5rem, 5vw, 6.5rem);
  width: min(78rem, calc(100% - 4rem));
  min-height: 100dvh;
  margin: 0 auto;
}

/* ---------- Kopf ---------- */

.app-top {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 5.75rem;
  border-bottom: 1px solid var(--line);
}

.app-back {
  display: inline-flex;
  align-items: baseline;
  gap: 0.8rem;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.app-back strong {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.app-back span {
  color: var(--muted);
  font-size: 0.75rem;
  transition: color 180ms ease;
}

.app-back:hover span {
  color: var(--accent);
}

.app-wordmark {
  position: relative;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1;
  text-align: center;
}

.app-wordmark em {
  color: var(--accent);
  font-style: italic;
}

.app-wordmark small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.59rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-settings {
  justify-self: end;
  min-height: 2.5rem;
  padding: 0 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.app-settings:hover {
  background: var(--ink);
  color: var(--paper);
}

.app-settings:active {
  transform: translateY(1px);
}

/* ---------- Seitennavigation ---------- */

.tabbar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 5.75rem);
  padding: clamp(2.6rem, 6vh, 5rem) 1.7rem 2rem 0;
  border-right: 1px solid var(--line);
}

.tabbar__intro {
  margin-bottom: 2.6rem;
}

.tabbar__intro strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 4vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.tabbar__intro span {
  display: block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.tabbar__items {
  display: grid;
  gap: 0.15rem;
}

.tab {
  position: relative;
  display: grid;
  gap: 0.12rem;
  width: 100%;
  padding: 0.76rem 1rem 0.78rem;
  color: var(--muted);
  text-align: left;
  transition: color 180ms ease, transform 180ms ease;
}

.tab::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 2px;
  height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tab span {
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.2;
}

.tab small {
  color: var(--soft);
  font-size: 0.65rem;
}

.tab:hover {
  color: var(--ink);
  transform: translateX(2px);
}

.tab.is-active {
  color: var(--accent);
}

.tab.is-active::before {
  height: 2.5rem;
}

.tabbar__privacy {
  max-width: 12rem;
  margin-top: auto;
  padding-top: 2rem;
  color: var(--soft);
  font-size: 0.68rem;
  line-height: 1.5;
}

/* ---------- Ansichten ---------- */

.views {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: clamp(3.4rem, 7vh, 6rem) 0 6rem;
}

.view {
  display: none;
  width: 100%;
  animation: view-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-head {
  padding-bottom: 1.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.view-title {
  max-width: 14ch;
  font-size: clamp(2.8rem, 5.3vw, 5.3rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.view-title em {
  color: var(--accent);
  font-style: italic;
}

.view-sub {
  max-width: 34rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.kicker,
.field__label,
.who-field legend,
.draw-group legend {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.panel-title,
.section-title {
  font-size: 1.22rem;
  line-height: 1.25;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  color: var(--muted);
  font-size: 0.7rem;
}

.empty {
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.empty--framed {
  padding: 2.6rem;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

/* ---------- Heute ---------- */

.today-head {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(15rem, 0.55fr);
  align-items: end;
  gap: 3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.today-date {
  margin-bottom: 0.9rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
}

.greet {
  max-width: 14ch;
  font-size: clamp(3.4rem, 6.2vw, 6.6rem);
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.today-intro {
  max-width: 24rem;
  padding-bottom: 0.55rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.45;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.15rem;
}

.card,
.countdown-panel,
.latest {
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
}

.card--days {
  grid-column: 1 / span 7;
  min-height: 18rem;
  padding: clamp(1.7rem, 3vw, 2.6rem);
  background: var(--feature);
  color: var(--feature-ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.card--days:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 90px rgba(53, 40, 28, 0.16);
}

.card--days .kicker {
  color: currentColor;
  opacity: 0.62;
}

.card--days strong {
  display: block;
  margin: 1.1rem 0 0.3rem;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(5rem, 9vw, 8.5rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.card--days__sub {
  display: block;
  max-width: 22rem;
  margin-top: 1rem;
  color: currentColor;
  font-size: 0.85rem;
  opacity: 0.68;
}

.countdown-panel {
  grid-column: 8 / -1;
  padding: 1.7rem;
  background: var(--surface);
}

.countdowns {
  display: grid;
  gap: 0;
  margin-top: 1rem;
}

.countdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.countdown:last-child {
  border-bottom: 0;
}

.countdown b {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
}

.countdown span {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.countdown span i {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.countdown-empty {
  padding: 1.1rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.card--question {
  grid-column: 1 / span 7;
  padding: clamp(1.7rem, 3vw, 2.5rem);
  background: var(--surface-muted);
}

.card--question .question {
  margin: 1rem 0 1.5rem;
  font-size: clamp(1.55rem, 2.6vw, 2.5rem);
  line-height: 1.22;
}

.latest {
  grid-column: 8 / -1;
  padding: 1.7rem;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.timeline li {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.92rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline .t-kind {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.timeline .t-body {
  min-width: 0;
}

.timeline .t-body p {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline .t-date {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

/* ---------- Formulare und Aktionen ---------- */

.field {
  display: grid;
  gap: 0.48rem;
  min-width: 0;
}

.field input,
.field textarea,
.field select,
.lightbox__caption input {
  width: 100%;
  min-height: 3rem;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.lightbox__caption input:hover {
  border-color: var(--accent);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.lightbox__caption input:focus {
  border-color: var(--accent);
  background: var(--paper);
  outline: 1px solid var(--accent);
  outline-offset: 0;
}

.field--quiet textarea {
  background: var(--surface);
}

.add-form {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-muted);
  margin-bottom: 2.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.field--wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.form-actions--notes {
  align-items: end;
}

.field--compact {
  width: min(13rem, 100%);
  margin-left: auto;
}

.who-field {
  display: grid;
  gap: 0.48rem;
}

.who {
  display: inline-flex;
  width: max-content;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.who__opt {
  min-width: 4.8rem;
  padding: 0.56rem 1rem;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease;
}

.who__opt.is-on {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.text-button {
  padding: 0.45rem 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.28rem;
}

.text-button:hover {
  color: var(--accent);
}

.text-button--danger {
  color: var(--danger);
}

/* ---------- Lieder ---------- */

.songs li {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.songs li:first-child {
  border-top: 1px solid var(--line);
}

.song-disc {
  position: relative;
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 0 15%, transparent 16% 19%, rgba(255, 255, 255, 0.16) 20% 21%, transparent 22%),
    repeating-radial-gradient(circle, transparent 0 4px, rgba(255, 255, 255, 0.08) 5px 6px),
    conic-gradient(from 90deg, var(--disc, var(--accent)), #211d16 63%, var(--disc, var(--accent)));
  box-shadow: 0 12px 28px rgba(33, 29, 24, 0.16);
}

button.song-disc {
  cursor: pointer;
}

.songs li:hover .song-disc,
.songs li:focus-within .song-disc {
  animation: disc-spin 7s linear infinite;
}

@keyframes disc-spin {
  to {
    transform: rotate(360deg);
  }
}

.song-main {
  min-width: 0;
}

.song-main h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.song-main .song-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.9rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.song-main .song-note {
  max-width: 46rem;
  margin-top: 0.55rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.98rem;
  font-style: italic;
}

.song-hint {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.67rem;
}

.song-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.55rem;
}

.song-actions a,
.x-btn {
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 600;
  text-decoration: none;
}

.x-btn {
  color: var(--muted);
}

.x-btn:hover {
  color: var(--danger);
}

.song-player {
  display: none;
  grid-column: 1 / -1;
}

.song-player.is-open {
  display: block;
  margin-top: 0.5rem;
}

.song-player iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius-surface);
}

/* ---------- Notizen ---------- */

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.notes li {
  position: relative;
  min-height: 14rem;
  padding: 1.55rem 1.6rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface);
}

.notes li:nth-child(3n + 2) {
  background: var(--surface-muted);
}

.notes .note-kind {
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.notes p.note-text {
  margin: 0.85rem 0 1.25rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notes .note-meta {
  color: var(--muted);
  font-size: 0.7rem;
}

.notes .x-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ---------- Bilder ---------- */

.upload {
  display: grid;
  place-items: center;
  min-height: 10rem;
  margin-bottom: 1.25rem;
  padding: 2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-surface);
  background: var(--surface-muted);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.upload:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.upload span {
  font-family: var(--serif);
  font-size: 1.35rem;
}

.upload small {
  color: var(--muted);
  font-size: 0.7rem;
}

.upload input {
  display: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.photo-grid button {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-muted);
}

.photo-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-grid button:hover img {
  transform: scale(1.025);
}

/* ---------- Listen ---------- */

.lists-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.list-pane {
  min-width: 0;
  padding: clamp(1.4rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface);
}

.list-pane--tasks {
  background: var(--surface-muted);
}

.add-form--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
  margin: 1.25rem 0 0.8rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.bucket li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.4rem;
  border-bottom: 1px solid var(--line);
}

.bucket .tick {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 0.72rem;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.bucket li.is-done .tick {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.bucket .bucket-text {
  font-family: var(--serif);
  font-size: 0.98rem;
  transition: color 180ms ease;
}

.bucket li.is-done .bucket-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--accent);
}

.list-pane .text-button {
  margin-top: 0.7rem;
}

/* ---------- Malen ---------- */

.draw-studio {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-muted);
}

.draw-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.draw-group {
  display: grid;
  gap: 0.55rem;
}

.draw-colors,
.draw-sizes {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.draw-color {
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--c);
  transition: border-color 180ms ease, transform 180ms ease;
}

.draw-color--ink { --c: #211d16; }
.draw-color--terracotta { --c: #b1502f; }
.draw-color--gold { --c: #e8b163; }
.draw-color--blue { --c: #4a6fa5; }
.draw-color--green { --c: #5a7d54; }
.draw-color--pink { --c: #c96f8e; }

.draw-color.is-on {
  border-color: var(--accent);
  transform: scale(1.12);
}

.draw-color--eraser {
  width: auto;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
}

.draw-color--eraser.is-on {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.draw-size {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.draw-size i {
  display: block;
  border-radius: 50%;
  background: var(--muted);
}

.draw-size__dot--small {
  width: 6px;
  height: 6px;
}

.draw-size__dot--medium {
  width: 12px;
  height: 12px;
}

.draw-size__dot--large {
  width: 18px;
  height: 18px;
}

.draw-size.is-on {
  border-color: var(--accent);
}

.draw-size.is-on i {
  background: var(--accent);
}

#draw-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-surface);
  background: #f7f3ea;
  cursor: crosshair;
  touch-action: none;
}

.draw-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
}

/* ---------- Einstellungen ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.sheet.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sheet__panel {
  width: min(38rem, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 2rem 2.2rem 3rem;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.14);
  transform: translateX(2rem);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet.is-open .sheet__panel {
  transform: translateX(0);
}

.sheet__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.sheet__head p {
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
}

.sheet__head h2 {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}

.sheet__close {
  padding: 0.45rem 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.sheet__close:hover {
  color: var(--accent);
}

.sheet__section {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
}

.sheet__section .section-title {
  margin-bottom: 1.1rem;
}

.sheet__section--danger {
  border-bottom: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.sheet__hint {
  max-width: 34rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.sheet__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1rem 2rem;
  padding: 1.5rem;
  background: rgba(15, 13, 18, 0.96);
  color: #eee8dc;
}

.lightbox.is-open {
  display: grid;
}

.lightbox__head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(238, 232, 220, 0.2);
}

.lightbox__head h2 {
  font-size: 1.25rem;
}

.lightbox__close {
  color: #c7c0b5;
  font-size: 0.74rem;
}

.lightbox img {
  grid-column: 1;
  grid-row: 2 / span 2;
  align-self: center;
  justify-self: center;
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
}

.lightbox__caption {
  grid-column: 2;
  align-self: end;
  display: grid;
  gap: 0.55rem;
}

.lightbox__caption span {
  color: #c7c0b5;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox__caption input {
  border-color: rgba(238, 232, 220, 0.35);
  background: #201d24;
  color: #eee8dc;
}

.lightbox__caption input::placeholder {
  color: #aaa39a;
}

.lightbox__delete {
  grid-column: 2;
  align-self: start;
  justify-self: start;
  padding: 0.5rem 0;
  color: #c7c0b5;
  font-size: 0.72rem;
}

.lightbox__delete:hover {
  color: #ec8b78;
}

/* ---------- Toast ---------- */

.app-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-surface);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-soft);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 70;
  padding: 1rem;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

/* ---------- Kleinere Desktops ---------- */

@media (max-width: 1100px) {
  .app {
    width: min(100% - 2.5rem, 68rem);
    grid-template-columns: 12rem minmax(0, 1fr);
    column-gap: 2.5rem;
  }

  .tabbar {
    padding-right: 1.1rem;
  }

  .today-head {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .today-intro {
    padding-bottom: 0;
  }

  .card--days,
  .card--question {
    grid-column: 1 / span 6;
  }

  .countdown-panel,
  .latest {
    grid-column: 7 / -1;
  }

  .lists-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mobile und Tablet ---------- */

@media (max-width: 820px) {
  body {
    background: var(--paper);
  }

  .app {
    display: block;
    width: 100%;
    min-height: 100dvh;
    padding: 0 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }

  .app-top {
    min-height: 4.5rem;
  }

  .app-back span,
  .app-wordmark small {
    display: none;
  }

  .app-settings {
    min-height: 2.2rem;
    padding: 0 0.8rem;
    font-size: 0;
  }

  .app-settings::after {
    content: "Menü";
    font-size: 0.7rem;
  }

  .tabbar {
    position: fixed;
    top: auto;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 20;
    display: block;
    min-height: auto;
    padding: 0.36rem 0.35rem calc(0.38rem + env(safe-area-inset-bottom));
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    box-shadow: 0 14px 42px rgba(33, 29, 24, 0.16);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
  }

  .tabbar__intro,
  .tabbar__privacy {
    display: none;
  }

  .tabbar__items {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
  }

  .tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 2.7rem;
    padding: 0.4rem 0.15rem;
    border-radius: 0.7rem;
    text-align: center;
  }

  .tab::before,
  .tab small {
    display: none;
  }

  .tab span {
    overflow: hidden;
    font-family: var(--sans);
    font-size: clamp(0.55rem, 2.5vw, 0.67rem);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab:hover {
    transform: none;
  }

  .tab.is-active {
    background: var(--accent);
    color: var(--accent-ink);
  }

  .views {
    padding: 2.4rem 0 3rem;
  }

  .view-head {
    display: block;
    margin-bottom: 1.5rem;
  }

  .view-title {
    font-size: clamp(2.7rem, 13vw, 4.4rem);
  }

  .view-sub {
    margin-top: 0.8rem;
    padding-bottom: 0;
    text-align: left;
  }

  .today-head {
    display: block;
    margin-bottom: 2rem;
  }

  .greet {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .today-intro {
    margin-top: 1.2rem;
    font-size: 1rem;
  }

  .today-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .card--days,
  .card--question,
  .countdown-panel,
  .latest {
    grid-column: 1;
  }

  .card--days {
    min-height: 15rem;
  }

  .form-grid,
  .notes,
  .lists-layout {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .form-actions,
  .form-actions--notes {
    align-items: stretch;
    flex-direction: column;
  }

  .field--compact {
    width: 100%;
    margin-left: 0;
  }

  .form-actions .btn {
    width: 100%;
  }

  .songs li {
    grid-template-columns: 3.3rem minmax(0, 1fr);
    gap: 0.9rem;
  }

  .song-disc {
    width: 3.2rem;
    height: 3.2rem;
  }

  .song-actions {
    grid-column: 2;
    align-items: center;
    flex-direction: row;
  }

  .notes li {
    min-height: auto;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .draw-tools {
    align-items: start;
    flex-direction: column;
  }

  .sheet {
    align-items: flex-end;
  }

  .sheet__panel {
    width: 100%;
    height: auto;
    max-height: 92dvh;
    padding: 1.3rem 1.2rem calc(1.8rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 1.2rem 1.2rem 0 0;
    transform: translateY(2rem);
  }

  .sheet.is-open .sheet__panel {
    transform: translateY(0);
  }

  .lightbox {
    display: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    padding: 1rem;
  }

  .lightbox.is-open {
    display: grid;
  }

  .lightbox img {
    grid-column: 1;
    grid-row: 2;
    max-height: 62dvh;
  }

  .lightbox__caption,
  .lightbox__delete {
    grid-column: 1;
  }

  .app-toast {
    right: 1rem;
    bottom: calc(5.8rem + env(safe-area-inset-bottom));
    left: 1rem;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .app-top {
    grid-template-columns: 1fr auto 1fr;
  }

  .app-wordmark {
    font-size: 1.2rem;
  }

  .app-back strong {
    font-size: 1.2rem;
  }

  .today-date {
    margin-bottom: 0.65rem;
  }

  .timeline li {
    grid-template-columns: 2.8rem minmax(0, 1fr);
  }

  .timeline .t-date {
    display: none;
  }

  .add-form--inline {
    grid-template-columns: 1fr;
  }

  .add-form--inline .btn {
    width: 100%;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .draw-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .tabbar {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
