@font-face {
  font-family: "Permanent Marker";
  src: url("/assets/fonts/permanent-marker.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-appearance: none; appearance: none; }
svg { flex: none; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

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

.noscript { padding: 24px; text-align: center; }

/* ---- Grundgerüst ------------------------------------------------------ */

.app { position: relative; z-index: 1; min-height: 100dvh; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar { display: none; }

.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.page--root { padding-top: calc(10px + env(safe-area-inset-top)); }

/* ---- Tab-Leiste (Handy) ----------------------------------------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-top: .5px solid var(--line);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tabbar-h);
  color: var(--c-gray);
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: .01em;
  text-decoration: none;
  transition: color .15s;
}
.tabbar__item svg { width: 25px; height: 25px; stroke-width: 1.9; }
.tabbar__item[aria-current="page"] { color: var(--accent); }
.tabbar__item[aria-current="page"] svg { stroke-width: 2.3; }

@media (min-width: 1020px) {
  .shell { grid-template-columns: 260px minmax(0, 1fr); }
  .main { padding-bottom: 0; }
  .tabbar { display: none; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    padding: 22px 12px 14px;
    border-right: .5px solid var(--line);
    background: var(--bg-raise);
    scrollbar-width: thin;
  }
  .page { padding-top: 20px; padding-left: 32px; padding-right: 32px; }
  .page--root { padding-top: 34px; max-width: 900px; }
  .only-mobile { display: none !important; }
}

@media (max-width: 1019.98px) {
  .only-desktop { display: none !important; }
}

/* ---- Große Titel der Hauptseiten ------------------------------------- */

.largetitle {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 18px;
}
.largetitle__text { min-width: 0; }
.largetitle__kicker { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; }
.largetitle h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.12;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: linear-gradient(160deg, #A1A1A6, #6E6E73);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}

/* ---- Navigationsleiste einer Unterseite -------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, max-content) minmax(44px, 1fr);
  align-items: center;
  gap: 4px;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 4px 0;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: .5px solid var(--line);
}

.topbar__back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0;
  min-height: 44px;
  padding: 0 8px 0 2px;
  color: var(--accent);
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar__back { max-width: 100%; min-width: 0; overflow: hidden; }
.topbar__back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar__back svg { width: 26px; height: 26px; stroke-width: 2.4; margin-right: -2px; }

.topbar__title {
  font-size: 17px;
  font-weight: 620;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__end { justify-self: end; display: flex; }
.topbar .iconbtn { color: var(--accent); }

@media (min-width: 1020px) {
  .topbar { padding-left: 20px; padding-right: 20px; }
}

/* ---- Wortmarke -------------------------------------------------------- */

.wordmark {
  position: relative;
  display: inline-block;
  font-family: var(--font-mark);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  letter-spacing: .01em;
  transform: rotate(-2deg);
  transform-origin: left center;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark__stroke {
  position: absolute;
  left: -3%;
  bottom: -.36em;
  width: 106%;
  height: .4em;
  color: var(--accent);
  pointer-events: none;
}

.wordmark--small { font-size: 23px; }

/* ---- Bewegung ---------------------------------------------------------- */

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

.rise { animation: rise .22s var(--ease) both; }

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

@media print {
  .sidebar, .topbar, .tabbar, .toasts, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .shell { display: block; }
  .main { padding: 0; }
  .page { max-width: none; padding: 0; }
}
