/* Liste — hell & grau-dunkel, leichtes Glas */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #aeaeb2;
  --hair: rgba(0, 0, 0, 0.07);
  --fill: rgba(0, 0, 0, 0.045);
  --gray-fill: rgba(118, 118, 128, 0.12);
  --gray-fill-hover: rgba(118, 118, 128, 0.2);

  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: rgba(0, 113, 227, 0.09);
  --blue-soft-hover: rgba(0, 113, 227, 0.15);
  --blue-edge: rgba(0, 113, 227, 0.45);
  --blue-ring: rgba(0, 113, 227, 0.12);
  --focus-halo: rgba(0, 0, 0, 0.045);
  --focus-edge: rgba(0, 0, 0, 0.12);
  --focus-ring: rgba(0, 0, 0, 0.28);
  --rose: #d70015;
  --rose-soft: rgba(215, 0, 21, 0.07);
  --amber: #a05a00;
  --amber-soft: rgba(255, 159, 10, 0.14);

  --check-edge: #c7c7cc;
  --add-off: #d2d2d7;
  --switch-off: #e5e5ea;
  --row-hover: rgba(255, 255, 255, 0.7);
  --edit-bg: #ffffff;
  --field-bg: rgba(255, 255, 255, 0.85);
  --field-edge: rgba(0, 30, 80, 0.1);
  --field-focus: #ffffff;

  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.56));
  --glass-edge: rgba(255, 255, 255, 0.9);
  --glass-blur: blur(34px) saturate(185%);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(0, 20, 60, 0.03),
    0 0 0 0.5px rgba(0, 20, 60, 0.08),
    0 2px 6px rgba(0, 30, 80, 0.04),
    0 26px 60px -30px rgba(0, 40, 110, 0.26);
  --menu-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.87));
  --menu-shadow: 0 0 0 0.5px rgba(0, 20, 60, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04), 0 22px 50px -16px rgba(0, 30, 80, 0.28);
  --toast-bg: rgba(29, 29, 31, 0.86);

  --sky:
    radial-gradient(70% 55% at 50% -5%, rgba(0, 113, 227, 0.14), transparent 70%),
    radial-gradient(38% 42% at 12% 38%, rgba(94, 170, 255, 0.12), transparent 70%),
    radial-gradient(38% 42% at 88% 30%, rgba(150, 200, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #f3f8ff 0%, #ffffff 72%);

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
          "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif;
}

/* Dunkel – Graphit statt Schwarz */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1e1e21;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --hair: rgba(255, 255, 255, 0.08);
  --fill: rgba(255, 255, 255, 0.07);
  --gray-fill: rgba(118, 118, 128, 0.24);
  --gray-fill-hover: rgba(118, 118, 128, 0.34);

  --blue: #0a84ff;
  --blue-hover: #3396ff;
  --blue-soft: rgba(10, 132, 255, 0.16);
  --blue-soft-hover: rgba(10, 132, 255, 0.24);
  --blue-edge: rgba(10, 132, 255, 0.6);
  --blue-ring: rgba(10, 132, 255, 0.22);
  --focus-halo: rgba(255, 255, 255, 0.06);
  --focus-edge: rgba(255, 255, 255, 0.16);
  --focus-ring: rgba(255, 255, 255, 0.35);
  --rose: #ff6961;
  --rose-soft: rgba(255, 69, 58, 0.14);
  --amber: #ffb340;
  --amber-soft: rgba(255, 159, 10, 0.16);

  --check-edge: #5c5c61;
  --add-off: #414146;
  --switch-off: #48484d;
  --row-hover: rgba(255, 255, 255, 0.04);
  --edit-bg: #2c2c30;
  --field-bg: rgba(255, 255, 255, 0.06);
  --field-edge: rgba(255, 255, 255, 0.1);
  --field-focus: rgba(255, 255, 255, 0.09);

  --glass-bg: linear-gradient(180deg, rgba(64, 64, 70, 0.62), rgba(46, 46, 51, 0.5));
  --glass-edge: rgba(255, 255, 255, 0.08);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 0.5px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.18),
    0 26px 60px -30px rgba(0, 0, 0, 0.7);
  --menu-bg: linear-gradient(180deg, rgba(56, 56, 61, 0.95), rgba(46, 46, 51, 0.92));
  --menu-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 50px -16px rgba(0, 0, 0, 0.7);
  --toast-bg: rgba(78, 78, 84, 0.92);

  --sky: linear-gradient(180deg, #232326 0%, #1e1e21 70%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-bottom: 110px;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 400 17px/1.42 var(--font);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
input:focus-visible { outline: none; }

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--bg); }
}

