/* =============================================
   FITNESS APP – Design System v2
   Palette: Deep Slate + Red
   Top-Navigation · Community · Admin · R2
   ============================================= */

:root {
  --bg-base:      #020202;
  --bg-card:      #0c0c0c;
  --bg-elevated:  #020202;
  --border:       #2a2f3d;
  --accent:       #950101;
  --accent-dim:   #6e0101;
  --text-primary: #eef0f5;
  --text-muted:   #787878;
  --text-faint:   #787878;
  --red:          #950101;
  --orange:       #f5943a;
  --blue:         #4a9eff;

  --radius:       10px;
  --radius-sm:    6px;
  --transition:   0.18s ease;

  font-family: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Layout ---- */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   TOP NAVIGATION BAR
══════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 58px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  gap: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.topbar .logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 24px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  position: relative;
}

.topbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.topbar-link.active {
  color: var(--accent);
  background: rgba(149,1,1,0.08);
  font-weight: 600;
}

.topbar-link-admin {
  color: var(--red) !important;
}
.topbar-link-admin:hover,
.topbar-link-admin.active {
  background: rgba(149,1,1,0.1) !important;
  color: var(--red) !important;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 20px;
  margin-left: 2px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.user-greeting {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.user-role-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-logout {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.topbar-logout:hover {
  color: var(--red);
  border-color: var(--red);
}

.nav-text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.nav-text-link:hover {
  text-decoration: underline;
}

.main-content {
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Typography ---- */
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }

.page-title {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title .badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-card .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-card.accent { border-color: var(--accent); }
.stat-card.accent .value { color: var(--accent); }

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #C90101; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); }

td.strong { color: var(--text-primary); font-weight: 600; }

/* ---- Progress Bars ---- */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-bar .fill.red    { background: var(--red); }
.progress-bar .fill.blue   { background: var(--blue); }
.progress-bar .fill.orange { background: var(--orange); }

/* ---- Macro Pills ---- */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.macro-item { text-align: center; }
.macro-item .val { font-size: 1.3rem; font-weight: 800; }
.macro-item .lbl { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; }

/* ---- Feeling Stars ---- */
.feeling-select { display: flex; gap: 8px; }
.feeling-select input { display: none; }
.feeling-select label {
  cursor: pointer;
  font-size: 1.4rem;
  filter: grayscale(1) opacity(0.4);
  transition: all 0.15s;
  text-transform: none;
  letter-spacing: 0;
}
.feeling-select input:checked ~ label,
.feeling-select label:hover { filter: none; }

/* ---- Meal Sections ---- */
.meal-section { margin-bottom: 20px; }
.meal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.meal-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ---- Photo Grid ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-elevated);
}

.photo-card img { width: 100%; height: 100%; object-fit: cover; }

.photo-card .overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.75rem;
  color: #fff;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error   { background: rgba(149,1,1,0.1);  border-color: rgba(149,1,1,0.3);  color: #f88; }
.alert-success { background: rgba(149,1,1,0.1);  border-color: rgba(149,1,1,0.3);  color: var(--accent); }

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
}

.auth-box {
  width: 380px;
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.auth-logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.05em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.auth-logo-img {
  display: block;
  width: min(280px, 80vw);
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ══════════════════════════════════════════
   COMMUNITY – Feed & Detail
══════════════════════════════════════════ */
.community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  overflow: hidden;
}

.community-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 100%;
}

.community-card:hover {
  border-color: rgba(149,1,1,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.community-card-media {
  width: 180px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.media-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.media-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 160px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.community-card:hover .media-thumb img { transform: scale(1.04); }

.media-thumb .thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.no-media {
  background: var(--bg-elevated);
  min-height: 160px;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  transition: background var(--transition);
}
.community-card:hover .play-overlay { background: rgba(0,0,0,0.2); }

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(149,1,1,0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  padding-left: 3px;
  transition: transform var(--transition);
}
.community-card:hover .play-btn { transform: scale(1.1); }

.community-card-text {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.community-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.community-card:hover .community-card-title { color: var(--accent); }

.community-card-excerpt {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 12px;
}

.community-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.community-comment-badge {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.community-comment-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.community-detail {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  align-items: start;
}

.community-detail-media { position: sticky; top: 80px; }

.media-wrapper {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.community-video {
  width: 100%;
  max-height: 70vh;
  display: block;
  background: #000;
}

.community-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
}

.media-placeholder {
  width: 100%;
  min-height: 200px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.post-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-of-type { border-bottom: none; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.comment-time { color: var(--text-faint); font-size: 0.75rem; }

.comment-body {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   NACHRICHTEN / CHAT
══════════════════════════════════════════ */
.messages-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px 0;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.msg-mine {
  align-self: flex-end;
  background: rgba(149,1,1,0.12);
  border: 1px solid rgba(149,1,1,0.25);
  border-bottom-right-radius: 4px;
}

.msg-theirs {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-text { color: var(--text-primary); }

.msg-meta {
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: 4px;
  text-align: right;
}

.msg-mine .msg-meta { text-align: right; }
.msg-theirs .msg-meta { text-align: left; }

/* ══════════════════════════════════════════
   ADMIN PANEL – Tabs
══════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding-bottom: 0;
}

.admin-tab {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all var(--transition);
  position: relative;
  bottom: -1px;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.admin-tab.active {
  color: var(--accent);
  background: var(--bg-card);
  border-color: var(--border);
  border-bottom-color: var(--bg-card);
}

/* ══════════════════════════════════════════
   FILE UPLOAD DROP ZONE
══════════════════════════════════════════ */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(149,1,1,0.04);
}

.file-drop-icon { font-size: 2rem; margin-bottom: 8px; }

.file-drop-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .community-detail { grid-template-columns: 1fr; }
  .community-detail-media { position: static; }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .topbar-nav { order: 3; width: 100%; flex-wrap: wrap; gap: 2px; }
  .topbar-link { font-size: 0.78rem; padding: 5px 8px; }
  .main-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .macro-grid { grid-template-columns: repeat(2, 1fr); }
  .community-card { max-width: 100%; }
  .community-card-media { width: 100%; }
  .admin-tabs { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .topbar-user .user-greeting { display: none; }
  .community-detail { grid-template-columns: 1fr; }
}

/* ╔══════════════════════════════════════════════════════╗
   ║  APP NAVIGATION  –  Mobile-first, fixed bars         ║
   ╚══════════════════════════════════════════════════════╝ */

.topbar,
.nav-menu-wrapper,
.hamburger-btn,
.menu-overlay { display: none !important; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ─────────────────────────────────────────
   TOP BAR
───────────────────────────────────────── */
.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(72px + env(safe-area-inset-top, 0px));
  background: var(--bg-card);
  display: flex;
  align-items: center;
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 0;
  gap: 14px;
  box-sizing: border-box;
}

.app-topbar__avatar {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
}

.app-topbar__avatar svg {
  display: block;
  width: 46px;
  height: 46px;
}

.app-topbar__greeting { flex: 1; min-width: 0; }

.app-topbar__hello {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.app-topbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  position: relative;
}

.app-topbar__btn svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.app-topbar__btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ─────────────────────────────────────────
   SUB-NAV TABS
───────────────────────────────────────── */
.app-subnav {
  position: fixed;
  top: calc(72px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
  z-index: 490;
  height: 50px;
  background: var(--bg-card);
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  padding: 0;
  gap: 0;
}

.app-subnav__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  transition: color 0.18s;
  letter-spacing: 0.01em;
}

.app-subnav__tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 15%; right: 15%;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 0.18s;
}

.app-subnav__tab:hover { color: var(--text-primary); }

.app-subnav__tab--active {
  color: var(--accent);
  font-weight: 700;
}

.app-subnav__tab--active::after {
  background: var(--accent);
}

.app-subnav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  line-height: 1;
}

/* ─────────────────────────────────────────
   MAIN CONTENT
───────────────────────────────────────── */
.app-main {
  margin-top: calc(122px + env(safe-area-inset-top, 0px));
  margin-bottom: 66px;
  padding: 16px 14px;
  box-sizing: border-box;
  min-height: calc(100vh - 122px - 66px);
}

.app-main * { max-width: 100%; }

.app-main.main-content,
.app-main > .main-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

.app-main--no-subnav {
  margin-top: calc(72px + env(safe-area-inset-top, 0px)) !important;
}

/* ─────────────────────────────────────────
   BOTTOM NAV
───────────────────────────────────────── */
.app-bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.app-bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  height: 62px;
  padding: 10px 2px;
  box-sizing: border-box;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s;
}

.app-bottomnav__item:hover { color: var(--text-faint); }
.app-bottomnav__item--active { color: var(--accent); }

.app-bottomnav__icon {
  display: block;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-bottomnav__label {
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  display: block;
}

.app-main {
  margin-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

/* ─────────────────────────────────────────
   DETAILS / ACCORDION – Chevron-Rotation
───────────────────────────────────────── */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

details[open] > summary .details-chevron {
  transform: rotate(180deg);
}
