/* Orbit — shell + social surfaces (rail, feed, posts, people, profile,
   notifications, tab bar). css/orbit.css layers the product components
   (aura, habits, battle, mentor, coaches, onboarding) on top.

   Design contract (DESIGN.md): Noto Sans chrome, Noto Sans Mono for data and
   eyebrow labels, flat monochrome accent, amber reserved for aura, hairline
   borders, 4px grid, radius scale 4/8/12/16/20, no gradients, no shadows. */

[hidden] {
  display: none !important;
}

/* =====================================================================
   1. Roots + local tokens
   Tokens live on BOTH roots — .orbit-onboarding is a sibling of
   #orbit-app and inherits nothing from it.
   ===================================================================== */
#orbit-app,
.orbit-onboarding {
  --ig-line: var(--border);
  --ig-dim: var(--text-muted);
  --ig-faint: var(--text-faint);
  --ig-post-w: 560px;
  --ig-radius: var(--radius-md, 12px);
  /* Aura — the product currency. Light theme needs the darker amber:
     #F5A524 measures ~2:1 on white, far below the 4.5:1 floor. */
  --aura: #F5A524;
  font-family: var(--font-ui, var(--font-main));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[data-theme="light"] #orbit-app,
[data-theme="light"] .orbit-onboarding {
  --aura: #9A6700;
}
#orbit-app .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
}
html[data-auth-check="pending"] #orbit-app,
html[data-auth-check="pending"] .orbit-onboarding {
  visibility: hidden;
}
#orbit-app.app-shell {
  height: 100dvh;
  flex-direction: row;
  background: var(--bg-app);
}

/* =====================================================================
   2. Left nav rail
   ===================================================================== */
#orbit-app .chat-history-panel {
  width: 245px;
  min-width: 245px;
  max-width: 245px;
  border-right: 1px solid var(--ig-line);
  background: var(--bg-app);
}
#orbit-app .chat-sidebar-inner {
  background: transparent;
  border: 0;
  padding: 8px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}
#orbit-app .chat-sidebar-top {
  padding: 16px 12px 12px;
  display: block;
}
#orbit-app .brand-logo {
  height: 28px;
  width: auto;
}
/* Compact square mark — only used by the 72px icon rail. */
.ig-brand-mark {
  display: none;
  width: 28px;
  height: 28px;
  color: var(--text);
}

.ig-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ig-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--btn-radius, var(--radius-pill, 999px));
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease-out, ease);
  white-space: nowrap;
}
.ig-nav-item:hover {
  background: rgba(var(--on-rgb), 0.05);
}
.ig-nav-item:active {
  transform: scale(0.98);
}
.ig-nav-item .material-symbols-rounded {
  font-size: 24px;
  flex: none;
  color: var(--ig-dim);
  transition: color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.ig-nav-item:hover .material-symbols-rounded {
  color: var(--text);
}
/* Current destination: weight + filled icon + quiet fill. */
.ig-nav-item.active {
  font-weight: 600;
  background: rgba(var(--on-rgb), 0.05);
}
.ig-nav-item.active .material-symbols-rounded {
  color: var(--text);
  font-variation-settings: "FILL" 1;
}
.ig-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-nav-badge {
  position: absolute;
  top: 5px;
  left: 24px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill, 999px);
  background: var(--sent-neg);
  color: var(--bg-app);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--bg-app);
  box-sizing: content-box;
  pointer-events: none;
}
/* =====================================================================
   3. Top bar + stage + columns
   ===================================================================== */
#orbit-app .chat-navbar {
  border-bottom: 1px solid var(--ig-line);
  background: var(--bg-app);
  min-height: 56px;
  gap: 10px;
}
#orbit-app .chat-sidebar-toggle {
  display: none;
}
.ig-topbar-brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: none;
}
/* No top bar on desktop — the rail is the whole navigation. It stays only
   for the coach conversation header and on mobile. */
