/* ==========================================================================
   Flothari Maker — Basis: Reset, Layout, Typografie, App-Shell
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--clay-dark); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }

/* ---- App-Shell -------------------------------------------------------- */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Obere Leiste */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-left: var(--s-4);
  padding-right: var(--s-3);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}
.topbar__brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--clay);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.topbar__logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; display: block; }
.topbar__brand small {
  font-weight: 600; font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.02em; margin-left: 2px;
}
.topbar__spacer { flex: 1; }
.topbar__btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-sm);
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.topbar__btn:active { background: var(--panel-2); }

/* Content-Outlet */
.view {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) calc(var(--bottom-nav-h) + var(--safe-b) + var(--s-6));
  animation: view-in 0.18s ease;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Untere Navigation */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: calc(var(--bottom-nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav__item {
  flex: 1;
  border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 600;
  padding: 6px 2px;
  position: relative;
}
.bottomnav__item svg { width: 22px; height: 22px; }
.bottomnav__item.is-active { color: var(--clay-dark); }
.bottomnav__item.is-active::before {
  content: ""; position: absolute; top: 0;
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--clay);
}

/* Utility */
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.approx { font-variant-numeric: tabular-nums; }

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--clay-dark); font-weight: 700; margin-bottom: var(--s-2);
}
.eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--clay-dark); font-weight: 600;
}

/* Leerzustände */
.empty {
  text-align: center;
  padding: var(--s-8) var(--s-4);
  color: var(--ink-soft);
}
.empty__icon {
  width: 54px; height: 54px; margin: 0 auto var(--s-3);
  color: var(--ink-faint);
  opacity: 0.8;
}
.empty h3 { margin-bottom: var(--s-2); color: var(--ink); }

/* Toast */
.toast-host {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--bottom-nav-h) + var(--safe-b) + var(--s-3));
  z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  animation: toast-in 0.2s ease;
}
.toast--good { background: var(--good); }
.toast--danger { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
