/* Leadspanic Social — app shell. Status bar, top bar, body, bottom nav,
   per docs/redesign/HANDOFF.md "Shared chrome". Phone-first at 390px,
   fluid above that; sidebar layout at >=768px per the Responsive section. */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
body { overflow: hidden; }
a { color: var(--coral-tint); text-decoration: none; }
a:hover { color: var(--coral); }
button { font-family: inherit; }
img, svg { display: block; }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

/* ---------------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------------- */
.top-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 12px;
}
.top-bar-brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--coral);
  box-shadow: var(--glow-mark);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 17px;
  flex: none;
}
.top-bar-lockup { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 14px; letter-spacing: -.02em; }
.top-bar-lockup .accent { color: var(--coral); }
.top-bar-sublabel { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-size: 8.5px; letter-spacing: .14em; color: var(--coral-tint); }
.top-bar-title { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 25px; letter-spacing: var(--ls-heading); }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-input);
  background: var(--input);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}
.icon-btn.primary { background: var(--coral); box-shadow: var(--glow-coral); color: var(--on-accent); border: none; }
.icon-btn:hover { filter: brightness(1.08); }
.icon-btn:active { transform: scale(.97); }
.back-btn { color: var(--text-muted); display: flex; cursor: pointer; flex: none; }

/* ---------------------------------------------------------------------------
   Body
   ------------------------------------------------------------------------- */
.view-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.view-body.tight { gap: 12px; }
.view-body::-webkit-scrollbar { width: 0; height: 0; }

/* ---------------------------------------------------------------------------
   Bottom nav
   ------------------------------------------------------------------------- */
.bottom-nav {
  flex: none;
  height: calc(70px + env(safe-area-inset-bottom, 0px));
  padding: 9px 6px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--topbar);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: 9.5px;
  letter-spacing: .03em;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}
.nav-item.active { color: var(--coral); }
.nav-item svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------------
   Screen enter transition, reduced-motion aware
   ------------------------------------------------------------------------- */
.view-body { animation: lp-rise var(--dur-slow) var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .view-body { animation: none; }
  .live-chip-dot { animation: none; }
}

/* ---------------------------------------------------------------------------
   Bottom sheet (composer)
   ------------------------------------------------------------------------- */
.sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(8, 8, 11, .6);
  z-index: 40;
  display: none;
}
.sheet-scrim.open { display: block; }
.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 620px;
  top: 88px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  z-index: 41;
  transition: transform var(--dur-slow) var(--ease);
}
.sheet-scrim:not(.open) .sheet { transform: translate(-50%, 100%); }

/* ---------------------------------------------------------------------------
   Loading skeletons — token-shaped blocks, not spinners
   ------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--inset) 25%, var(--card) 50%, var(--inset) 75%);
  background-size: 200% 100%;
  animation: lp-shimmer 1.4s linear infinite;
  border-radius: var(--radius-input);
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; background: var(--inset); } }

/* ---------------------------------------------------------------------------
   Responsive: sidebar shell at >=768px
   ------------------------------------------------------------------------- */
@media (min-width: 768px) {
  body { overflow: auto; }
  #app {
    flex-direction: row;
    height: 100vh;
    max-width: none;
  }
  .bottom-nav {
    flex-direction: column;
    height: 100vh;
    width: 96px;
    grid-template-columns: none;
    grid-auto-rows: 64px;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: calc(18px + env(safe-area-inset-top, 0px)) 0 18px;
  }
  .view-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
  }
}
@media (min-width: 1120px) {
  /* Widen the column, but keep it a normal vertical stack — top bar above
     body, same as every other width. A two-pane master-detail split (thread
     beside the Inbox list) is content INSIDE #viewBody, scoped to the Inbox
     screen specifically, not a property of the shell itself: the shell's
     only two children are #topBar and #viewBody, and grid-template-columns
     here would place those two side by side instead of stacked, breaking
     every screen at this width. */
  .view-column { max-width: 960px; }
}