@media (min-width: 768px) {
  #orbit-app:not(.in-coach) .chat-navbar { display: none; }
}

/* The chat shell's workspace has no min-height and overflow: visible, so in
   the mobile column layout it refuses to shrink below its content — the
   panels then never scroll and body{overflow:hidden} eats the rest of the
   page. Scoped here so chat.html keeps its own behavior. */
#orbit-app .chat-workspace {
  min-height: 0;
}
.orbit-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.orbit-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.orbit-panel[hidden] {
  display: none !important;
}

/* Generic centered column (used by non-feed views). */
.orbit-col {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.orbit-col.narrow {
  max-width: 560px;
}

/* =====================================================================
   4. Feed layout — centered post column + right rail
   ===================================================================== */
.ig-feed-layout {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px 16px 96px;
  margin: 0 auto;
  width: 100%;
  max-width: calc(var(--ig-post-w) + 320px + 48px + 32px);
}
.ig-feed-col {
  width: 100%;
  max-width: var(--ig-post-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ig-rail {
  width: 320px;
  flex: none;
  position: sticky;
  top: 0;
  align-self: flex-start;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 1264px) {
  .ig-rail { display: none; }
  .ig-feed-layout { max-width: var(--ig-post-w); gap: 0; }
}
.ig-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ig-dim);
  margin-top: 12px;
  padding: 4px 0;
}
.ig-rail-all {
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui, inherit);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  transition: color var(--dur-base) var(--ease-out);
}
.ig-rail-all:hover { color: var(--ig-dim); }
.ig-rail-foot {
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--ig-faint);
  line-height: 1.5;
}

/* =====================================================================
   5. Feed tabs + composer entry
   ===================================================================== */
.orbit-feed-tabs {
  display: flex;
  border-bottom: 1px solid var(--ig-line);
}
.orbit-feed-tab {
  flex: 1;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ig-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 48px;
  padding: 12px 8px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.orbit-feed-tab:hover { color: var(--text); }
.orbit-feed-tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--text);
}

.orbit-composer {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--ig-line);
  border-radius: var(--ig-radius);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.orbit-composer:hover { border-color: var(--ig-dim); }
.orbit-composer:focus-within { border-color: var(--accent); }
.orbit-composer textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  resize: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  max-height: 200px;
  outline: none;
}
.orbit-composer textarea::placeholder { color: var(--ig-faint); }
.orbit-composer-col { flex: 1; min-width: 0; }

/* =====================================================================
   6. The post card
   ===================================================================== */
.ig-post {
  background: var(--surface);
  border: 1px solid var(--ig-line);
  border-radius: var(--ig-radius);
  overflow: hidden;
}
.ig-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 4px;
}
.ig-avatar-btn {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: var(--btn-radius, var(--radius-pill, 999px));
  line-height: 0;
}
.ig-post-id {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ig-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  transition: color var(--dur-base) var(--ease-out);
}
.ig-username:hover { color: var(--ig-dim); }
.ig-dot { color: var(--ig-faint); font-size: 12px; }
.ig-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ig-dim);
}
.ig-follow-inline {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  transition: color var(--dur-base) var(--ease-out);
}
/* Accent is now the same ink as text — a color-to-text hover would be
   invisible. Shift to the soft accent step instead (distinct in both themes). */
.ig-follow-inline:hover { color: var(--text-accent-soft, var(--text)); }

/* Hashtags inside post bodies. */
.kbody .tag { color: var(--accent); font-weight: 500; }

/* ---- Action row: every icon carries a visible word ---- */
.ig-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 8px;
}
.ig-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--btn-radius, var(--radius-pill, 999px));
  background: transparent;
  color: var(--ig-dim);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease-out, ease),
    color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.ig-act .material-symbols-rounded { font-size: 20px; }
