/* Zuhause – Bausteine: Cards, Buttons, Formulare, Listen, Toasts, Sheets, Skelette */

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.grid-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--mut); }
.note { color: var(--mut); font-size: var(--fs-note); line-height: 1.4; }
.label { color: var(--mut); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.big { font-size: var(--fs-big); font-weight: 700; line-height: 1; }
.center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }

/* Card */
.card {
  background: var(--card); border-radius: var(--r-card); padding: var(--sp-4);
  min-width: 0;
}
.card h2 { font-size: var(--fs-title); font-weight: 650; color: var(--acc); margin-bottom: 10px; }
.card.link { display: block; color: inherit; text-decoration: none; transition: background .15s; }
.card.link:active { background: var(--card-hover); }
.card.soon { border: 1px dashed var(--line); background: transparent; }
.kv { background: var(--card-2); border-radius: var(--r-inner); padding: 8px 10px; }
.kv span { display: block; color: var(--mut); font-size: var(--fs-label); }
.kv b { font-size: 1rem; font-weight: 650; }
.section-title { font-size: var(--fs-label); color: var(--mut); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: var(--sp-4) var(--sp-1) var(--sp-2); }
.hero { padding: var(--sp-5) var(--sp-4); }
.hero h2 { font-size: 1.35rem; color: var(--txt); margin-bottom: var(--sp-1); }

/* Chips & Badges */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--card-2); color: var(--mut); font-size: var(--fs-label); font-weight: 650;
}
.chip.acc { background: var(--acc-soft); color: var(--acc); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

.verdict { font-weight: 600; padding: 10px 12px; border-radius: var(--r-inner); }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--touch); padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-btn); cursor: pointer;
  background: var(--acc); color: var(--acc-txt); font-weight: 650; text-decoration: none;
  transition: opacity .15s, transform .1s;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(.98); opacity: .85; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--txt); border: 1px solid var(--line); }
.btn.subtle { background: var(--card-2); color: var(--txt); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 var(--sp-3); font-size: .9rem; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: var(--touch); height: var(--touch); display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-inner); background: transparent; color: var(--txt); cursor: pointer;
}
.icon-btn:active { background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.busy svg { animation: spin .8s linear infinite; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.field > span { font-size: var(--fs-note); color: var(--mut); font-weight: 600; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: var(--touch);
  padding: 10px 12px; border-radius: var(--r-inner);
  background: var(--bg); color: var(--txt); border: 1px solid var(--line);
  font-size: 16px; /* verhindert iOS-Zoom */
  outline: none; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--acc); }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: var(--r-inner); font-size: .9rem; margin-bottom: var(--sp-3); }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r-card); overflow: hidden; }
.list > li + li { border-top: 1px solid #33415588; }
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 56px; padding: 10px var(--sp-4);
  color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
button.list-item:active, a.list-item:active { background: var(--card-hover); }
.list-item .grow small { display: block; color: var(--mut); font-size: var(--fs-note); margin-top: 1px; }
.list-item .chev { color: var(--mut); font-size: 1.2rem; }
.list-item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); font-size: 1.1rem; flex: none; }
.list-item.danger { color: var(--bad); }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--mut); }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.fail { background: var(--bad); }

/* Platzhalter-Kacheln */
.tile { display: flex; flex-direction: column; gap: 6px; min-height: 108px; }
.tile .tile-ico { font-size: 1.5rem; }
.tile .tile-val { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }

/* Skelette */
.skel { position: relative; overflow: hidden; background: var(--card); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
.skel-line { height: 12px; border-radius: 6px; background: var(--line); opacity: .5; margin: 8px 0; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Toasts */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 80;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-3));
  width: min(520px, calc(100vw - 2 * var(--sp-4)));
  display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px 14px; border-radius: 12px;
  background: #0b1222; border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--txt); font-size: .95rem; pointer-events: auto;
  animation: toast-in .2s var(--ease);
}
.toast.ok { border-color: #22c55e66; }
.toast.err { border-color: #ef444499; background: #2a1215; }
.toast .grow { line-height: 1.3; }
.toast button { flex: none; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Bottom-Sheet */
.sheet-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .6);
  opacity: 0; transition: opacity .2s;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: calc(100dvh - var(--safe-top) - 24px); overflow: auto;
  margin: 0 auto; width: min(640px, 100%);
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform .26s var(--ease);
}
.sheet.open { transform: none; }
.sheet-back.open { opacity: 1; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto var(--sp-3); }
.sheet h2 { font-size: 1.1rem; margin-bottom: var(--sp-3); color: var(--txt); }
.sheet .actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.sheet .actions .btn { flex: 1; }

@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 18px; transform: translateY(-40%); opacity: 0; transition: transform .2s var(--ease), opacity .2s; }
  .sheet.open { transform: translateY(-50%); opacity: 1; }
}

/* Login */
.login-wrap { min-height: calc(100dvh - var(--appbar-h) - 120px); display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.login-logo { font-size: 2.4rem; text-align: center; margin-bottom: var(--sp-2); }
