/* =============================================================
   Base
   ============================================================= */

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

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #d2d2d7;
  --primary: #0071e3;
  --primary-hover: #0060c0;
  --danger: #e53935;
  --danger-hover: #c62828;
  --success: #2e7d32;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* =============================================================
   Debug Nav
   ============================================================= */

#debug-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 8px;
  padding-top: max(6px, env(safe-area-inset-top));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.debug-nav-link {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.debug-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.debug-nav-link:hover {
  color: #fff;
}

/* Offset content below debug nav */
body {
  padding-top: 40px;
}

/* =============================================================
   Password Gate
   ============================================================= */

#password-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#password-gate.unlocked {
  display: none;
}

.gate-inner {
  text-align: center;
  width: 100%;
  max-width: 320px;
  padding: 0 24px;
}

.gate-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.gate-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.gate-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#gate-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #111;
  color: #fff;
  font-size: 16px;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
}

#gate-input:focus {
  border-color: #555;
}

#gate-form .btn {
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
}

.gate-error {
  color: #e53935;
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* =============================================================
   Home / Landing (Instagram-style)
   ============================================================= */

#home-view {
  background: #000;
  min-height: 100vh;
  color: #fafafa;
}

#home-view.active {
  display: block !important;
}

.home-container {
  max-width: 470px;
  margin: 0 auto;
  padding: 0 0 100px;
}

.ig-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 16px 16px;
}

.ig-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.ig-info {
  flex: 1;
}

.ig-username {
  font-size: 22px;
  font-weight: 400;
  color: #fafafa;
  margin-bottom: 4px;
}

.ig-bio {
  font-size: 14px;
  color: #a8a8a8;
  line-height: 1.4;
}

.ig-stats {
  display: flex;
  gap: 0;
  padding: 12px 0;
  margin: 0 16px;
  border-top: 1px solid #262626;
  border-bottom: 1px solid #262626;
}

.ig-stat {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: #a8a8a8;
}

.ig-stat strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 2px;
}

/* Post grid */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}

.ig-grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #555;
  font-size: 14px;
}

.ig-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #1a1a1a;
}

.ig-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ig-grid-item:hover img {
  transform: scale(1.03);
  opacity: 0.85;
}

.ig-grid-item .ig-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}

.ig-grid-item:hover .ig-grid-overlay {
  opacity: 1;
}

/* Floating sign-up capsule */
.floating-capsule {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 40px;
  border-radius: 50px;
  border: none;
  background: #fafafa;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.floating-capsule:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 28px rgba(0,0,0,0.6);
}

.floating-capsule:active {
  transform: translateX(-50%) scale(0.97);
}

/* Post detail modal */
.post-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.post-modal.hidden {
  display: none;
}

.post-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.post-modal-content {
  position: relative;
  background: #1a1a1a;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.post-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fafafa;
  font-size: 28px;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  padding: 4px;
}

.post-modal-content img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.post-modal-body {
  padding: 20px 24px 24px;
}

.post-modal-body h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 8px;
}

.post-modal-body p {
  font-size: 14px;
  color: #a8a8a8;
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-line;
}

.post-modal-body .btn {
  background: #fafafa;
  color: #000;
}

.post-modal-body .btn:hover {
  background: #e0e0e0;
}

/* =============================================================
   Notifications
   ============================================================= */

#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 360px;
}

.notification.show {
  transform: translateX(0);
}

.notification.info {
  background: var(--primary);
  color: white;
}

.notification.success {
  background: var(--success);
  color: white;
}

.notification.error {
  background: var(--danger);
  color: white;
}

/* =============================================================
   Views
   ============================================================= */

.view {
  display: none !important;
}

.view.active {
  display: block !important;
}

/* =============================================================
   Auth View
   ============================================================= */

#auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

#auth-view.active {
  display: flex !important;
}