.ig-act:hover {
  background: rgba(var(--on-rgb), 0.06);
  color: var(--text);
}
.ig-act:active { transform: scale(0.96); }
.ig-act.ig-save { margin-left: auto; }
.ig-act.ig-like.active { color: var(--aura); }
.ig-act.ig-like.active .material-symbols-rounded { font-variation-settings: "FILL" 1; }
.ig-act.ig-save[aria-pressed="true"] { color: var(--text); }
.ig-act.ig-save[aria-pressed="true"] .material-symbols-rounded { font-variation-settings: "FILL" 1; }
.ig-act-label { font-size: 12.5px; font-weight: 500; }
.kcount {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ig-viewall {
  display: block;
  padding: 4px 16px;
  border: 0;
  background: transparent;
  color: var(--ig-dim);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: color var(--dur-base) var(--ease-out);
}
.ig-viewall:hover { color: var(--text); }
.ig-comments {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-comment {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}
.ig-comment .ig-username { margin-right: 6px; }
.ig-comment-text { color: var(--text); }

.ig-comment-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--ig-line);
}
.ig-comment-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  min-height: 36px;
}
.ig-comment-input input::placeholder { color: var(--ig-faint); }
.ig-post-comment {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  transition: color var(--dur-base) var(--ease-out);
}
.ig-post-comment:hover { color: var(--text-accent-soft, var(--text)); }

/* =====================================================================
   7. Buttons
   ===================================================================== */
.ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--btn-radius, var(--radius-pill, 999px));
  min-height: 44px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  transition: background var(--dur-fast, 120ms) var(--ease-out, ease),
    border-color var(--dur-fast, 120ms) var(--ease-out, ease),
    color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.ig-btn:active { transform: scale(0.98); }
.ig-btn.primary {
  background: var(--accent);
  color: var(--on-accent, #fff);
}
.ig-btn.primary:hover { background: var(--accent-deep, var(--accent)); }
.ig-btn.secondary {
  background: var(--surface-soft);
  border-color: var(--ig-line);
  color: var(--text);
}
.ig-btn.secondary:hover { border-color: var(--ig-dim); }
.ig-btn.text {
  background: transparent;
  color: var(--accent);
  padding: 4px 10px;
}
/* Color alone can't signal hover on the mono accent — use a quiet fill. */
.ig-btn.text:hover { background: rgba(var(--on-rgb), 0.06); }
.ig-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* =====================================================================
   8. People rows + explore + search
   ===================================================================== */
.ig-people {
  display: flex;
  flex-direction: column;
}
.ig-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.ig-person-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.ig-person-sub {
  font-size: 12.5px;
  color: var(--ig-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-people.compact .ig-person { padding: 6px 0; }

.ig-explore {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}
.ig-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  padding: 8px 12px;
  min-height: 44px;
  margin-bottom: 20px;
  transition: border-color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.ig-search:focus-within { border-color: var(--accent); }
.ig-search .material-symbols-rounded { font-size: 20px; color: var(--ig-dim); }
.ig-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.ig-search input::placeholder { color: var(--ig-faint); }
.ig-search input::-webkit-search-cancel-button { display: none; }
.ig-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ig-dim);
  margin: 20px 0 8px;
}

.ig-empty-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 20px;
  text-align: center;
  color: var(--ig-dim);
}
.ig-empty-grid .material-symbols-rounded {
  font-size: 36px;
  color: var(--ig-faint);
  background: var(--surface-soft);
  border-radius: var(--radius-lg, 16px);
  padding: 18px;
  margin-bottom: 10px;
}
.ig-empty-grid h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
.ig-empty-grid p { margin: 0; font-size: 14px; max-width: 36ch; text-wrap: pretty; }

/* =====================================================================
   9. Profile
   ===================================================================== */
