:root {
  color-scheme: light;
  --ink: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --sep: rgba(60, 60, 67, .29);
  --grouped: #f2f2f7;
  --cell: #ffffff;
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --tint: var(--blue);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  position: fixed;
  inset: 0;
  margin: 0;
  background: #2a3a8c;
  font-family: var(--font);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 3px solid rgba(0, 122, 255, .6); outline-offset: 2px; }

/* ---------- Device (Mobile = Vollbild) ---------- */

.device {
  position: relative;
  width: 100%;
  height: 100%;
}


.phone {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wallpaper, linear-gradient(160deg, #1d2b64 0%, #6b3fa0 55%, #f8a07a 100%));
  background-size: cover;
  background-position: center;
}

/* ---------- Statusleiste ---------- */

.statusbar {
  flex: none;
  height: calc(44px + env(safe-area-inset-top));
  min-height: 44px;
  padding: calc(14px + env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) 0 max(30px, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  position: relative;
  z-index: 30;
  transition: color .2s;
}

.status-icons { display: inline-flex; align-items: center; gap: 6px; }
.status-icons .sig rect { fill: currentColor; }
.status-icons .sig rect:last-child { opacity: .35; }
.lte { font-size: 14px; font-weight: 700; }
.battery { display: inline-flex; align-items: center; gap: 1px; }
.battery-body {
  width: 25px; height: 12px;
  border: 1.2px solid currentColor;
  border-radius: 4px;
  padding: 1.5px;
  opacity: .9;
}
.battery-level { display: block; width: 86%; height: 100%; border-radius: 2px; background: currentColor; }
.battery-cap { width: 1.8px; height: 4.5px; border-radius: 0 1px 1px 0; background: currentColor; opacity: .5; }

.phone:has(#app-screen.active) .statusbar { color: #000; }
.phone:has(#app-screen.active) .statusbar { background: var(--grouped); }
.phone:has(#app-screen.active[data-app="messages"]) .statusbar,
.phone:has(#app-screen.active[data-app="emails"]) .statusbar,
.phone:has(#app-screen.active.is-detail[data-app="notes"]) .statusbar { background: #fff; }
.phone:has(#app-screen.active[data-app="gallery"]) .statusbar { background: #000; }
.phone:has(#app-screen.active[data-app="gallery"]) .statusbar { color: #fff; }

/* ---------- Screens ---------- */

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.screen.active { display: flex; flex-direction: column; }

/* ---------- Homebildschirm ---------- */

#home {
  overscroll-behavior: contain;
  padding: 18px max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  overflow-y: auto;
  animation: fade-in .25s ease;
}

.widget {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 26px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}

.widget p { margin: 0; }
.widget-weekday {
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.widget-day { font-size: 46px; font-weight: 300; line-height: 1.05; letter-spacing: -.02em; }
.widget .date { color: var(--label-2); font-size: 14px; font-weight: 500; }

.app-grid {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 0;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transition: transform .12s ease;
}

.app-icon:active { transform: scale(.9); }

.symbol {
  width: 62px;
  height: 62px;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18), inset 0 0 0 .5px rgba(0, 0, 0, .08);
}

.symbol svg { display: block; width: 100%; height: 100%; }

.home-bottom {
  margin-top: auto;
  flex: none;
  padding-top: 16px;
  padding-bottom: max(12px, calc(8px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}


.pill-switch {
  position: relative;
  height: 30px;
  width: 118px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transform: translateZ(0);
}
.pill-a, .pill-b {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  animation: pill-a 9s infinite;
  will-change: opacity;
}
.pill-b { animation-name: pill-b; }
@keyframes pill-a { 0%, 44% { opacity: 1; visibility: visible; } 50%, 94% { opacity: 0; visibility: hidden; } 100% { opacity: 1; visibility: visible; } }
@keyframes pill-b { 0%, 44% { opacity: 0; visibility: hidden; } 50%, 94% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
.pill-switch:hover > *, .pill-switch:focus-within > * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .pill-switch { width: auto; display: flex; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; gap: 8px; }
  .pill-a, .pill-b { animation: none; width: auto; border-radius: 999px; background: rgba(255, 255, 255, .22); }
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.dock {
  transform: translateZ(0);
  width: 100%;
  max-width: 372px;
  display: flex;
  justify-content: space-around;
  padding: 15px 14px;
  border-radius: 34px;
  background: rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
}

.dock .label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- App-Screen ---------- */

#app-screen {
  background: var(--grouped);
  animation: app-open .28s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}

#app-screen[data-app="notes"] { --tint: #d9a400; }
#app-screen[data-app="messages"],
#app-screen[data-app="emails"] { background: #fff; }
#app-screen[data-app="gallery"] { background: #000; color: #fff; }

.app-header {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 max(16px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left));
  background: inherit;
  position: relative;
  z-index: 2;
}

.back-button {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--tint);
  font-size: 17px;
  letter-spacing: -.02em;
}

#app-screen[data-app="gallery"] .back-button { color: #fff; }

.app-header h2 {
  grid-column: 1 / -1;
  margin: 2px 0 6px 6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.15;
}

#app-screen.is-detail .app-header { border-bottom: .5px solid var(--sep); padding-bottom: 0; }
#app-screen[data-app="gallery"].is-detail .app-header { border-bottom-color: #2c2c2e; }
#app-screen.is-detail .app-header h2 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0 6px; font-size: 12px; font-weight: 500; }

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-overflow-scrolling: touch;
}

/* ---------- Gemeinsame Bausteine ---------- */

.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.title { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.meta { color: var(--label-2); font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.preview { color: var(--label-2); font-size: 15px; line-height: 1.3; }
.chev { color: rgba(60, 60, 67, .3); flex: none; }

.blocked {
  margin: 22px 0 8px;
  text-align: center;
  color: var(--label-2);
  font-size: 13px;
}

#app-screen[data-app="gallery"] .blocked,
#app-screen[data-app="gallery"] .meta { color: #8e8e93; }

.section-label {
  margin: 4px 4px 8px;
  color: var(--label-2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.list {
  display: flex;
  flex-direction: column;
  background: var(--cell);
  border-radius: 12px;
  overflow: hidden;
}

.list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: var(--cell);
  text-align: left;
  padding: 11px 16px;
  color: var(--ink);
  position: relative;
}

.list-item:active,
.message-thread:active,
.note-card:active { background: #e5e5ea; }

.list-item + .list-item::before,
.message-thread + .message-thread::before,
.note-card + .note-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--inset, 16px);
  border-top: .5px solid var(--sep);
}

/* Avatare */
.avatar-circle {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #a8adb8, #858a95);
  color: #fff;
  font-weight: 600;
  letter-spacing: .02em;
  overflow: hidden;
}
.avatar-circle.xs { width: 34px; height: 34px; font-size: 13px; }
.avatar-circle.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar-circle.md { width: 50px; height: 50px; font-size: 19px; }
.avatar-circle.xl { width: 104px; height: 104px; font-size: 40px; margin: 8px auto 12px; }
.avatar-circle.has-logo { background: #fff; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.avatar-circle.has-logo img { width: 72%; height: auto; }

/* ---------- E-Mails ---------- */

#app-screen[data-app="emails"] .app-content { padding-left: 0; padding-right: 0; }
.mail-list { border-radius: 0; }
.mail-row { align-items: flex-start; padding: 11px 16px 12px 8px; --inset: 30px; }
.unread-dot { flex: none; width: 10px; height: 10px; margin: 6px 2px 0; border-radius: 50%; background: var(--blue); }
.mail-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.subject { font-size: 15px; color: #000; }
.mail-row .preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-detail { padding: 8px 16px 0; }
.mail-head { display: flex; gap: 12px; align-items: center; padding: 6px 0 14px; border-bottom: .5px solid var(--sep); }
.mail-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-head-text .meta { font-size: 14px; }
.mail-detail h3 { margin: 16px 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.mail-text { font-size: 17px; line-height: 1.45; }

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

.notes-list { display: flex; flex-direction: column; background: var(--cell); border-radius: 12px; overflow: hidden; }
.note-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0;
  padding: 11px 16px;
  text-align: left;
  background: var(--cell);
  color: var(--ink);
  position: relative;
}
.note-sub { display: flex; gap: 6px; min-width: 0; }
.note-sub .meta { color: #000; font-size: 15px; }
.note-sub .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#app-screen[data-app="notes"].is-detail { background: #fff; }
.note-editor { display: flex; flex-direction: column; gap: 6px; min-height: 100%; }
.note-date { margin: 4px 0 0; text-align: center; color: var(--label-2); font-size: 13px; }
.note-title-input, .note-body-input { width: 100%; border: 0; background: transparent; color: #000; outline: none; padding: 0; }
.note-title-input { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.note-body-input { flex: 1; min-height: 320px; resize: none; font-size: 17px; line-height: 1.45; }
.save-state { margin: 0; color: var(--label-2); font-size: 13px; }

/* ---------- Nachrichten ---------- */

#app-screen[data-app="messages"] .app-content { padding-left: 0; padding-right: 0; }
.message-list { display: flex; flex-direction: column; }
.message-thread {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  padding: 10px 16px;
  text-align: left;
  background: #fff;
  color: var(--ink);
  position: relative;
  --inset: 78px;
}
.thread-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.message-thread .preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#app-screen[data-app="messages"].is-detail .app-content { padding: 0; overflow: hidden; }
.conversation { height: 100%; display: flex; flex-direction: column; }
.bubble-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 14px;
  overscroll-behavior: contain;
}
.chat-load-note { margin: 4px 0 12px; }

.bubble-wrap { display: flex; flex-direction: column; max-width: 76%; margin-bottom: 6px; }
.bubble-wrap.in { align-self: flex-start; align-items: flex-start; }
.bubble-wrap.out { align-self: flex-end; align-items: flex-end; }

.bubble {
  position: relative;
  padding: 8px 13px;
  border-radius: 19px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.01em;
  word-wrap: break-word;
}
.bubble p { margin: 0; }
.bubble.in { background: #e9e9eb; color: #000; border-bottom-left-radius: 6px; }
.bubble.out { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble-meta { margin: 3px 6px 0; font-size: 11px; color: var(--label-2); }

.message-form {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(249, 249, 249, .94);
  border-top: .5px solid var(--sep);
  position: relative;
}
.message-form input {
  flex: 1;
  min-height: 36px;
  border: 1px solid #c7c7cc;
  border-radius: 18px;
  padding: 0 44px 0 14px;
  background: #fff;
  font-size: 17px;
  outline: none;
}
.message-form button {
  position: absolute;
  right: 16px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
}

/* ---------- Kontakte / Anrufe ---------- */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  margin: 0 0 16px;
  border-radius: 9px;
  background: rgba(118, 118, 128, .12);
}
.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #000;
  font-size: 13px;
  font-weight: 600;
}
.segmented button.selected { background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }

.contact-row { --inset: 68px; padding: 8px 16px; }
.contact-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contact-body .preview { font-size: 13px; }

.call-item { --inset: 44px; padding: 9px 12px 9px 16px; }
.call-dir { width: 16px; color: #8e8e93; flex: none; }
.call-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.call-body .preview { font-size: 13px; }
.call-item .meta { font-size: 14px; }
.info-icon { color: var(--blue); display: grid; place-items: center; flex: none; }
.call-item.missed .title { color: var(--red); }

.detail { background: transparent; }
.contact-detail { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6px; }
.contact-detail h3 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.company { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }

.contact-actions { display: flex; gap: 8px; margin: 18px 0 4px; }
.action-btn {
  min-width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px 8px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
}

.call-details {
  width: 100%;
  margin: 18px 0 0;
  padding: 0 16px;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.call-details div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.call-details div + div { border-top: .5px solid var(--sep); }
.call-details dt { color: #000; font-size: 15px; }
.call-details dd { margin: 0; color: var(--label-2); font-size: 15px; }

.company-logo {
  width: 100%;
  margin-top: 16px;
  padding: 22px 26px;
  border-radius: 12px;
  background: #fff;
}
.company-logo img { display: block; width: 100%; height: auto; }

/* ---------- Galerie ---------- */

#app-screen[data-app="gallery"] .app-content { padding-left: 0; padding-right: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 16px 10px; }
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-label:focus-within { outline: 3px solid rgba(0, 122, 255, .6); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.photo { margin: 0; position: relative; overflow: hidden; background: #1c1c1e; cursor: pointer; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.delete-photo {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.photo-viewer { padding: 0 16px; }
.photo-viewer img { display: block; width: calc(100% + 32px); margin: 0 -16px 14px; max-height: 460px; object-fit: contain; background: #000; }
.photo-viewer h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.photo-viewer .meta { display: block; white-space: normal; word-break: break-all; }
.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 59, 48, .16);
  color: #ff453a;
  font-size: 15px;
  font-weight: 600;
}

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

.settings-list { display: flex; flex-direction: column; gap: 22px; }
.account-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
}
.account-card > div:not(.account-avatar) { flex: 1; min-width: 0; }
.account-card h3 { margin: 0 0 2px; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.account-card .meta { font-size: 13px; }
.account-avatar {
  width: 62px;
  height: 62px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #a8adb8, #858a95);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
}
.account-photo { object-fit: cover; }

.settings-section { overflow: hidden; border-radius: 12px; background: #fff; }
.settings-row {
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  font-size: 17px;
  position: relative;
}
.settings-row + .settings-row::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 16px;
  border-top: .5px solid var(--sep);
}
.settings-row strong { color: var(--label-2); font-weight: 400; text-align: right; }

/* ---------- Animationen ---------- */

@keyframes app-open {
  from { transform: scale(.94); opacity: 0; border-radius: 40px; }
  to { transform: none; opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  #app-screen, #home { animation: none; }
}


/* Breite Bildschirme: Inhalt nicht unendlich strecken */
@media (min-width: 820px) {
  .app-header, .app-content > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
}

/* ---------- Badge ---------- */

.app-icon { position: relative; }
.badge {
  position: absolute;
  top: -6px;
  right: calc(50% - 40px);
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: none;
  z-index: 2;
}
.badge[hidden] { display: none; }

/* ---------- Mail: Suche, Ungelesen, Anhänge ---------- */

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 12px;
  padding: 0 10px;
  min-height: 36px;
  border-radius: 10px;
  background: rgba(118, 118, 128, .12);
  color: rgba(60, 60, 67, .6);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 17px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::-webkit-search-cancel-button { opacity: .5; }

.mail-row .unread-dot { visibility: hidden; }
.mail-row.unread .unread-dot { visibility: visible; }
.mail-row.unread .title { font-weight: 700; }
.clip { color: rgba(60, 60, 67, .5); display: inline-flex; }

.mail-text p { margin: 0 0 14px; white-space: pre-line; }

.attachments { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 20px; }
.attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  background: #f9f9fb;
  text-align: left;
}
.attachment:active { background: #ececf0; }
.att-thumb {
  flex: none;
  width: 46px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .1);
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.att-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-name { font-size: 15px; font-weight: 600; color: #000; word-break: break-all; }
.attachment .meta { font-size: 13px; }

/* Quick-Look-Ansicht */
#app-screen.viewer { background: #e5e5ea; }
#app-screen.viewer .app-header { background: rgba(249, 249, 249, .96); }
#app-screen[data-app="emails"].viewer .app-content { padding: 16px 12px 34px; }
.quicklook { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ql-page {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.ql-open {
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.phone:has(#app-screen.active.viewer) .statusbar { background: rgba(249, 249, 249, .96); }

/* ---------- Notizen: Toolbar ---------- */

#app-screen[data-app="notes"] .app-content { display: flex; flex-direction: column; padding-bottom: 0; }
#app-screen[data-app="notes"].is-detail .app-content { padding-bottom: 12px; }
.bottom-toolbar {
  position: sticky;
  bottom: 0;
  margin: auto -16px 0;
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: rgba(242, 242, 247, .94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: .5px solid var(--sep);
}
.toolbar-count { text-align: center; font-size: 12px; color: #000; }
.toolbar-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--tint);
}
.note-foot { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Galerie: Blättern ---------- */

.photo-stage { position: relative; margin: 0 -16px 14px; background: #000; touch-action: pan-y; }
.photo-stage img { margin: 0 !important; width: 100% !important; }
.stage-nav {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.stage-nav.prev { left: 10px; }
.stage-nav.next { right: 10px; }

/* ---------- Statusleiste: Flugmodus ---------- */
.status-icons .plane { display: none; }
body.airplane .status-icons .plane { display: block; }
body.airplane .status-icons .sig, body.airplane .status-icons .lte { display: none; }

/* ---------- Sperrbildschirm ---------- */
.lock {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(64px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, .18), rgba(0, 0, 0, .18)),
    var(--wallpaper, linear-gradient(160deg, #1d2b64 0%, #6b3fa0 55%, #f8a07a 100%));
  background-size: cover;
  background-position: center;
  transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .32s;
}
.lock[hidden] { display: none; }
.lock.unlocking, .lock.locking { transform: translateY(-100%); opacity: 0; }
#clock { cursor: pointer; }
.set-icon.dark { background: #1c1c1e; }
.lock-top { display: flex; flex-direction: column; align-items: center; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.lock-icon { opacity: .9; margin-bottom: 10px; }
.lock-date { margin: 0; font-size: 20px; font-weight: 600; }
.lock-time { margin: -4px 0 0; font-size: 92px; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lock-notes {
  width: 100%;
  max-width: 400px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.notif {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 20px;
  text-align: left;
  color: #000;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  animation: notif-in .5s both;
}
.notif:nth-child(2) { animation-delay: .08s; }
.notif:nth-child(3) { animation-delay: .16s; }
@keyframes notif-in { from { opacity: 0; transform: translateY(16px); } }
.ni { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.ni svg { width: 26px; height: 26px; display: block; }
.ni-messages { background: linear-gradient(180deg, #5bf675, #21c24a); }
.ni-mail { background: linear-gradient(180deg, #57b9ff, #1a73f0); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-body .title { font-size: 15px; }
.notif-time { font-size: 13px; color: rgba(60, 60, 67, .7); }
.notif-text { font-size: 15px; line-height: 1.3; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.unlock-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 40px 4px;
  border: 0;
  background: none;
  color: #fff;
}
.unlock-text { font-size: 14px; font-weight: 500; opacity: .85; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(-4px); opacity: .6; } }
.unlock-bar { width: 140px; height: 5px; border-radius: 3px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .unlock-text, .notif { animation: none; } .lock { transition: none; } }

/* ---------- Spotlight ---------- */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: calc(56px + env(safe-area-inset-top)) 12px 12px;
  background: rgba(20, 20, 30, .45);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  animation: fade-in .2s ease;
}
.spotlight[hidden] { display: none; }
.spot-bar { display: flex; align-items: center; gap: 10px; }
.spot-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
  color: rgba(60, 60, 67, .6);
}
.spot-field input { flex: 1; min-width: 0; border: 0; background: none; color: #000; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
.spot-cancel { border: 0; background: none; color: #fff; font-size: 17px; padding: 8px 2px; }
.spot-results { flex: 1; overflow-y: auto; padding: 14px 2px 20px; }
.spot-label { margin: 10px 6px 6px; color: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.spot-group { border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .8); }
.spot-item { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; color: #000; position: relative; }
.spot-item + .spot-item::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: .5px solid var(--sep); }
.spot-item .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.spot-empty { color: rgba(255, 255, 255, .85); text-align: center; margin-top: 30px; }

/* ---------- Einstellungen: Schalter & Icons ---------- */
.row-label { display: inline-flex; align-items: center; gap: 12px; }
.set-icon { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.set-icon.orange { background: #ff9500; }
.set-icon.green { background: #34c759; }
.set-icon.gray { background: #8e8e93; }
.set-icon.blue { background: #007aff; }
.nav-row { width: 100%; border: 0; background: #fff; color: #000; text-align: left; text-decoration: none; }
.switch {
  -webkit-appearance: none;
  appearance: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 16px;
  background: rgba(120, 120, 128, .16);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
  transition: transform .2s;
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }

/* Nachrichten im Flugmodus */
.bubble-wrap.failed .bubble.out { background: #8ab8f2; }
.bubble-wrap.failed .bubble-meta { color: var(--red); }

/* Galerie-Umschalter dunkel */
.segmented.dark { margin: 0 16px 12px; background: rgba(118, 118, 128, .24); }
.segmented.dark button { color: #fff; }
.segmented.dark button.selected { background: #636366; box-shadow: none; }
.file-label[hidden] { display: none; }
.delete-photo.restore { background: rgba(0, 122, 255, .85); }
.danger-button.restore { background: rgba(0, 122, 255, .2); color: #409cff; }

/* ---------- Eigene Dialoge (iOS-Alert) ---------- */
.alert-layer {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .32);
  animation: alert-bg .18s ease;
}
.alert-layer.closing { opacity: 0; transition: opacity .16s; }
.alert {
  width: 270px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(242, 242, 247, .92);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  text-align: center;
  animation: alert-in .22s cubic-bezier(.2, .9, .3, 1.2);
}
.alert-text { padding: 19px 16px 17px; }
.alert-title { margin: 0; font-size: 17px; font-weight: 600; color: #000; }
.alert-msg { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: #000; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid rgba(60, 60, 67, .36); }
.alert-btn {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 17px;
}
.alert-btn + .alert-btn { border-left: .5px solid rgba(60, 60, 67, .36); }
.alert-btn.strong { font-weight: 600; }
.alert-btn.destructive { color: var(--red); font-weight: 600; }
.alert-btn:active { background: rgba(0, 0, 0, .08); }
@keyframes alert-bg { from { opacity: 0; } }
@keyframes alert-in { from { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .alert, .alert-layer { animation: none; } }

/* ---------- Am Handy: keine nachgebaute Uhrzeit/LTE, nur Abstand oben ---------- */
@media (hover: none) and (pointer: coarse) {
  .statusbar {
    height: max(24px, env(safe-area-inset-top));
    min-height: 0;
    padding: 0;
  }
  .statusbar > * { display: none; }
}

/* ---------- Echtes Handy: keine nachgebaute Uhrzeit, nur Abstand ---------- */
@media (hover: none) and (pointer: coarse) {
  .statusbar { display: none; }
  #home { padding-top: max(22px, calc(env(safe-area-inset-top) + 12px)); }
  #app-screen { padding-top: max(10px, env(safe-area-inset-top)); }
  .lock { padding-top: max(44px, calc(env(safe-area-inset-top) + 28px)); }
  .spotlight { padding-top: max(20px, calc(env(safe-area-inset-top) + 10px)); }
}

.row-end { display: inline-flex; align-items: center; gap: 8px; }
.settings-row strong { max-width: 62%; }
.settings-row > span:first-child { white-space: nowrap; flex: none; }
.row-end strong { max-width: none; white-space: nowrap; }
.settings-row strong { font-size: 15px; }

/* =================== Spaß-Extras =================== */

/* zweite Icon-Reihe etwas enger */
.app-grid { row-gap: 20px; }

/* Einstellungen: weitere Icon-Farben */
.set-icon.purple { background: #af52de; }
.set-icon.pink { background: #ff2d55; }
.set-icon.teal { background: #30b0c7; }
.alert-btn.single { grid-column: 1 / -1; }

/* Käufe: Effekte */
body.x-gold .app-icon .symbol { box-shadow: 0 0 0 2.5px #f5c542, 0 0 16px rgba(245, 197, 66, .9), 0 2px 8px rgba(0, 0, 0, .2); }
body.x-gold .app-icon .label::after { content: " ✨"; }
body.x-gold .dock .label::after { content: ""; }
body.x-wackel #home .app-icon { animation: wackel .28s ease-in-out infinite alternate; }
body.x-wackel #home .app-icon:nth-child(2n) { animation-delay: -.14s; }
@keyframes wackel { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
body.x-rainbow .phone::before, body.x-rainbow .lock { animation: rainbow 12s linear infinite; }
@keyframes rainbow { to { filter: hue-rotate(360deg); } }
body.x-comic .lock-time { font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive; font-weight: 700; }
body.x-akku .battery-level { width: 100%; background: #34c759; }
body.x-nogravity #home .app-icon { animation: schweben 3.2s ease-in-out infinite alternate; }
body.x-nogravity #home .app-icon:nth-child(3n) { animation-duration: 2.6s; animation-delay: -1s; }
body.x-nogravity #home .app-icon:nth-child(2n) { animation-duration: 3.8s; animation-delay: -2s; }
@keyframes schweben { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-14px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) {
  body.x-wackel #home .app-icon, body.x-nogravity #home .app-icon, body.x-rainbow .phone::before, body.x-rainbow .lock { animation: none; }
}

/* Konfetti */
.confetti { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: fall 1.6s cubic-bezier(.25, .6, .5, 1) forwards;
}
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: .9; } }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom));
  z-index: 75;
  transform: translateX(-50%);
  max-width: 86%;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(30, 30, 30, .88);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2);
  transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- Shop ---------- */
.shop-hero {
  margin-bottom: 16px;
  padding: 20px 18px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #1a6dff, #8e44ff 60%, #ff4f8b);
}
.shop-hero p { margin: 0; }
.shop-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.shop-headline { font-size: 26px; font-weight: 800; line-height: 1.1; margin: 4px 0 8px !important; }
.shop-sub { font-size: 15px; opacity: .92; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; background: #fff; }
.shop-row + .shop-row::before { content: ""; position: absolute; top: 0; right: 0; left: 62px; border-top: .5px solid var(--sep); }
.shop-emoji { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #f2f2f7; font-size: 20px; }
.shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.shop-text .title { font-size: 16px; }
.shop-text .preview { font-size: 13px; }
.price-pill {
  flex: none;
  min-width: 74px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}
.price-pill.owned { display: inline-grid; place-items: center; background: #e7f8ec; color: #1f8f3a; }
.link-btn { display: block; margin: 16px auto 0; min-height: 44px; border: 0; background: none; color: var(--blue); font-size: 16px; }

/* Kauf-Sheet */
.sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .35);
  animation: alert-bg .2s ease;
}
.sheet-layer.closing { opacity: 0; transition: opacity .2s; }
.buy-sheet {
  width: 100%;
  padding: 14px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: #f2f2f7;
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.buy-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 700; }
.buy-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #e3e3e8; color: #3c3c43; font-size: 14px; }
.buy-item { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px; border-radius: 12px; background: #fff; }
.buy-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 11px; background: #f2f2f7; font-size: 26px; }
.buy-text { display: flex; flex-direction: column; gap: 2px; }
.buy-rows { padding: 0 14px; border-radius: 12px; background: #fff; }
.buy-rows div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; font-size: 15px; }
.buy-rows div + div { border-top: .5px solid var(--sep); }
.buy-rows span { color: var(--label-2); }
.buy-rows strong { font-weight: 600; text-align: right; word-break: break-all; }
.buy-state { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; min-height: 96px; }
.buy-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}
.buy-btn:disabled { opacity: .5; }
.buy-hint { margin: 0; font-size: 13px; color: var(--label-2); text-align: center; }
.faceid {
  width: 54px;
  height: 54px;
  border: 3px solid var(--blue);
  border-radius: 14px;
  position: relative;
  animation: faceid 1.3s ease-in-out;
}
.faceid::before { content: ""; position: absolute; inset: 14px 12px 22px; border-left: 3px solid var(--blue); border-right: 3px solid var(--blue); }
.faceid::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 11px; height: 7px; border-bottom: 3px solid var(--blue); border-radius: 0 0 10px 10px; }
@keyframes faceid { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); } }
.buy-done { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #34c759; color: #fff; font-size: 30px; font-weight: 700; animation: alert-in .25s; }

/* ---------- Blubberfolie ---------- */
#app-screen[data-app="bubbles"] { background: #e8f6ff; }
.bubble-stats { margin: 0 0 12px; text-align: center; color: #1b5e86; font-size: 15px; }
.bubble-stats span { font-weight: 800; }
.bubble-sheet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 0 0 1px rgba(124, 198, 240, .6);
}
.wrap-bubble {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 14%, #dff3ff 30%, #a9dcf7 100%);
  box-shadow: inset -2px -3px 6px rgba(80, 160, 210, .35), 0 2px 4px rgba(60, 130, 180, .25);
  transition: transform .08s;
}
.wrap-bubble:active { transform: scale(.88); }
.wrap-bubble.popped {
  background: radial-gradient(circle, rgba(169, 220, 247, .25) 0 60%, transparent 62%);
  box-shadow: inset 0 0 0 1px rgba(124, 198, 240, .5);
  transform: scale(.82);
}
.bubble-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.bubble-foot .meta { white-space: normal; text-align: center; }

/* ---------- Münzwurf ---------- */
#app-screen[data-app="coin"] { background: #1c1c1e; color: #fff; }
#app-screen[data-app="coin"] .back-button { color: #ffd60a; }
.coin-app { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 20px; }
.coin-stage { perspective: 800px; padding: 20px; }
.coin { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #ffe89a, #f5c542 45%, #c9961a);
  box-shadow: inset 0 0 0 7px #d9a526, inset 0 0 0 9px #b8870f, 0 12px 30px rgba(0, 0, 0, .5);
  color: #7a5200;
  font-size: 30px;
  font-weight: 800;
}
.coin-face.back { transform: rotateY(180deg); }
.coin-result { margin: 0; font-size: 28px; font-weight: 700; min-height: 36px; }
.coin-btn { max-width: 260px; background: #ffd60a; color: #1c1c1e; }
.coin-stats { margin: 0; color: #aeaeb2; font-size: 15px; }
#app-screen[data-app="coin"] .blocked { color: #8e8e93; }
@media (prefers-reduced-motion: reduce) { .coin { transition-duration: .01s; } }

/* ---------- Taschenlampe ---------- */
#app-screen[data-app="torch"] { background: #000; color: #fff; transition: background .2s; }
#app-screen[data-app="torch"] .back-button { color: #fff; }
#app-screen[data-app="torch"].torch-on { background: #fff; color: #000; }
#app-screen[data-app="torch"].torch-on .back-button { color: var(--blue); }
.torch-app { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding-bottom: 60px; }
.torch-btn {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #2c2c2e;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.torch-on .torch-btn { background: #ffd60a; color: #000; box-shadow: 0 0 60px rgba(255, 214, 10, .8); }
.torch-hint { max-width: 280px; margin: 0; text-align: center; font-size: 14px; opacity: .6; }
.phone:has(#app-screen.active[data-app="torch"]) .statusbar,
.phone:has(#app-screen.active[data-app="level"]) .statusbar,
.phone:has(#app-screen.active[data-app="coin"]) .statusbar { background: #000; color: #fff; }
.phone:has(#app-screen.active.torch-on) .statusbar { background: #fff; color: #000; }
.phone:has(#app-screen.active[data-app="bubbles"]) .statusbar { background: #e8f6ff; }

/* ---------- Wasserwaage ---------- */
#app-screen[data-app="level"] { background: #000; color: #fff; }
#app-screen[data-app="level"] .back-button { color: #34c759; }
.level-app { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 24px; }
.level-ring {
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #3a3a3c;
  background: radial-gradient(circle, transparent 0 22px, #3a3a3c 22px 24px, transparent 24px);
}
.level-dot { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .85); transition: transform .08s linear, background .2s; }
.level-app.is-level .level-dot { background: #34c759; }
.level-deg { margin: 0; font-size: 56px; font-weight: 300; font-variant-numeric: tabular-nums; }
.level-app .buy-btn { max-width: 260px; background: #34c759; }
.level-app .buy-btn[hidden] { display: none; }
#app-screen[data-app="level"] .blocked { color: #8e8e93; }

/* lange App-Namen wie bei iOS abkürzen */
.app-icon .label { display: block; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =================== Homeseiten, Icon-Raster =================== */
#home { padding-left: 0; padding-right: 0; overflow: hidden; }
.home-pages {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.home-pages::-webkit-scrollbar { display: none; }
.home-page {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  padding: 0 max(22px, env(safe-area-inset-right)) 8px max(22px, env(safe-area-inset-left));
}
.page-title { margin: 6px auto 20px; max-width: 340px; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }

.app-grid {
  max-width: 340px;
  grid-template-columns: repeat(4, 64px);
  justify-content: space-between;
  gap: 22px 0;
}
.app-icon { width: 64px; }
.app-icon .label { max-width: 78px; margin: 0 -7px; text-align: center; }
.home-bottom { padding-left: max(22px, env(safe-area-inset-right)); padding-right: max(22px, env(safe-area-inset-right)); }
.page-dots { display: flex; gap: 8px; }
.page-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .2s; }
.page-dots span.on { background: #fff; }

/* App-Start ohne Flackern: nur Transform + Opacity, eigener Layer */
#app-screen { will-change: transform, opacity; backface-visibility: hidden; }
@keyframes app-open { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
body.x-wackel #home .app-icon:active, body.x-nogravity #home .app-icon:active { animation-play-state: paused; }

/* =================== Statusleiste: WLAN / Nicht stören =================== */
.status-icons { cursor: pointer; }
.status-icons .wifi, .status-icons .moon { display: none; }
body.wifi-on .status-icons .wifi { display: block; }
body.wifi-on .status-icons .lte { display: none; }
body.dnd-on .status-icons .moon { display: block; }
.dnd-pill { align-self: center; margin: 0 0 4px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: #000; font-size: 13px; font-weight: 600; }

/* =================== Kontrollzentrum =================== */
.cc {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(64px + env(safe-area-inset-top)) 20px 20px;
  background: rgba(10, 10, 20, .45);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  animation: cc-in .25s cubic-bezier(.2, .8, .2, 1);
}
.cc[hidden] { display: none; }
.cc.closing { opacity: 0; transform: translateY(-20px); transition: opacity .2s, transform .2s; }
@keyframes cc-in { from { opacity: 0; transform: translateY(-24px); } }
.cc-grid {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 72px;
  gap: 14px;
}
.cc-tile {
  border: 0;
  border-radius: 20px;
  background: rgba(60, 60, 70, .55);
  color: #fff;
  display: grid;
  place-items: center;
}
.cc-tile.on, .cc-round.on { background: #fff; color: #000; }
.cc-conn { grid-column: span 2; grid-row: span 2; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.cc-round { width: 56px; height: 56px; border: 0; border-radius: 50%; background: rgba(120, 120, 128, .45); color: #fff; display: grid; place-items: center; }
.cc-round[data-cc="airplane"].on { background: #ff9500; color: #fff; }
.cc-round[data-cc="cell"].on { background: #34c759; color: #fff; }
.cc-round[data-cc="wifi"].on, .cc-round[data-cc="bt"].on { background: #007aff; color: #fff; }
.cc-now { grid-column: span 2; grid-row: span 2; align-content: space-between; justify-items: start; padding: 16px; }
.cc-now-title { margin: 0; font-size: 15px; font-weight: 600; opacity: .8; }
.cc-now-ctrl { display: flex; gap: 20px; font-size: 20px; opacity: .5; }
.cc-focus { grid-column: span 2; display: flex; justify-content: flex-start; gap: 10px; padding: 0 14px; text-align: left; }
.cc-focus-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.cc-focus.on .cc-focus-icon { background: #5e5ce6; color: #fff; }
.cc-focus-text { display: flex; flex-direction: column; }
.cc-focus-text strong { font-size: 15px; }
.cc-focus-text small { font-size: 12px; opacity: .7; }
.cc-slider {
  grid-row: span 2;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(60, 60, 70, .55);
}
.cc-slider { touch-action: none; cursor: ns-resize; }
.cc-fill { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; transition: height .05s; }
.cc-slider-icon { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); color: #8e8e93; pointer-events: none; }
.cc-hint { margin: auto 0 0; color: rgba(255, 255, 255, .6); font-size: 13px; text-align: center; }
.dimmer { position: absolute; inset: 0; z-index: 90; background: #000; opacity: 0; pointer-events: none; transition: opacity .15s; }

/* =================== Einstellungen: Banner, Account, MyCloud =================== */
.settings-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #000;
  text-align: left;
}
.settings-banner span:not(.banner-dot) { flex: 1; display: flex; flex-direction: column; }
.settings-banner strong { font-size: 16px; font-weight: 600; }
.settings-banner small { font-size: 13px; color: var(--label-2); }
.banner-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
button.account-card { width: 100%; border: 0; text-align: left; color: #000; }
.cloud-card { padding: 16px; border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.cloud-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #e5e5ea; }
.cloud-bar span { display: block; height: 100%; }
.cloud-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--label-2); }
.cloud-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.cloud-warn { margin: 0; color: var(--red); font-size: 14px; }
.plan-row { padding-top: 8px; padding-bottom: 8px; }
.plan-text { display: flex; flex-direction: column; }
.plan-text strong { font-weight: 600; color: #000; font-size: 16px; }
.plan-text small { color: var(--label-2); font-size: 13px; }
.link-btn.danger { color: var(--red); }

/* =================== Kalender =================== */
#app-screen[data-app="calendar"] { background: #fff; }
#app-screen[data-app="calendar"] { --tint: #ff3b30; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-btn { width: 44px; height: 44px; border: 0; background: none; color: #ff3b30; display: grid; place-items: center; }
.cal-today { border: 0; background: none; color: #ff3b30; font-size: 17px; min-height: 44px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; text-align: center; }
.cal-head span { font-size: 12px; color: var(--label-2); padding-bottom: 6px; }
.cal-day { aspect-ratio: 1; max-width: 44px; margin: 0 auto; width: 100%; border: 0; border-radius: 50%; background: none; font-size: 18px; color: #000; }
.cal-day.today { color: #ff3b30; font-weight: 600; }
.cal-day.sel { background: #000; color: #fff; }
.cal-day.today.sel { background: #ff3b30; color: #fff; }
.cal-events { margin-top: 18px; padding-top: 14px; border-top: .5px solid var(--sep); }
.cal-events p { margin: 0 0 4px; }

/* =================== Uhr =================== */
#app-screen[data-app="clock"] { background: #000; color: #fff; --tint: #ff9f0a; }
.phone:has(#app-screen.active[data-app="clock"]) .statusbar,
.phone:has(#app-screen.active[data-app="calc"]) .statusbar,
.phone:has(#app-screen.active[data-app="spinner"]) .statusbar { background: #000; color: #fff; }
.sw-display { margin: 40px 0 30px; text-align: center; font-size: 72px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.round-btns { display: flex; justify-content: space-between; gap: 20px; }
.round-btn { width: 82px; height: 82px; border-radius: 50%; border: 0; font-size: 16px; font-weight: 500; box-shadow: 0 0 0 3px #000, 0 0 0 5px currentColor; }
.round-btn.gray { background: #333; color: #fff; }
.round-btn.green { background: #0a3a17; color: #30d158; }
.round-btn.red { background: #3a0d0b; color: #ff453a; }
.round-btns .round-btn:only-child { margin: 0 auto; }
.laps { margin-top: 24px; }
.laps div { display: flex; justify-content: space-between; padding: 11px 0; border-top: .5px solid #333; font-variant-numeric: tabular-nums; }
.timer-pick { display: block; text-align: center; margin: 24px 0 16px; color: #8e8e93; }
.timer-presets { display: grid; grid-template-columns: repeat(3, 82px); justify-content: space-around; gap: 22px 0; }
.timer-presets .round-btn { box-shadow: none; }
.timer-ring {
  --p: 1;
  width: 250px;
  height: 250px;
  margin: 30px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#ff9f0a calc(var(--p) * 360deg), #333 0);
  -webkit-mask: radial-gradient(circle, transparent 112px, #000 113px);
  mask: radial-gradient(circle, transparent 112px, #000 113px);
  position: relative;
}
.timer-ring p { position: absolute; margin: 0; font-size: 56px; font-weight: 200; font-variant-numeric: tabular-nums; -webkit-mask: none; }
#app-screen[data-app="clock"] .blocked { color: #8e8e93; }
#app-screen[data-app="clock"] .segmented.dark { margin: 0 0 8px; }

/* =================== Wetter =================== */
#app-screen[data-app="weather"] { background: linear-gradient(180deg, #2f6fd6, #5aa2f0 70%, #8cc3f5); color: #fff; --tint: #fff; }
.phone:has(#app-screen.active[data-app="weather"]) .statusbar { background: #2f6fd6; color: #fff; }
.weather-app { text-align: center; }
.weather-app p { margin: 0; }
.w-city { font-size: 32px; font-weight: 500; }
.w-temp { font-size: 96px; font-weight: 200; line-height: 1; margin-left: 24px !important; }
.w-cond { font-size: 20px; font-weight: 500; opacity: .9; }
.w-hl { font-size: 18px; font-weight: 500; margin-bottom: 18px !important; white-space: pre; }
.w-card { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(20, 60, 140, .25); text-align: left; }
.w-card-title { font-size: 12px; text-transform: uppercase; opacity: .75; padding-bottom: 8px !important; margin-bottom: 8px !important; border-bottom: .5px solid rgba(255, 255, 255, .3); }
.w-hours { display: flex; justify-content: space-between; overflow-x: auto; gap: 12px; }
.w-hours div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; min-width: 34px; }
.w-ico { font-size: 20px; }
.w-day { display: grid; grid-template-columns: 56px 30px 38px 1fr 34px; align-items: center; gap: 8px; padding: 7px 0; font-size: 17px; font-weight: 500; }
.w-day + .w-day { border-top: .5px solid rgba(255, 255, 255, .25); }
.w-lo { opacity: .6; text-align: right; }
.w-range { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.w-range i { display: block; height: 100%; width: 70%; margin-left: 15%; border-radius: 3px; background: linear-gradient(90deg, #7fd4ff, #ffd60a); }
.w-note { margin-top: 14px !important; font-size: 12px; opacity: .7; }

/* =================== Rechner =================== */
#app-screen[data-app="calc"] { background: #000; color: #fff; --tint: #ff9f0a; }
#app-screen[data-app="calc"] .app-content { display: flex; }
.calc-app { margin-top: auto; width: 100%; max-width: 360px; margin-left: auto; margin-right: auto; }
.calc-display { margin: 0 8px 12px; text-align: right; font-size: 80px; font-weight: 300; line-height: 1.05; overflow: hidden; white-space: nowrap; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ck { aspect-ratio: 1; border: 0; border-radius: 50%; font-size: 32px; font-weight: 400; background: #333; color: #fff; transition: filter .1s; }
.ck:active { filter: brightness(1.4); }
.ck.fn { background: #a5a5a5; color: #000; font-size: 26px; font-weight: 500; }
.ck.op { background: #ff9f0a; color: #fff; font-size: 36px; }
.ck.op.active { background: #fff; color: #ff9f0a; }
.ck.zero { grid-column: span 2; aspect-ratio: auto; border-radius: 999px; text-align: left; padding-left: 30px; }

/* =================== Würfel =================== */
.dice-app { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.dice-app .segmented { width: 100%; grid-template-columns: repeat(3, 1fr); }
.dice-row { display: flex; gap: 16px; min-height: 110px; align-items: center; cursor: pointer; }
.dice-row.rolling .die { animation: roll .35s ease-in-out; }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(.8); } 100% { transform: rotate(360deg) scale(1); } }
.die { width: 90px; height: 90px; padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 18px; background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .18), inset 0 -4px 0 #e5e5ea; }
.die span { border-radius: 50%; }
.die .pip { background: #ff3b30; }
.dice-sum { margin: 0; font-size: 30px; font-weight: 700; }
.dice-app .buy-btn { max-width: 260px; background: #ff453a; }

/* =================== Spinner =================== */
#app-screen[data-app="spinner"] { background: #000; color: #fff; --tint: #5e5ce6; }
.spin-app { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 20px; }
.spinner-btn { border: 0; background: none; padding: 0; border-radius: 50%; touch-action: none; }
.spin-rpm { margin: 0; font-size: 20px; }
.spin-rpm strong { font-size: 48px; font-weight: 300; font-variant-numeric: tabular-nums; }
#app-screen[data-app="spinner"] .blocked, #app-screen[data-app="spinner"] .meta { color: #8e8e93; }

/* =================== Der Knopf =================== */
.knopf-app { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding-bottom: 40px; text-align: center; }
.knopf-msg { margin: 0; font-size: 20px; font-weight: 600; min-height: 52px; max-width: 280px; }
.big-red {
  width: 180px;
  height: 180px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff8a80, #ff3b30 45%, #b3160c);
  box-shadow: 0 14px 0 #7a0d06, 0 22px 30px rgba(0, 0, 0, .35);
  transition: transform .06s, box-shadow .06s;
}
.big-red:active { transform: translateY(10px); box-shadow: 0 4px 0 #7a0d06, 0 8px 14px rgba(0, 0, 0, .3); }
.knopf-count { margin: 0; color: var(--label-2); }

/* =================== Ventilator =================== */
.fan-app { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-top: 16px; }
.fan-blades { transform-origin: 100px 100px; }
.fan-blades.speed-1 { animation: spin 1.2s linear infinite; }
.fan-blades.speed-2 { animation: spin .5s linear infinite; }
.fan-blades.speed-3 { animation: spin .18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fan-speeds { width: 100%; grid-template-columns: repeat(4, 1fr); }
@media (prefers-reduced-motion: reduce) { .fan-blades { animation-duration: 3s !important; } }

/* =================== Allgemein: Buttons nie überlaufen =================== */
.segmented button, .chip, .price-pill, .pill-btn, .round-btn, .buy-btn, .link-btn, .action-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segmented button { padding: 0 4px; font-size: 13px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented.four { grid-template-columns: repeat(4, 1fr); }
.segmented.four button { font-size: 12px; }
.price-pill { max-width: 120px; }
.icon-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #8e8e93; }
.pill-btn { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font-size: 15px; font-weight: 600; color: #fff; }
.pill-btn.orange { background: #ff9f0a; color: #000; }
.pill-btn.blue { background: var(--blue); }
.pill-btn.green { background: #34c759; }
.empty-note { display: block; padding: 14px 16px; text-align: center; white-space: normal; }
.danger-text { color: var(--red); }

/* =================== Homebildschirm bearbeiten =================== */
.edit-done {
  position: absolute;
  top: 6px;
  right: 16px;
  z-index: 5;
  min-height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.edit-done[hidden] { display: none; }
#home { position: relative; }
.app-icon { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.del-badge {
  display: none;
  position: absolute;
  top: -7px;
  left: -5px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(120, 120, 128, .85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 20px;
  line-height: 20px;
  text-align: center;
  text-shadow: none;
  font-weight: 600;
}
body.editing .del-badge { display: block; }
body.editing #home .app-icon { animation: wackel .26s ease-in-out infinite alternate; }
body.editing #home .app-icon:nth-child(2n) { animation-delay: -.13s; }
body.editing .home-pages { touch-action: pan-x; }
.app-icon.dragging { opacity: .25; }
.drag-ghost { position: absolute; z-index: 80; pointer-events: none; transform: scale(1.12); opacity: .95; animation: none !important; }
.drag-ghost .del-badge, .drag-ghost .badge { display: none !important; }
@media (prefers-reduced-motion: reduce) { body.editing #home .app-icon { animation: none; } }

/* =================== Mail: Postfächer & Verfassen =================== */
.chips { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; padding: 0 16px 10px; scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; line-height: 32px; white-space: nowrap; padding: 0 12px; border: 0; border-radius: 999px; background: #f2f2f7; color: #000; font-size: 14px; font-weight: 500; }
.chip.on { background: var(--blue); color: #fff; }
.chip-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: rgba(0, 0, 0, .12); font-size: 12px; }
.chip.on .chip-n { background: rgba(255, 255, 255, .3); }
#app-screen[data-app="emails"] .app-content { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#app-screen[data-app="emails"] .chips { flex: none; padding-top: 4px; }
#app-screen[data-app="emails"] .search-field { flex: none; }
#app-screen[data-app="emails"] #mail-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#app-screen[data-app="emails"] #mail-foot { flex: none; }
#app-screen[data-app="emails"] .mail-toolbar { flex: none; margin: 0; }
#app-screen[data-app="emails"].viewer .app-content { display: block; overflow-y: auto; padding: 16px 12px 34px; }
#app-screen[data-app="emails"].is-detail .app-content { display: block; overflow-y: auto; padding: 6px 16px 28px; }
.mail-detail { flex: none; }
.junk-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #fff4d6; color: #7a5200; font-size: 14px; }
.compose-layer { align-items: flex-end; }
.compose {
  width: 100%;
  height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 14px 14px 0 0;
  background: #fff;
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1);
}
.compose-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 16px; border-bottom: .5px solid var(--sep); }
.compose-head strong { font-size: 17px; }
.compose-cancel { justify-self: start; border: 0; background: none; color: var(--blue); font-size: 17px; min-height: 44px; }
.compose-send { justify-self: end; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.compose-row { display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 46px; border-bottom: .5px solid var(--sep); color: var(--label-2); font-size: 16px; }
.compose-row input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; color: #000; background: none; }
.compose-body { flex: 1; min-height: 120px; padding: 14px 16px; border: 0; outline: none; resize: none; font-size: 17px; line-height: 1.4; }
.compose-sig { margin: 0; padding: 0 16px 20px; color: var(--label-2); font-size: 15px; }

/* =================== Telefon =================== */
.segmented:has(> button:nth-child(3)):not(.four) { grid-template-columns: repeat(3, 1fr); }
.keypad { display: flex; flex-direction: column; align-items: center; }
.dial-number { min-height: 44px; margin: 8px 0 16px; font-size: 34px; font-weight: 400; letter-spacing: .02em; text-align: center; overflow: hidden; white-space: nowrap; max-width: 100%; }
.keys { display: grid; grid-template-columns: repeat(3, 78px); gap: 16px 26px; }
.key { width: 78px; height: 78px; border: 0; border-radius: 50%; background: #e5e5ea; color: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.key span { font-size: 34px; }
.key small { font-size: 10px; font-weight: 700; letter-spacing: .12em; height: 11px; margin-top: 2px; }
.key:active { background: #c7c7cc; }
.keypad-foot { display: grid; grid-template-columns: repeat(3, 78px); gap: 26px; margin-top: 16px; align-items: center; justify-items: center; }
.call-btn { width: 78px; height: 78px; border: 0; border-radius: 50%; background: #34c759; color: #fff; display: grid; place-items: center; }
.call-btn svg { width: 32px; height: 32px; }
.dial-del { border: 0; background: none; font-size: 26px; color: #8e8e93; min-width: 44px; min-height: 44px; }
.dial-del[hidden] { visibility: hidden; display: block; }
.call-screen {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(80px + env(safe-area-inset-top)) 24px calc(50px + env(safe-area-inset-bottom));
  color: #fff;
  background: linear-gradient(180deg, #3a4a5e, #1c2430);
  animation: fade-in .25s ease;
}
.call-screen.closing { opacity: 0; transition: opacity .25s; }
.call-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.call-name { margin: 0; font-size: 30px; font-weight: 500; }
.call-status { margin: 0; font-size: 16px; opacity: .8; }
.call-grid { display: grid; grid-template-columns: repeat(3, 76px); gap: 20px 30px; }
.call-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; }
.call-opt span { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); font-size: 28px; }
.call-opt.on span { background: #fff; color: #1c2430; }
.call-opt small { font-size: 13px; white-space: nowrap; }
.end-btn { width: 76px; height: 76px; border: 0; border-radius: 50%; background: #ff3b30; color: #fff; display: grid; place-items: center; }
.end-btn svg { width: 34px; height: 34px; transform: rotate(135deg); }
.contact-actions { flex-wrap: wrap; justify-content: center; }

/* =================== Uhr (neu) =================== */
.world-analog { display: flex; justify-content: center; margin-top: 8px; }
.world-digital { margin: 10px 0 0; text-align: center; font-size: 40px; font-weight: 200; font-variant-numeric: tabular-nums; }
.world-date { margin: 2px 0 14px; text-align: center; color: #8e8e93; font-size: 15px; }
.world-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: .5px solid #333; }
.world-row span:first-child { display: flex; flex-direction: column; }
.world-row small { color: #8e8e93; font-size: 13px; }
.world-row strong { font-size: 20px; font-weight: 400; }
.world-time { font-size: 38px; font-weight: 200; font-variant-numeric: tabular-nums; }
.alarm-add { display: flex; gap: 10px; align-items: center; margin: 8px 0 14px; }
.alarm-time-input { flex: 1; }
.alarm-time-input input { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: #1c1c1e; color: #fff; font-size: 20px; color-scheme: dark; }
.alarm-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: .5px solid #333; }
.alarm-text { flex: 1; display: flex; flex-direction: column; }
.alarm-text strong { font-size: 48px; font-weight: 200; line-height: 1.05; font-variant-numeric: tabular-nums; }
.alarm-text small { font-size: 14px; }
.alarm-row.off .alarm-text { opacity: .45; }
.round-btn { width: 88px; height: 88px; font-size: 15px; padding: 0 6px; }
.round-btn.orange { background: #3a2605; color: #ff9f0a; }
.round-btn:disabled { opacity: .45; }
.round-btns { align-items: center; }
.laps div.best span { color: #30d158; }
.laps div.worst span { color: #ff453a; }
.picker { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 24px 0 8px; }
.pick-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pick-col small { color: #8e8e93; font-size: 13px; }
.pick-val { font-size: 52px; font-weight: 200; font-variant-numeric: tabular-nums; min-width: 72px; text-align: center; }
.pick-sep { font-size: 44px; font-weight: 200; padding-bottom: 22px; color: #8e8e93; }
.pick-btn { width: 44px; height: 36px; border: 0; border-radius: 10px; background: #1c1c1e; color: #ff9f0a; font-size: 22px; }
.timer-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 22px; grid-template-columns: none; }
#app-screen[data-app="clock"] .chip { background: #1c1c1e; color: #fff; }
.timer-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-center p { position: static; margin: 0; font-size: 56px; font-weight: 200; font-variant-numeric: tabular-nums; }
.timer-center small { color: #8e8e93; font-size: 15px; }
.timer-ring { -webkit-mask: none; mask: none; background: none; }
.timer-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#ff9f0a calc(var(--p) * 360deg), #333 0);
  -webkit-mask: radial-gradient(circle, transparent 114px, #000 115px);
  mask: radial-gradient(circle, transparent 114px, #000 115px);
}

/* =================== App Store =================== */
.store-hero { margin-bottom: 16px; padding: 20px 18px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #ff2d55, #ff9500); }
.store-hero p { margin: 0; }
.store-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; position: relative; background: #fff; }
.store-row + .store-row::before { content: ""; position: absolute; top: 0; right: 0; left: 72px; border-top: .5px solid var(--sep); }
.store-icon { flex: none; width: 48px; height: 48px; border-radius: 11px; overflow: hidden; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1); }
.store-icon svg { width: 100%; height: 100%; display: block; }
.price-pill.get { display: inline-grid; place-items: center; min-width: 64px; }
.dl-ring { flex: none; width: 30px; height: 30px; margin: 0 22px; border-radius: 50%; border: 3px solid #e5e5ea; border-top-color: var(--blue); animation: spin .8s linear infinite; }

/* =================== Erinnerungen / Dateien / Kompass =================== */
.rem-add { display: flex; gap: 8px; margin-bottom: 14px; }
.rem-add input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid #d1d1d6; border-radius: 10px; font-size: 16px; }
.rem-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; background: #fff; position: relative; }
.rem-row + .rem-row::before { content: ""; position: absolute; top: 0; right: 0; left: 50px; border-top: .5px solid var(--sep); }
.rem-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c7c7cc; background: #fff; }
.rem-row.done .rem-check { border-color: var(--blue); background: radial-gradient(circle, var(--blue) 0 6px, #fff 7px); }
.rem-text { flex: 1; font-size: 17px; }
.rem-row.done .rem-text { color: var(--label-2); }
.file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-bottom: 16px; }
.file-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 4px; text-align: center; min-width: 0; }
.file-tile[hidden] { display: none; }
.file-thumb { width: 72px; height: 94px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 2px 8px rgba(0, 0, 0, .12); display: grid; place-items: center; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.file-name { font-size: 12px; font-weight: 600; color: #000; overflow-wrap: anywhere; line-height: 1.2; max-width: 100%; }
.file-tile .meta { font-size: 11px; white-space: normal; }
#app-screen[data-app="compass"] { background: #000; color: #fff; --tint: #fff; }
.phone:has(#app-screen.active[data-app="compass"]) .statusbar { background: #000; color: #fff; }
.compass-app { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.compass-dial { transition: transform .15s linear; margin-top: 10px; }
.compass-needle { position: absolute; top: 2px; left: 50%; width: 3px; height: 26px; margin-left: -1.5px; background: #fff; border-radius: 2px; }
.compass-deg { margin: 6px 0 0; font-size: 52px; font-weight: 200; font-variant-numeric: tabular-nums; }
.compass-coords { margin: 0; text-align: center; color: #8e8e93; font-size: 15px; }
.compass-app .buy-btn { max-width: 260px; margin-top: 10px; }
.compass-app .buy-btn[hidden] { display: none; }

/* =================== Spiele =================== */
.game-app { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.game-score { margin: 0; color: var(--label-2); font-size: 15px; }
.game-score strong { color: #000; }
#app-screen[data-app="snake"] { background: #0f170f; color: #fff; }
#app-screen[data-app="snake"] .game-score, #app-screen[data-app="snake"] .game-score strong { color: #cfe8cf; }
.phone:has(#app-screen.active[data-app="snake"]) .statusbar { background: #0f170f; color: #fff; }
#sn-canvas { width: min(100%, 320px); aspect-ratio: 1; border-radius: 12px; touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 52px); gap: 6px; grid-template-areas: ". up ." "left start right" ". down ."; }
.dp { border: 0; border-radius: 14px; background: #1f3a1f; color: #cfe8cf; font-size: 20px; }
.dp.up { grid-area: up; } .dp.down { grid-area: down; } .dp.left { grid-area: left; } .dp.right { grid-area: right; }
.dp.start { grid-area: start; background: #34c759; color: #04210b; font-size: 14px; font-weight: 700; }
.react-pad { width: 100%; min-height: 380px; border: 0; border-radius: 22px; font-size: 24px; font-weight: 700; color: #fff; padding: 20px; }
.react-pad.wait { background: #007aff; }
.react-pad.armed { background: #ff3b30; }
.react-pad.go { background: #34c759; }
.react-pad.early { background: #ff9500; }
.tap-time { margin: 10px 0 0; font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; }
.tap-pad { width: 250px; height: 250px; border: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; background: radial-gradient(circle at 35% 30%, #ff6b88, #ff2d55); box-shadow: 0 16px 40px rgba(255, 45, 85, .45); touch-action: manipulation; }
.tap-pad:active { transform: scale(.97); }
.tap-pad span { font-size: 72px; font-weight: 800; line-height: 1; }
.tap-pad small { font-size: 14px; max-width: 180px; }
.rps-score { margin: 6px 0 0; font-size: 20px; }
.rps-score strong { font-size: 32px; }
.rps-arena { display: flex; align-items: center; gap: 22px; font-size: 76px; min-height: 100px; }
.rps-arena small { font-size: 16px; color: var(--label-2); }
.rps-result { margin: 0; font-size: 20px; font-weight: 700; text-align: center; min-height: 28px; }
.rps-choices { display: flex; gap: 14px; }
.rps-btn { width: 88px; height: 88px; border: 0; border-radius: 22px; background: #fff; font-size: 44px; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); }
.cow-app { position: relative; }
.cow-count { margin: 10px 0 0; font-size: 22px; }
.cow-count strong { font-size: 48px; }
.cow-btn { width: 200px; height: 200px; border: 0; border-radius: 50%; background: #e8f7d8; font-size: 110px; line-height: 1; box-shadow: 0 10px 26px rgba(90, 150, 40, .35); transition: transform .06s; }
.cow-btn:active { transform: scale(.94); }
.cow-pop { position: absolute; top: 44%; left: 50%; transform: translateX(-50%); font-weight: 800; color: #34a853; pointer-events: none; animation: pop-up .7s ease-out forwards; }
@keyframes pop-up { to { transform: translate(-50%, -70px); opacity: 0; } }

/* =================== Ausschalten =================== */
.cc-power { grid-column: span 4; grid-row: span 1; display: flex; gap: 10px; justify-content: center; align-items: center; font-size: 15px; font-weight: 600; background: rgba(255, 59, 48, .8); }
.power-layer {
  position: absolute;
  inset: 0;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(70px + env(safe-area-inset-top)) 24px calc(60px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: fade-in .2s ease;
}
.power-slider {
  --fade: 1;
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 64px;
  border-radius: 32px;
  background: rgba(255, 255, 255, .22);
  display: flex;
  align-items: center;
  padding: 4px;
}
.power-knob { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #ff3b30; display: grid; place-items: center; font-size: 26px; touch-action: none; cursor: grab; }
.power-text { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 50px; color: #fff; font-size: 17px; opacity: var(--fade); pointer-events: none; }
.power-cancel { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; color: #fff; font-size: 14px; }
.power-cancel span { width: 60px; height: 60px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 22px; }
.off-screen { position: absolute; inset: 0; z-index: 95; background: #000; display: grid; place-items: center; animation: fade-in .4s ease; }
.off-screen.fade { opacity: 0; transition: opacity .4s; }
.off-hint { border: 0; background: none; color: #2c2c2e; font-size: 14px; padding: 40px; width: 100%; height: 100%; }
.boot-logo { display: flex; flex-direction: column; align-items: center; gap: 36px; }
.boot-bar { width: 140px; height: 4px; border-radius: 2px; background: #333; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: #fff; animation: boot 2.4s ease-in-out forwards; }
@keyframes boot { to { width: 100%; } }

/* =================== Dunkelmodus =================== */
body.dark {
  --ink: #ffffff;
  --label-2: rgba(235, 235, 245, .6);
  --sep: rgba(84, 84, 88, .65);
  --grouped: #000000;
  --cell: #1c1c1e;
}
body.dark #app-screen { background: #000; color: #fff; }
body.dark #app-screen[data-app="messages"],
body.dark #app-screen[data-app="emails"] { background: #000; }
body.dark .list, body.dark .settings-section, body.dark .account-card,
body.dark .cloud-card, body.dark .notes-list, body.dark .message-thread,
body.dark .settings-banner, body.dark button.account-card, body.dark .nav-row,
body.dark .shop-row, body.dark .search-field, body.dark .att-thumb { background: #1c1c1e; color: #fff; }
body.dark .list-item, body.dark .note-card, body.dark .settings-row { background: #1c1c1e; color: #fff; }
body.dark .search-field { background: rgba(118,118,128,.24); }
body.dark .segmented { background: rgba(118,118,128,.24); }
body.dark .segmented button { color: #fff; }
body.dark .segmented button.selected { background: #636366; }
body.dark .bubble.in { background: #26262a; color: #fff; }
body.dark .subject, body.dark .mail-text, body.dark .settings-banner strong,
body.dark .plan-text strong, body.dark .cal-ev-body strong { color: #fff; }
body.dark .message-form { background: rgba(20,20,20,.94); }
body.dark .message-form input { background: #1c1c1e; color: #fff; border-color: #3a3a3c; }
body.dark .attachment { background: #1c1c1e; border-color: #3a3a3c; }
body.dark .att-name { color: #fff; }
body.dark .cal-day { color: #fff; }
body.dark .cal-day.sel { background: #fff; color: #000; }
body.dark #app-screen[data-app="calendar"] { background: #000; }
body.dark .alert { background: rgba(40,40,44,.92); }
body.dark .alert-title, body.dark .alert-msg { color: #fff; }
body.dark .buy-sheet { background: #1c1c1e; color: #fff; }
body.dark .buy-item, body.dark .buy-rows { background: #2c2c2e; }
body.dark .cc-slider, body.dark .price-pill { background: #2c2c2e; }
body.dark .browser-view { background: #000; }
body.dark .addr-bar { background: #1c1c1e; }
body.dark .addr-input { background: #2c2c2e; color: #fff; }
body.dark .site.plain, body.dark .site.wiki { color: #fff; }

/* =================== Neue Einstellungs-Icons =================== */
.set-icon.indigo { background: #5e5ce6; }
.set-icon.blue2 { background: #007aff; }
.set-icon.teal2 { background: #30b0c7; }

/* Erscheinungsbild-Auswahl */
.appearance-row { display: flex; gap: 16px; padding: 4px 2px 8px; }
.appearance { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.appearance-preview { width: 100%; aspect-ratio: 9/16; max-height: 150px; border-radius: 12px; border: 1px solid var(--sep); position: relative; overflow: hidden; display: block; }
.appearance-preview.light { background: linear-gradient(160deg,#dfe7f5,#f7f7fb); }
.appearance-preview.dark { background: linear-gradient(160deg,#1a1a2e,#000); }
.ap-status { position: absolute; top: 10px; left: 12px; right: 12px; height: 6px; border-radius: 3px; background: currentColor; opacity: .3; }
.appearance-preview.light { color: #333; }
.appearance-preview.dark { color: #fff; }
.ap-box { position: absolute; left: 12px; right: 12px; bottom: 14px; height: 40px; border-radius: 8px; background: currentColor; opacity: .25; }
.appearance.sel .appearance-preview { outline: 3px solid var(--blue); outline-offset: 2px; }
.appearance-name { font-size: 15px; font-weight: 600; }

/* Helligkeits-/Lautstärke-Regler */
.bright-row { gap: 12px; }
.range { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px; background: #c7c7cc; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
body.dark .range { background: #48484a; }

/* Hintergrund-Auswahl */
.wp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 4px 0; }
.wp-item { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wp-preview { width: 100%; aspect-ratio: 9/16; border-radius: 12px; border: 1px solid var(--sep); display: grid; place-items: center; color: #fff; font-size: 22px; }
.wp-item.sel .wp-preview { outline: 3px solid var(--blue); outline-offset: 2px; }
.wp-name { font-size: 13px; }

/* =================== Kalender-Ereignisse =================== */
.cal-day { position: relative; }
.cal-dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: #ff3b30; }
.cal-day.sel .cal-dot { background: #fff; }
.cal-ev-date { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.cal-ev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: .5px solid var(--sep); }
.cal-ev-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.cal-ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-ev-body strong { font-size: 16px; }
.cal-ev-body small { color: var(--label-2); font-size: 13px; }
.cal-ev-time { color: var(--label-2); font-size: 14px; white-space: nowrap; }

/* =================== Browser =================== */
#app-screen[data-app="browser"] .app-content { padding: 0; display: flex; flex-direction: column; }
.browser-app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.addr-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f2f2f7; border-bottom: .5px solid var(--sep); }
.addr-lock { font-size: 12px; opacity: .6; }
.addr-input { flex: 1; min-width: 0; border: 0; border-radius: 10px; background: #fff; padding: 8px 12px; font-size: 15px; text-align: center; outline: none; }
.addr-input:focus { text-align: left; }
.addr-go { flex: none; border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 15px; padding: 4px 6px; }
.browser-view { flex: 1; min-height: 0; overflow-y: auto; background: #fff; }
.browser-start { padding: 20px 18px; }
.start-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: rgba(118,118,128,.12); color: var(--label-2); margin-bottom: 22px; }
.start-search input { flex: 1; border: 0; background: none; font-size: 16px; outline: none; color: var(--ink); }
.fav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }
.fav { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fav-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.fav-label { font-size: 12px; color: var(--ink); }
.browser-hint { text-align: center; margin-top: 26px; }
.site { padding: 22px 18px; line-height: 1.5; }
.site h1 { font-size: 24px; margin: 0 0 10px; }
.site h2 { font-size: 18px; margin: 18px 0 8px; }
.site .lead { font-size: 17px; }
.site .tiny, .tiny { font-size: 12px; color: var(--label-2); }
.plain-list { padding-left: 20px; margin: 8px 0; }
.plain-list li { margin: 6px 0; }
.browser-error { text-align: center; }
.browser-error .pill-btn { margin-top: 14px; }
/* Bellic-Media-Seite */
.bellic { padding: 0; color: #0d1b2a; }
.bellic-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #0d1b2a; color: #fff; }
.bellic-logo { font-weight: 800; letter-spacing: .04em; font-size: 15px; }
.bellic-logo b { color: #4da3ff; }
.bellic-nav nav { display: flex; gap: 12px; }
.bellic-nav a { color: #cdd9e5; font-size: 12px; }
.bellic-hero { padding: 28px 18px; background: linear-gradient(160deg,#12263a,#1f6feb); color: #fff; }
.bellic-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.bellic-hero h1 { font-size: 26px; margin: 0 0 10px; line-height: 1.15; }
.bellic-sub { font-size: 15px; opacity: .92; margin: 0 0 16px; }
.bellic-cta { display: inline-block; background: #fff; color: #1f6feb; font-weight: 700; padding: 10px 18px; border-radius: 999px; font-size: 14px; }
.bellic-cards { display: grid; gap: 12px; padding: 20px 18px; }
.bellic-cards div { padding: 16px; border-radius: 14px; background: #f2f6fb; }
.bellic-cards h3 { margin: 0 0 6px; color: #1f6feb; font-size: 17px; }
.bellic-cards p { margin: 0; font-size: 14px; color: #33475b; }
.bellic-foot { padding: 18px; text-align: center; font-size: 12px; color: #7a8ba0; background: #0d1b2a; color: #cdd9e5; }

/* =================== Text passt in Buttons =================== */
.round-btn, .buy-btn, .pill-btn, .chip, .price-pill, .link-btn,
.appearance-name, .fav-label, .cc-focus-text strong, .segmented button {
  overflow: hidden;
  text-overflow: ellipsis;
}
.segmented button { white-space: nowrap; min-width: 0; padding: 0 4px; }
.segmented.four button { font-size: 12px; }
.round-btn { padding: 4px; line-height: 1.1; word-break: break-word; }
.chip { white-space: nowrap; }
.dice-app .segmented button, .fan-speeds button { font-size: 13px; }

/* =================== Kompakt: kleine Bildschirme (iPhone SE/6s) =================== */
@media (max-height: 620px) {
  .widget { margin: 0 auto 16px; padding: 12px 16px; }
  .widget-day { font-size: 38px; }
  .app-grid { gap: 16px 0; }
  .symbol { width: 56px; height: 56px; }
  .app-icon { width: 58px; }
  .home-bottom { gap: 8px; }
  .dock { padding: 10px 10px; }
  .home-page { padding-top: 0; }

  /* Uhr / Timer / Weltuhr kompakter */
  .sw-display { margin: 20px 0 18px; font-size: 58px; }
  .round-btn { width: 72px; height: 72px; font-size: 15px; }
  .timer-ring { width: 200px; height: 200px; margin: 16px auto; }
  .timer-center p, .timer-ring p { font-size: 44px; }
  .world-analog svg { width: 150px !important; height: 150px !important; }
  .world-digital { font-size: 40px !important; }
  .picker { transform: scale(.92); }

  /* Rechner kompakter */
  .calc-display { font-size: 62px; margin-bottom: 8px; }
  .calc-keys { gap: 9px; }
  .ck { font-size: 27px; }

  /* Wetter kompakter */
  .w-temp { font-size: 76px; }
  .w-city { font-size: 26px; }

  /* Knopf/Spinner/Würfel */
  .big-red { width: 150px; height: 150px; }
  .die { width: 76px; height: 76px; }
  .coin { width: 140px; height: 140px; }
}

@media (max-height: 620px) and (min-width: 600px) {
  /* Am PC im Gerätefenster nicht verkleinern */
}

/* Sehr niedrig: Homebildschirm scrollbar statt Überlauf */
@media (max-height: 560px) {
  .home-page { overflow-y: auto; }
  .app-grid { gap: 14px 0; }
  .symbol { width: 52px; height: 52px; }
}

/* =================== Browser: Leiste, Tabs, iframe =================== */
.browser-app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.addr-reload { flex: none; border: 0; background: none; color: var(--label-2); font-size: 18px; padding: 4px 6px; }
.browser-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: #f7f7f9;
  border-top: .5px solid var(--sep);
}
body.dark .browser-bar { background: #1c1c1e; }
.bb { width: 48px; height: 40px; border: 0; background: none; color: var(--blue); display: grid; place-items: center; border-radius: 10px; }
.bb:disabled { color: #c7c7cc; }
.bb:active { background: rgba(0,0,0,.06); }
.tabs-btn { position: relative; }
.tabs-count { min-width: 22px; height: 22px; padding: 0 5px; border: 2px solid var(--blue); border-radius: 6px; font-size: 13px; font-weight: 700; display: grid; place-items: center; color: var(--blue); }
.iframe-wrap { position: relative; width: 100%; height: 100%; }
.site-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.iframe-fallback { position: absolute; inset: 0; background: #fff; overflow-y: auto; }

/* Tab-Übersicht */
#app-screen[data-app="browser"] .app-content:has(.tab-overview) { background: #d9d9de; }
body.dark #app-screen[data-app="browser"] .app-content:has(.tab-overview) { background: #000; }
.tab-overview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab-cards { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; align-content: start; }
.tab-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.14); min-height: 150px; display: flex; flex-direction: column; }
.tab-card.active { outline: 3px solid var(--blue); }
body.dark .tab-card { background: #1c1c1e; color: #fff; }
.tab-card-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: .5px solid var(--sep); }
.tab-card-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-close { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(120,120,128,.2); color: inherit; font-size: 12px; }
.tab-card-body { flex: 1; display: grid; place-items: center; color: var(--label-2); font-size: 13px; }
.tab-bar { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: #f7f7f9; border-top: .5px solid var(--sep); }
body.dark .tab-bar { background: #1c1c1e; }
.tab-new { border: 0; background: none; color: var(--blue); font-size: 16px; }
.tab-done { border: 0; background: none; color: var(--blue); font-size: 17px; font-weight: 600; }

/* =================== Anruf: verbunden =================== */
.call-screen.connected .call-status { color: #30d158; }

/* =================== Dunkelmodus: Feinschliff =================== */
body.dark {
  --ink: #f2f2f7;
  --tint: #0a84ff;
  --blue: #0a84ff;
  --red: #ff453a;
}
/* Kopfzeile/Titel immer hell */
body.dark .app-header h2,
body.dark .app-content,
body.dark #app-screen { color: #f2f2f7; }
body.dark .title,
body.dark .subject,
body.dark .note-title-input,
body.dark .note-editor textarea,
body.dark h3,
body.dark .settings-row,
body.dark .settings-row span,
body.dark .settings-row strong,
body.dark dt, body.dark dd { color: #f2f2f7; }
body.dark .meta, body.dark .section-label, body.dark .blocked,
body.dark .notif-time, body.dark .toolbar-count { color: rgba(235,235,245,.6); }

/* Segmentierte Steuerung + Chips dunkel lesbar */
body.dark .chip { background: #2c2c2e; color: #f2f2f7; }
body.dark .chip.on { background: var(--blue); color: #fff; }
body.dark .chip-n { background: rgba(255,255,255,.18); }
body.dark .segmented { background: rgba(120,120,128,.32); }
body.dark .segmented button { color: #f2f2f7; }
body.dark .segmented button.selected { background: #636366; color: #fff; }

/* Karten/Zeilen einheitlich dunkel */
body.dark .cloud-card,
body.dark .store-app .store-card,
body.dark .file-tile,
body.dark .reminder-row,
body.dark .alarm-row,
body.dark .laps div,
body.dark .call-details,
body.dark .keypad,
body.dark .contact-detail .company-logo,
body.dark .mail-detail { background: #1c1c1e; }
body.dark .file-thumb, body.dark .att-thumb { background: #2c2c2e; }
body.dark .file-name, body.dark .att-name, body.dark .plan-text strong,
body.dark .cloud-legend, body.dark .cal-ev-body strong { color: #f2f2f7; }

/* Suchfelder */
body.dark .search-field, body.dark .start-search { background: rgba(120,120,128,.28); color: rgba(235,235,245,.6); }
body.dark .search-field input, body.dark .start-search input, body.dark .addr-input { color: #f2f2f7; }

/* Eingaben (Wecker-Zeit, Erinnerung, Notiz) */
body.dark input[type="time"],
body.dark input[type="text"],
body.dark input[type="search"],
body.dark textarea,
body.dark .rem-input { background: #1c1c1e; color: #f2f2f7; border-color: #3a3a3c; }
body.dark input::placeholder, body.dark textarea::placeholder { color: rgba(235,235,245,.4); }

/* Remindern/Buttons „Hinzufügen“ */
body.dark .pill-btn { background: #2c2c2e; color: var(--blue); }
body.dark .pill-btn.orange { background: #ff9f0a; color: #1c1c1e; }
body.dark .price-pill { background: #2c2c2e; color: var(--blue); }
body.dark .price-pill.owned { background: #14351f; color: #30d158; }
body.dark .link-btn { color: var(--blue); }

/* Trennlinien */
body.dark .list-item + .list-item::before,
body.dark .settings-row + .settings-row::before,
body.dark .shop-row + .shop-row::before,
body.dark .spot-item + .spot-item::before { border-color: rgba(84,84,88,.5); }

/* Kalender */
body.dark .cal-head span { color: rgba(235,235,245,.6); }
body.dark .cal-btn, body.dark .cal-today { color: var(--tint); }

/* App-Screens mit hellem Hintergrund → dunkel */
body.dark #app-screen[data-app="calendar"],
body.dark #app-screen[data-app="emails"],
body.dark #app-screen[data-app="messages"],
body.dark #app-screen[data-app="contacts"],
body.dark #app-screen[data-app="notes"],
body.dark #app-screen[data-app="reminders"],
body.dark #app-screen[data-app="files"],
body.dark #app-screen[data-app="settings"],
body.dark #app-screen[data-app="shop"] { background: #000; }
body.dark .phone:has(#app-screen.active[data-app="emails"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="messages"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="contacts"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="notes"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="reminders"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="files"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="settings"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="calendar"]) .statusbar,
body.dark .phone:has(#app-screen.active[data-app="shop"]) .statusbar { background: #000; color: #fff; }

/* Werbe-Hinweis lesbar */
body.dark .junk-note { background: #3a2f0a; color: #ffd60a; }

/* Toolbar unten (Mail/Notizen) */
body.dark .bottom-toolbar { background: rgba(20,20,22,.94); border-color: rgba(84,84,88,.5); }
body.dark .toolbar-btn { color: var(--tint); }