/* ============ Oben rechts: Design und Initialen ============ */

.topbar {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: calc(28px + env(safe-area-inset-left, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.today {
  margin: 0;
  padding-left: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}

[data-dates="0"] .today,
[data-dates="0"] .due-pick,
[data-dates="0"] .needs-dates { display: none; }

.actions {
  position: relative;
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.initials {
  min-width: 42px;
  height: 42px;
  padding: 0 11px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--gray-fill);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 0.5px var(--hair);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.25s var(--spring);
}
.initials:hover, .initials[aria-expanded="true"] { background: var(--gray-fill-hover); color: var(--ink); }
.initials:active { transform: scale(0.95); }

/* Menü */
.menu {
  position: absolute;
  right: 0;
  top: 52px;
  width: 264px;
  padding: 6px;
  border-radius: 18px;
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
          backdrop-filter: blur(40px) saturate(190%);
  box-shadow: var(--menu-shadow);
  transform-origin: top right;
  animation: pop 0.2s var(--ease) both;
}

.menu-head {
  display: grid;
  gap: 1px;
  padding: 9px 10px 8px 36px;
  min-width: 0;
}
.menu-display {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-user {
  font-size: 13px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-sep { height: 1px; margin: 5px 10px; background: var(--hair); }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 15px;
}
.menu-item:hover { background: var(--fill); }

.view-item .tick { width: 16px; height: 16px; flex: none; stroke-width: 2.4; color: var(--blue); opacity: 0; }
.view-item[aria-pressed="true"] .tick { opacity: 1; }
.view-item span:first-of-type { flex: 1; }
.menu-count { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
[data-count="overdue"]:not(:empty) { color: var(--rose); }

.switch-row { justify-content: space-between; gap: 16px; padding-left: 36px; }
.menu-item.plain { padding-left: 36px; }
#accounts-open span { flex: 1; }
.menu .chev { width: 16px; height: 16px; flex: none; stroke-width: 2.2; color: var(--ink-3); }
.menu-item.back { font-weight: 600; }
.menu-item.back .chev { color: var(--blue); }

.menu-item.account { gap: 12px; }
.menu-item.account span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.account.current { cursor: default; }
.menu-item.account.current:hover { background: none; }
.menu-item.account .tick { width: 16px; height: 16px; flex: none; stroke-width: 2.4; color: var(--blue); }

.mini-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-2);
  background: var(--gray-fill);
}
.mini-avatar svg { width: 16px; height: 16px; stroke-width: 2; }
.add-avatar { color: var(--blue); background: var(--blue-soft); }

.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color 0.25s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.28s var(--spring);
}
.switch-row[aria-checked="true"] .switch { background: var(--blue); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(16px); }

@keyframes pop {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ============ Mitte: Liste, darunter die Eingabe ============ */

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 16px calc(56px + env(safe-area-inset-bottom, 0px));
}

.stack {
  width: min(100%, 760px);
  margin: auto;
  display: flex;
  flex-direction: column;
}

.view-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  margin: 0 0 12px 8px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-soft);
  animation: pop 0.2s var(--ease) both;
  transition: background-color 0.2s var(--ease);
}
.view-chip svg { width: 15px; height: 15px; stroke-width: 2.2; }
.view-chip:hover { background: var(--blue-soft-hover); }

.sheet {
  padding: 8px;
  border-radius: 26px;
  animation: rise 0.6s var(--ease) both;
}

/* Eingabe: etwas schmaler als die Liste, bleibt bei langen Listen unten sichtbar */
.composer {
  position: sticky;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  align-self: center;
  width: min(100%, 600px);
  display: flex;
  align-items: center;
  gap: 6px;
  height: 58px;
  margin-top: 30px;
  padding: 0 10px 0 22px;
  border-radius: 20px;
  animation: rise 0.6s 0.08s var(--ease) both;
  transition: box-shadow 0.2s var(--ease);
}
.composer:focus-within {
  box-shadow: 0 0 0 6px var(--focus-halo), var(--glass-shadow);
}

#new-title {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  padding: 0;
  font-size: 17px;
}
#new-title::placeholder { color: var(--ink-3); }

.due-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.due-pick svg { width: 18px; height: 18px; }
.due-pick:hover { color: var(--ink); background: var(--fill); }
.due-pick.has-date { color: var(--ink-2); background: var(--fill); padding: 0 12px 0 10px; }
#new-due-text:empty { display: none; }