.ig-profile {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 96px;
}
.ig-profile-main { flex: 1; min-width: 0; }
.ig-profile-row1 {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ig-profile-handle {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ig-profile-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ig-dim);
  flex-wrap: wrap;
}
.ig-profile-stats strong {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ig-profile-bio { font-size: 14px; line-height: 1.55; color: var(--text); }
.ig-follows-you {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ig-dim);
  background: var(--surface-soft);
  border-radius: var(--radius-xs, 4px);
  padding: 3px 8px;
}

.ig-profile-tabs {
  display: flex;
  justify-content: center;
  gap: 48px;
  border-top: 1px solid var(--ig-line);
}
.ig-profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-top: 2px solid transparent;
  background: transparent;
  color: var(--ig-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 48px;
  padding: 16px 4px;
  margin-top: -1px;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out);
}
.ig-profile-tab .material-symbols-rounded { font-size: 14px; }
.ig-profile-tab:hover { color: var(--text); }
.ig-profile-tab.active { color: var(--text); border-top-color: var(--text); }

/* =====================================================================
   10. Mobile bottom tab bar
   ===================================================================== */
.ig-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--bg-app);
  border-top: 1px solid var(--ig-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}
.ig-tabbar-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--ig-dim);
  font-family: inherit;
  cursor: pointer;
}
.ig-tabbar-btn .material-symbols-rounded { font-size: 24px; }
.ig-tabbar-btn.active { color: var(--text); }
.ig-tabbar-btn.active .material-symbols-rounded { font-variation-settings: "FILL" 1; }
/* Every tab carries a visible word — icon-only nav is the worst pattern
   for cognitive accessibility. */
.ig-tabbar-label { font-size: 11px; font-weight: 500; line-height: 1; }
.ig-tabbar-btn.active .ig-tabbar-label { font-weight: 700; }
/* Centre-anchored so it can't push the last tab off-screen on narrow phones. */
.ig-tabbar .ig-nav-badge {
  top: 0;
  left: 50%;
  transform: translateX(2px);
  border-color: var(--bg-app);
}

/* =====================================================================
   11. Notifications
   ===================================================================== */
.orbit-notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-sm, 8px);
}
#orbit-app button.orbit-notif-row:hover { background: rgba(var(--on-rgb), 0.05); }
.orbit-notif-row.unread { background: rgba(var(--accent-rgb), 0.07); }
.orbit-notif-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm, 8px);
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.12);
}
.orbit-notif-icon .material-symbols-rounded {
  font-size: 19px;
  color: var(--accent-strong-text, var(--text-accent));
}
.orbit-notif-icon.neg .material-symbols-rounded { color: var(--sent-neg); }
.orbit-notif-text { flex: 1; min-width: 0; font-size: 14px; color: var(--text); line-height: 1.45; }
.orbit-notif-time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ig-faint);
}

/* =====================================================================
   12. Button normalization + keyboard focus
   ===================================================================== */
#orbit-app button.dm-row,
#orbit-app button.orbit-notif-row {
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out);
}
/* Rows that aren't buttons must not pretend to be. */
#orbit-app div.orbit-notif-row { cursor: default; }
#orbit-app button.ig-username {
  text-align: left;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visible focus everywhere, on both roots — one ring, one width. */
#orbit-app button:focus-visible,
#orbit-app a:focus-visible,
#orbit-app input:focus-visible,
#orbit-app textarea:focus-visible,
#orbit-app select:focus-visible,
#orbit-app [tabindex]:focus-visible,
.orbit-onboarding button:focus-visible,
.orbit-onboarding input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs, 4px);
}
/* Rail items live in a scroll container — draw their ring inward so it
   can't be clipped by the rail's overflow. */
#orbit-app .ig-nav-item:focus-visible {
  outline-offset: -3px;
  border-radius: var(--btn-radius, var(--radius-pill, 999px));
}

/* =====================================================================
   13. Section heads, empty states, misc
   ===================================================================== */
