/* App shell: sidebar · topbar · content (+ optional preview panel) · mobile
   drawer and bottom tabs. The existing tab panels render inside .content-area. */

#app-screen.visible {
  display: flex; flex-direction: row;
  height: 100vh; height: 100dvh; overflow: hidden;
  position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.rc-side {
  position: relative; z-index: 30;
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  margin: 12px 0 12px 12px; border-radius: var(--radius-panel);
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 12px; overflow-y: auto; overflow-x: hidden;
  transition: width var(--transition-slow), flex-basis var(--transition-slow), transform var(--transition-slow);
  scrollbar-width: thin;
}
.rc-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; min-height: 40px; }
.rc-brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #19C3AE, var(--brand-primary));
  box-shadow: 0 6px 16px -6px rgba(0, 168, 149, .7);
}
.rc-brand-mark svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rc-wordmark { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--text-primary); white-space: nowrap; }
.rc-wordmark span { color: var(--brand-ink); }

/* Store card (keeps the old #agent-pulse ids the dashboard script fills in) */
.rc-store {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 14px; background: var(--surface-secondary); border: 1px solid var(--border);
}
/* The old strip styles (.agent-pulse: fixed 44px height, hidden until .ready) */
.rc-store.agent-pulse { height: auto; padding: 10px; flex-shrink: 0; flex-wrap: nowrap; row-gap: 0; }
.rc-store.agent-pulse:not(.ready) .rc-store-meta { visibility: hidden; }
.rc-store .pulse-name { margin-right: 0; }
.rc-store-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(140deg, var(--brand-blue), var(--brand-indigo));
}
.rc-store-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-store .pulse-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-store-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.rc-store .pulse-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; border: 0;
}
.rc-store .pulse-badge.live { background: var(--success-soft); color: var(--success-ink); }
.rc-store .pulse-badge.draft { background: var(--surface-hover); color: var(--text-secondary); }
.rc-store .pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rc-store .pulse-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.rc-store .pulse-meta-item svg { display: none; }

/* Nav */
.rc-nav { display: flex; flex-direction: column; gap: 2px; }
.rc-nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-tertiary); padding: 10px 12px 4px;
}
.rc-side .nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 0 12px; border-radius: var(--radius-button);
  color: var(--text-secondary); font-family: inherit; font-size: 14px; font-weight: 500; text-align: left;
  cursor: pointer; user-select: none; border: 0; background: transparent; width: 100%;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.rc-side .nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.rc-side .nav-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.rc-side .nav-item.active::before {
  content: ''; display: block; position: absolute; left: -12px; top: 10px; bottom: 10px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-primary);
}
.rc-side .nav-item .nav-icon { width: 20px; height: 20px; display: grid; place-items: center; color: inherit; }
.rc-side .nav-item .nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rc-side .nav-item .nav-text { flex: 1; }
.rc-side .nav-badge {
  display: none; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto;
  border-radius: 10px; background: var(--error); color: #fff;
  font-size: 11px; font-weight: 700; align-items: center; justify-content: center;
}
.rc-side .nav-badge.show { display: inline-flex; }

.rc-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.rc-profile-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-button); min-width: 0; }
.rc-side .sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--indigo-soft); color: var(--indigo-ink);
}
.rc-profile-text { min-width: 0; display: flex; flex-direction: column; }
.rc-profile-text strong { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rc-side .sidebar-footer-email { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Collapsed rail (desktop toggle) */
.nav-collapsed .rc-side { width: var(--sidebar-rail-w); flex-basis: var(--sidebar-rail-w); padding: 16px 10px; }
.nav-collapsed .rc-wordmark,
.nav-collapsed .rc-store-text,
.nav-collapsed .rc-nav-label,
.nav-collapsed .nav-text,
.nav-collapsed .rc-profile-text,
.nav-collapsed .rc-side-foot .btn-label { display: none; }
.nav-collapsed .rc-brand, .nav-collapsed .rc-store, .nav-collapsed .rc-profile-chip { justify-content: center; padding-left: 0; padding-right: 0; }
.nav-collapsed .rc-store { background: transparent; border: 0; }
.nav-collapsed .rc-side .nav-item { justify-content: center; padding: 0; }
.nav-collapsed .rc-side .nav-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.nav-collapsed .rc-nav-sep { display: block; height: 1px; background: var(--border); margin: 8px 6px; }
.rc-nav-sep { display: none; }

/* ── Main column ─────────────────────────────────────────────────────── */
.rc-body { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--topbar-h); margin: 12px 12px 0; padding: 0 12px;
  border-radius: var(--radius-panel);
}
.rc-topbar-spacer { flex: 1; }
.rc-content-row { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 12px 12px 0; }
.rc-content-row .content-area {
  flex: 1; min-width: 0; overflow-y: auto;
  padding: 28px 24px 40px 36px;
}
.rc-content-row .content-area > .tab-panel { max-width: 1100px; }
.rc-content-row .content-area > .tab-panel.wide { max-width: var(--content-max); }

/* Live preview: only beside the assistant setup pages */
.rc-content-row .preview-panel {
  display: none; width: 380px; flex: 0 0 380px; margin-top: 12px;
  border-radius: var(--radius-panel); overflow: hidden; border-left: 0;
}
.page-has-preview .rc-content-row .preview-panel { display: flex; }

/* ── Mobile drawer + bottom tabs (hidden on desktop) ─────────────────── */
.rc-overlay { display: none; }
.rc-tabbar { display: none; }
.rc-only-mobile { display: none !important; }