.add {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 10px -4px var(--blue-edge);
  transition: transform 0.25s var(--spring), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.add svg { width: 17px; height: 17px; stroke-width: 2.3; }
.add:disabled { background: var(--add-off); box-shadow: none; cursor: default; }
.add:not(:disabled):hover { transform: scale(1.07); }
.add:not(:disabled):active { transform: scale(0.94); }

/* Aufgaben */

.list { list-style: none; margin: 0; padding: 0; }
.list:empty { display: none; }

.item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 10px 15px 20px;
  border-radius: 18px;
  transition: background-color 0.2s var(--ease);
}
.item:hover { background: var(--row-hover); }
.item + .item::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 12px;
  top: 0;
  height: 1px;
  background: var(--hair);
}
.item:hover::before, .item:hover + .item::before { opacity: 0; }

.check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--check-edge);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background-color 0.22s var(--ease), border-color 0.22s var(--ease);
}
.check svg { width: 14px; height: 14px; stroke-width: 2.6; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 0.3s 0.05s var(--ease); }
.check:hover { border-color: var(--blue); }
.check[aria-checked="true"] { background: var(--blue); border-color: var(--blue); animation: tick 0.4s var(--spring); }
.check[aria-checked="true"] svg { stroke-dashoffset: 0; }

@keyframes tick { from { transform: scale(0.8); } to { transform: none; } }

.title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: 6px;
  transition: color 0.3s var(--ease);
}
.item.completing .title,
.item.is-done .title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--ink-3);
}
.item.is-done .title { cursor: default; }

.title-edit {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  margin: -3px -8px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--edit-bg);
  box-shadow: 0 0 0 1px var(--focus-edge), 0 0 0 4px var(--focus-halo);
  font-size: 17px;
  line-height: 1.42;
}

.due {
  flex: none;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--fill);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.due.is-today   { color: var(--amber); background: var(--amber-soft); }
.due.is-overdue { color: var(--rose);  background: var(--rose-soft); }
.due.is-empty {
  width: 28px;
  height: 28px;
  margin-top: -2px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  color: var(--ink-3);
}
.due.is-empty svg { width: 17px; height: 17px; }
.due.is-empty:hover { color: var(--ink); background: var(--fill); }

.del {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.del svg { width: 17px; height: 17px; }
.del:hover { color: var(--rose); background: var(--rose-soft); }

@media (hover: hover) {
  .item .del, .item .due.is-empty { opacity: 0; }
  .item:hover .del, .item:hover .due.is-empty,
  .item:focus-within .del, .item:focus-within .due.is-empty { opacity: 1; }
}
@media (hover: none) {
  .item .del, .item .due.is-empty { opacity: 0.5; }
}


.empty {
  margin: 0;
  padding: 30px 18px 32px;
  text-align: center;
  font-size: 15px;
  color: var(--ink-3);
}

.item.enter { animation: rise 0.34s var(--ease) both; }
.item.collapsing {
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: height 0.3s var(--ease), padding 0.3s var(--ease), opacity 0.18s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ============ Kalender ============ */

.picker {
  position: fixed;
  z-index: 40;
  width: 300px;
  padding: 12px;
  border-radius: 22px;
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
          backdrop-filter: blur(40px) saturate(190%);
  box-shadow: var(--menu-shadow);
  animation: pop 0.18s var(--ease) both;
}

.picker-quick { display: flex; gap: 6px; }
.picker-quick button {
  flex: 1 1 auto;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--fill);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.picker-quick button:hover { background: var(--gray-fill-hover); }
.picker-quick button[aria-pressed="true"] { color: var(--blue); background: var(--blue-soft); }

.picker-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 12px 0 4px;
  padding-left: 6px;
}
.picker-month { flex: 1; font-size: 15px; font-weight: 600; }
.picker-nav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  transition: background-color 0.2s var(--ease);
}
.picker-nav:hover { background: var(--fill); }
.picker-nav svg { width: 18px; height: 18px; stroke-width: 2.2; }