.orbit-section-head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ig-dim);
  margin: 8px 2px 0;
}
.orbit-empty {
  text-align: center;
  color: var(--ig-dim);
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.orbit-inbox-preview {
  font-size: 12.5px;
  color: var(--ig-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orbit-suggest-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.orbit-post-name { font-weight: 600; color: var(--text); cursor: pointer; }

.lab-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}
.lab-head p {
  margin: 0;
  color: var(--ig-dim);
  font-size: 14px;
  line-height: 1.55;
  max-width: 56ch;
  text-wrap: pretty;
}

/* =====================================================================
   14. Coach chat surface
   ===================================================================== */
#orbit-app .fmsg.friend .fbubble {
  background: var(--surface-soft);
  border-color: transparent;
}
#orbit-app .friend-chat,
#orbit-app .friend-messages { background: transparent; }

/* =====================================================================
   15. Responsive — icon rail (768–1263), then mobile tab bar (<768)
   ===================================================================== */
/* The rail's visibility is driven by the viewport, never by the chat shell's
   .sidebar-open class. Without this, resizing up from mobile leaves the rail
   collapsed-but-focusable (invisible controls still in the tab order). */
@media (min-width: 768px) {
  #orbit-app:not(.sidebar-open) .chat-history-panel {
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    border-right-color: var(--ig-line);
  }
}

@media (max-width: 1263px) and (min-width: 768px) {
  #orbit-app .chat-history-panel {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }
  #orbit-app .chat-sidebar-inner { padding: 6px 8px 12px; align-items: center; }
  #orbit-app .chat-sidebar-top { padding: 14px 0 10px; }
  /* The wordmark can't fit a 56px content box — swap in the square mark. */
  #orbit-app .brand-logo { display: none; }
  #orbit-app .ig-brand-mark { display: block; }

  #orbit-app .ig-nav-label { display: none; }

  /* Tighter rhythm so every destination fits without the rail scrolling. */
  #orbit-app .ig-nav { align-items: stretch; gap: 2px; overflow-x: hidden; }
  #orbit-app .ig-nav-item { justify-content: center; padding: 10px 0; gap: 0; }

  /* A count would overflow a 56px item — show a plain dot at this width. */
  #orbit-app .ig-nav-badge {
    left: auto;
    right: 13px;
    top: 5px;
    width: 9px;
    height: 9px;
    min-width: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  /* Rail becomes a bottom tab bar; the app shell goes single column. */
  #orbit-app.app-shell { flex-direction: column; }
  #orbit-app .chat-history-panel,
  #orbit-app .chat-sidebar-backdrop { display: none !important; }
  #orbit-app .ig-tabbar { display: flex; }
  #orbit-app .ig-topbar-brand { display: block; }
  #orbit-app .chat-navbar { min-height: 52px; padding-left: 16px; padding-right: 16px; }

  #orbit-app .ig-feed-layout { padding: 0 0 84px; }
  #orbit-app .ig-feed-col { gap: 0; max-width: 100%; }
  /* Full-bleed cards on phones. */
  #orbit-app .ig-post { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
  #orbit-app .orbit-composer { border-radius: 0; border-left: 0; border-right: 0; }
  #orbit-app .orbit-col { padding: 16px 12px 96px; }
  #orbit-app .ig-explore,
  #orbit-app .ig-profile { padding: 16px 12px 96px; }
  #orbit-app .ig-profile-stats { gap: 20px; flex-wrap: wrap; }
  #orbit-app .ig-profile-tabs { gap: 0; }
  #orbit-app .ig-profile-tab { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ig-act, .ig-nav-item, .ig-btn, .orbit-composer, .orbit-feed-tab, .ig-search,
  .ig-rail-all, .ig-username, .ig-follow-inline, .ig-viewall, .ig-post-comment,
  .ig-profile-tab, #orbit-app button.dm-row, #orbit-app button.orbit-notif-row {
    transition: none;
  }
  .ig-act:active, .ig-btn:active, .ig-nav-item:active { transform: none; }
}