.auth-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-header {
  padding: 32px 32px 0;
  text-align: center;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.auth-tabs {
  display: flex;
  margin: 24px 32px 0;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-body {
  padding: 24px 32px 32px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}

.btn-oauth:hover {
  background: var(--bg);
  box-shadow: var(--shadow);
}

.btn-oauth svg {
  width: 18px;
  height: 18px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =============================================================
   Forms
   ============================================================= */

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

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

.form-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.form-link:hover {
  text-decoration: underline;
}

/* =============================================================
   Buttons
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================================
   App Shell (post-login)
   ============================================================= */

.hidden {
  display: none !important;
}

#app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 20px 24px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar nav {
  flex: 1;
  padding: 8px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(0, 113, 227, 0.06);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 800px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* =============================================================
   Dashboard
   ============================================================= */

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.dashboard-header img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

/* =============================================================
   Onboarding
   ============================================================= */

#onboarding-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0f;
}

#onboarding-view.active {
  display: flex !important;
}

.onboarding-container {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 560px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.onboarding-preview {
  flex: 1;
  background: #0d0d14;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.onboarding-controls {
  flex: 1;
  padding: 40px 32px;
  overflow-y: auto;
}

.onboarding-controls h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.onboarding-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

/* =============================================================
   Orb Canvases
   ============================================================= */

.orb-canvas-large {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.orb-canvas-small {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.orb-canvas-medium {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.orb-canvas-large canvas,
.orb-canvas-small canvas,
.orb-canvas-medium canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* =============================================================
   Pass Customization
   ============================================================= */

#pass-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0f;
}

#pass-view.active {
  display: flex !important;
}

.pass-preview-bg {
  background: #1a1a2e !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pass-mockup {
  width: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: background-color 0.3s ease;
}

.pass-mockup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
}

.pass-mockup-logo {
  font-size: 14px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.pass-mockup-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.7;
  transition: color 0.3s ease;
}

.pass-mockup-strip {
  height: 80px;
  background: linear-gradient(135deg, #2d1b69, #7c3aed, #2563eb);
  margin: 0 12px;
  border-radius: 8px;
}

.pass-mockup-body {
  padding: 16px 20px;
}

.pass-mockup-field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 2px;
  transition: color 0.3s ease;
}

.pass-mockup-field-value {
  font-size: 20px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.pass-mockup-footer {
  display: flex;
  justify-content: center;
  padding: 8px 20px 20px;
}

.pass-mockup-qr {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.pass-mockup-qr svg {
  width: 44px;
  height: 44px;
  color: #333;
}

.color-pickers {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.color-picker-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker-row input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--surface);
}

.color-picker-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-row input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.color-hex {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.pass-status {
  min-height: 20px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

/* =============================================================
   Sliders
   ============================================================= */

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.slider-label .slider-value {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, monospace;
  min-width: 36px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.dashboard-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

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

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

/* =============================================================
   Profile
   ============================================================= */

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.avatar-wrapper img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-wrapper .avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-wrapper input[type="file"] {
  display: none;
}

.profile-email {
  font-size: 14px;
  color: var(--text-secondary);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* =============================================================
   Preferences
   ============================================================= */

.pref-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.pref-row:last-child {
  border-bottom: none;
}

.pref-key {
  font-weight: 600;
  font-size: 14px;
  min-width: 120px;
}

.pref-value {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  word-break: break-all;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px;
  font-size: 14px;
}

.pref-add-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pref-add-form h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 768px) {
  #app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  .sidebar-brand {
    padding: 0 16px 12px;
    font-size: 16px;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }

  .nav-link {
    padding: 8px 16px;
    white-space: nowrap;
  }

  .sidebar-footer {
    padding: 12px 16px;
    border-top: none;
  }

  .main-content {
    padding: 20px 16px;
  }

  .form-row {
    flex-direction: column;
  }

  .pref-row {
    flex-wrap: wrap;
  }

  .onboarding-container {
    flex-direction: column;
  }

  .onboarding-preview {
    min-height: 280px;
  }

  .onboarding-controls {
    padding: 24px 20px;
  }
}
