/* Atlas Home Sprint 1 (Nov 16) — the home's navigation system.
 * Slim header, one primary bar (desktop top bar / mobile bottom bar,
 * same five in the same order), and the More hub sheet. Built to the
 * approved Atlas Home designs; palette rides styles.css variables. */

/* Wide frame on desktop while the dashboard is showing; work panes keep
 * a reading column inside it. */
@media (min-width: 900px) {
  #app:has(> #view-dash:not(.hidden)) { max-width: 1080px; }
  #app:has(> #view-dash:not(.hidden)) .tabpane:not(#tab-feed) {
    max-width: 680px; margin-left: auto; margin-right: auto;
  }
}
@media (max-width: 899px) {
  #app { padding-bottom: 108px; }
}

/* ---- slim header ---- */
.topbar.slim { margin-bottom: 10px; }
.topbar.slim .userbox { gap: 8px; }
.avatar-chip {
  width: 32px; height: 32px; border-radius: 50%;
  background: #222936; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--text);
}
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 999px;
  background: none; border: 1px solid var(--line); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.nav-badge {
  position: absolute; top: -5px; right: -5px;
  background: #fbbf24; color: #0b1220;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 999px; padding: 3px 6px;
}

/* ---- desktop primary bar ---- */
.primarynav { display: none; }
@media (min-width: 900px) {
  .primarynav {
    display: flex; gap: 4px; align-items: center;
    border-bottom: 1px solid var(--line); margin-bottom: 16px;
  }
}
.primarynav .ptab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--muted);
  font-size: 15px; font-weight: 600; padding: 10px 12px;
  cursor: pointer; width: auto;
}
.primarynav .ptab.active {
  background: none; border-color: var(--accent); color: var(--text);
}
.primarynav .ptab-live { color: var(--accent); }

/* ---- mobile bottom bar ---- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: rgba(15, 17, 21, 0.97); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .bottombar { display: none; } }
.bottombar .btab {
  position: relative; background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; padding: 6px 10px;
  cursor: pointer; width: auto;
}
.bottombar .btab svg { width: 22px; height: 22px; }
.bottombar .btab.active, .bottombar .tab.active {
  background: none; border-color: transparent; color: var(--accent);
}
.bottombar .btab .nav-badge { top: 0; right: 2px; }
.bottombar .live-tab { color: var(--text); }
.bottombar .live-circle {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--accent); margin-top: -24px;
  background: var(--card); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  display: block;
}
.bottombar .live-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- More hub sheet ---- */
.more-sheet { position: fixed; inset: 0; z-index: 60; }
.more-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.more-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 84vh; overflow-y: auto;
  background: var(--card); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  .more-panel {
    left: auto; right: 24px; bottom: auto; top: 64px; width: 340px;
    border: 1px solid var(--line); border-radius: 16px;
    max-height: 82vh; padding-bottom: 18px;
  }
}
.more-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.more-head .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.more-group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 14px 0 2px;
}
.more-row {
  display: flex; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; color: var(--text);
  font-size: 15px; font-weight: 600; padding: 12px 2px; cursor: pointer;
}
.more-panel .tab.more-row { background: none; border: 0; border-bottom: 1px solid var(--line); }
.more-panel .tab.more-row.active { background: none; color: var(--accent); border-color: var(--line); }
.more-note { margin-top: 12px; }

/* ---- One scheme, both layers (Manny's ruling, Nov 16) ----
 * The home follows the system setting: the feed already did; now the
 * frame does too. Dark keeps the app palette with the feed's blue as
 * the one blue; light adopts the feed's light palette wholesale, so
 * the panel melts into the page instead of floating in a dark frame.
 * Scoped to this page — home-nav.css loads only on the dashboard. */
:root { --accent: #7db4ff; }
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7; --card: #ffffff; --line: #dde3ea;
    --text: #14161a; --muted: #5d6b7f; --accent: #2f6fed;
    --good: #0a7d44;
  }
  .btn { background: #eceff3; }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
  .avatar-chip { background: #eceff3; }
  .bottombar { background: rgba(255, 255, 255, 0.97); }
  .switch .slider { background: #c9d2de; }
  .badge.b-muted { background: #e2e8f0; color: var(--muted); }
}