.picker-week,
.picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.picker-week span {
  padding: 6px 0 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.picker-grid { row-gap: 2px; }

.day {
  justify-self: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.day:hover { background: var(--fill); }
.day.other { color: var(--ink-3); }
.day[aria-current="date"] { color: var(--blue); font-weight: 600; }
.day[aria-pressed="true"] { color: #fff; background: var(--blue); font-weight: 600; }
.day:focus-visible { outline: none; background: var(--gray-fill-hover); }
.day[aria-pressed="true"]:focus-visible { background: var(--blue); }

.picker-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}
.picker-clock { flex: none; width: 18px; height: 18px; margin: 0 2px 0 4px; color: var(--ink-3); }
.picker-time button,
.picker-time-input {
  height: 32px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: var(--fill);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.picker-time button { flex: none; padding: 0 10px; }
.picker-time button:hover { background: var(--gray-fill-hover); }
.picker-time button[aria-pressed="true"] { color: var(--blue); background: var(--blue-soft); }
.picker-time-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0 8px;
  border: 0;
  outline: none;
  text-align: center;
  color: var(--ink);
}
.picker-time-input::placeholder { color: var(--ink-3); font-weight: 500; }
.picker-time-input:focus { background: var(--field-focus); box-shadow: 0 0 0 1px var(--focus-edge), 0 0 0 4px var(--focus-halo); }
.picker-time-input.is-set { color: var(--blue); background: var(--blue-soft); }

.picker-clear {
  width: 100%;
  height: 36px;
  margin-top: 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--rose);
  transition: background-color 0.2s var(--ease);
}
.picker-clear:hover { background: var(--rose-soft); }

/* ============ Anmeldung ============ */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--sky);
  animation: fade 1.2s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 46px 36px 28px;
  border-radius: 32px;
  text-align: center;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  animation: rise 0.7s 0.08s var(--ease) both;
}
.auth-card.shake { animation: shake 0.42s var(--ease); }

@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.app-mark {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(155deg, #5aaeff 0%, #0a7cf0 55%, #0066d6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.08),
              0 14px 28px -14px rgba(0, 113, 227, 0.7);
}
.app-mark::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
}
.app-mark svg { position: relative; width: 44px; height: 44px; stroke-width: 2; }
.app-mark .mark-dot { stroke-width: 1.8; opacity: 0.75; }
.app-mark .mark-line.faint { opacity: 0.6; }

.auth-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.auth-sub {
  margin: 10px auto 28px;
  max-width: 28ch;
  font-size: 15px;
  color: var(--ink-2);
}

.fields { display: grid; gap: 10px; }

.field {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--field-edge);
  background: var(--field-bg);
  font-size: 17px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.field::placeholder { color: var(--ink-3); }
.field:focus {
  background: var(--field-focus);
  border-color: var(--focus-edge);
  box-shadow: 0 0 0 4px var(--focus-halo);
}

.auth-error {
  min-height: 20px;
  margin: 12px 0 8px;
  font-size: 14px;
  color: var(--rose);
}

.primary {
  position: relative;
  width: 100%;
  height: 50px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.primary:hover { background: var(--blue-hover); }
.primary:active { transform: scale(0.985); }
.primary[aria-busy="true"] { color: transparent; pointer-events: none; }
.primary[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn {
  margin-top: 16px;
  padding: 6px 10px;
  font-size: 15px;
  color: var(--blue);
  border-radius: 8px;
}
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============ Dialoge ============ */

.dialog {
  width: min(100% - 32px, 400px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
:root[data-theme="dark"] .dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog[open] .dialog-card { animation: pop 0.24s var(--ease) both; }

.dialog-card {
  padding: 30px 26px 24px;
  border-radius: 28px;
  background: var(--menu-bg);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
.dialog-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.dialog-sub { margin: 6px 0 22px; font-size: 15px; color: var(--ink-2); }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .primary { flex: 1.3; }

.secondary {
  flex: 1;
  height: 50px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 17px;
  font-weight: 500;
  transition: background-color 0.2s var(--ease);
}
.secondary:hover { background: var(--gray-fill-hover); }

/* Weitere angemeldete Konten auf der Anmeldeseite */
.saved {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  display: grid;
  gap: 4px;
}
.saved-acc {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  text-align: left;
  font-size: 15px;
  transition: background-color 0.2s var(--ease);
}
.saved-acc span:nth-child(2) { flex: 1; }
.saved-acc:hover { background: var(--fill); }
.saved-acc .chev { width: 16px; height: 16px; stroke-width: 2.2; color: var(--ink-3); }

/* ============ Hinweis ============ */

.toast {
  position: fixed;
  left: 50%;
  top: calc(24px + env(safe-area-inset-top, 0px));
  z-index: 50;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  color: #fff;
  font-size: 15px;
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Klein ============ */

@media (max-width: 560px) {
  .topbar { left: 16px; right: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); }
  .shell { padding-inline: 12px; padding-top: calc(80px + env(safe-area-inset-top, 0px)); }
  .sheet { padding: 6px; border-radius: 22px; }
  .composer { width: calc(100% - 16px); padding-left: 18px; }
  .item { padding-left: 16px; gap: 12px; }
  .item + .item::before { left: 50px; }
  .auth-card { padding: 40px 24px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
