:root {
  --bg-dark: #0f1115;
  --bg-sidebar: #17191e;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f2f5;
  --text-secondary: #8b92a5;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --success: #10b981;
  --glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.brand-logo {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-logo .workio {
  color: #ffffff;
}

.brand-logo .chat {
  color: #f97316; /* Vibrant Orange */
}

.brand-logo.large {
  font-size: 2.5rem;
  letter-spacing: -2px;
}

.brand-logo.medium {
  font-size: 1.75rem;
  letter-spacing: -1.2px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* Mobile hamburger button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 1rem;
  z-index: 1100;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.08); }

/* Sidebar overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* Dashboard responsive grid utility */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 1000px;
  width: 100%;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.sidebar-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.badge {
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: white;
  text-transform: uppercase;
}

.sidebar-header p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

/* Sidebar Nav Links */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
}

.sidebar-nav-item svg {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background-color: var(--bg-panel);
  color: var(--text-primary);
}

.sidebar-nav-item:hover svg {
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-nav-item.active svg {
  color: var(--accent-color);
}

.entries-nav {
  margin-top: 2rem;
  flex: 1;
  overflow-y: auto;
}

.entries-nav h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

#entries-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entry-item {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background-color: transparent;
}

.entry-item:hover {
  background-color: var(--bg-panel);
}

.entry-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.entry-item-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-item-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  padding: 2rem 3rem;
  gap: 2rem;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 40%);
}

.editor-section {
  flex: 3;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.editor-header {
  margin-bottom: 1.5rem;
}

#entry-title {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-left: -0.75rem; /* Offset padding to align text visually */
  transition: all 0.2s ease;
}

#entry-title:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

#entry-title:focus {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#entry-title::placeholder {
  color: rgba(139, 146, 165, 0.3);
}

.date-display {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#entry-content {
  flex: 1;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: inherit;
  resize: none;
  outline: none;
}

#entry-content::placeholder {
  color: rgba(139, 146, 165, 0.4);
}

.editor-footer {
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: flex-end;
}

.save-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.save-indicator::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

/* AI Hub Glassmorphism */
.glass-panel {
  background: rgba(23, 25, 30, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
}

.ai-hub {
  flex: 2;
  max-width: 400px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: max-content;
  max-height: 100%;
}

.ai-hub-header {
  margin-bottom: 1.5rem;
}

.ai-hub-header h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.ai-hub-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--glow);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-icon {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem;
}

.btn-icon:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Output Area */
.hidden {
  display: none !important;
}

#ai-output {
  margin-top: 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.output-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
}

.output-text {
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  overflow-y: auto;
  white-space: pre-wrap;
  flex: 1;
}

/* Loading Spinner */
#ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

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

.tag {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-color);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Amazon LP Radar ────────────────────────────────────────────────────── */

#view-amazon-radar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
  overflow-y: auto;
  padding-bottom: 2rem;
}

/* Coverage Wheel */
.radar-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1.5rem 2rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 20px;
}

.radar-svg-wrap {
  flex-shrink: 0;
}

#lp-radar-svg .lp-segment {
  transition: opacity 0.2s, filter 0.2s;
  cursor: pointer;
}
#lp-radar-svg .lp-segment:hover {
  opacity: 0.85;
  filter: brightness(1.2);
}
#lp-radar-svg .segment-label {
  font-size: 7px;
  fill: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  font-weight: 600;
}

.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.radar-legend h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.radar-legend p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.radar-coverage-count {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.radar-legend-pills {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.legend-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.legend-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* LP Board Grid */
.lp-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.lp-card {
  background: rgba(23, 25, 30, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 160px;
}
.lp-card.drag-over {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.lp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.lp-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.3;
}
.lp-score-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  min-width: 36px;
  text-align: center;
}
.lp-score-badge.strong  { background: rgba(16,185,129,0.2); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.lp-score-badge.partial { background: rgba(245,158,11,0.2); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.lp-score-badge.weak    { background: rgba(239,68,68,0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.lp-score-badge.none    { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* Story chips inside LP cards */
.lp-stories-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.story-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  user-select: none;
}
.story-chip:active { cursor: grabbing; }
.story-chip:hover {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.25);
  transform: translateY(-1px);
}
.story-chip.dragging {
  opacity: 0.4;
  transform: scale(0.97);
}
.story-chip-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-chip-meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.chip-icon {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}
.chip-icon.star    { background: rgba(139,92,246,0.2); color: #8b5cf6; }
.chip-icon.metrics { background: rgba(16,185,129,0.2); color: #10b981; }
.chip-score {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Missing indicator pills on weak story chips */
.chip-missing {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.lp-empty-msg {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem 0.5rem;
  opacity: 0.6;
}

/* LP card question tooltip */
.lp-card {
  position: relative;
}
.lp-tooltip {
  display: block;
  position: static;
  background: #1e2028;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lp-card:hover .lp-tooltip {
  display: block;
}
.lp-tooltip summary { cursor: pointer; font-size: .8rem; color: var(--text-secondary); }
.lp-tooltip[open] { max-height: 19rem; overflow-y: auto; }
.lp-tooltip summary:focus-visible, .text-button:focus-visible, .coach-story-card:focus-visible,
.story-chip:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.text-button { color: var(--text-primary); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: underline; }
.today-saved-entries { width: 100%; max-width: 900px; text-align: left; margin: 2rem 0; }
.today-saved-entries p { color: var(--text-secondary); margin: .75rem 0; }
.entry-date-group { font-weight: 600; margin-top: 1rem; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.story-markdown { overflow-wrap: anywhere; line-height: 1.7; margin: 1rem 0; }
.story-markdown h4 { margin: 1rem 0 .5rem; }
.markdown-item { padding-left: 1rem; }
.saved-portfolio { padding: 1rem; margin: 1rem 0; overflow-wrap: anywhere; }
.saved-portfolio summary { cursor: pointer; }
#view-portfolio { min-width: 0; padding-bottom: 3rem; }
#view-portfolio h3 { margin: 1.5rem 0 .75rem; }
#portfolio-copy-fallback { width: 100%; min-height: 12rem; }
.session-expired-banner { position: fixed; top: 0; left: 0; right: 0; padding: 1rem; z-index: 3000; background: #422006; color: #fef3c7; }
.session-expired-banner a { color: #fff; text-decoration: underline; }
@media (max-width: 650px) {
  #weak-stories-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #view-portfolio > .glass-panel { padding: 1rem !important; }
}
.lp-tooltip-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.lp-tooltip ol {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lp-tooltip li {
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* STAR Story Modal */
#star-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#star-modal {
  background: #17191e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
#star-modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
#star-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
#star-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}
#star-modal-body strong, #star-modal-body b {
  color: var(--accent-color);
}
#star-modal-lp-tags {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.lp-tag-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-color);
  cursor: pointer;
  transition: background 0.15s;
}
.lp-tag-chip:hover { background: rgba(99,102,241,0.3); }

/* Live recording pulse */
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.recording-pulse {
  animation: mic-pulse 1.2s ease-in-out infinite;
  border-radius: 8px;
}
/* Live transcript preview bubble */
#live-transcript-preview {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 2.5rem;
  max-height: 120px;
  overflow-y: auto;
  word-break: break-word;
}

/* ============================================================
   MOBILE RESPONSIVE  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  body {
    overflow: auto;
    height: auto;
  }
  .app-container {
    height: auto;
    min-height: 100vh;
  }

  /* Show hamburger */
  .mobile-menu-btn { display: flex; }

  /* Off-canvas sidebar drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: min(280px, 85vw);
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }

  /* Main content */
  .main-content {
    width: 100%;
    flex-direction: column;
    padding: 4.5rem 1rem 2rem;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    gap: 1.5rem;
  }

  /* Back button — flow in layout instead of absolute */
  #btn-back-home {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    align-self: flex-start;
    margin-bottom: 0.25rem;
  }

  /* Dashboard */
  #view-dashboard h1 { font-size: 1.5rem !important; line-height: 1.3; }
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 0.875rem; }
  .intent-card { padding: 1rem !important; }

  /* Career Co-Pilot chat on dashboard */
  #chat-output { height: 260px !important; }

  /* Vent view — stack vertically */
  #view-vent {
    flex-direction: column !important;
    gap: 1.25rem !important;
    margin-top: 0 !important;
  }
  .editor-section { height: auto; min-height: 35vh; }
  #entry-title { font-size: 1.4rem; margin-left: 0 !important; }
  #entry-content { min-height: 160px; }
  .ai-hub {
    max-width: 100% !important;
    width: 100% !important;
    flex: none !important;
    height: auto; max-height: none !important;
  }
  .editor-footer { flex-wrap: wrap; gap: 0.5rem; }
  .editor-tools { flex-wrap: wrap; }

  /* Mentor (prep) view */
  #view-prep { margin-top: 0 !important; }
  #weak-stories-grid { grid-template-columns: 1fr !important; }
  #coach-chat-messages { height: 260px !important; }

  /* Mentor story bar: stack header items */
  #coach-story-bar > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* Leadership Radar */
  .radar-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem;
    padding: 1.25rem !important;
  }
  .lp-board { grid-template-columns: 1fr !important; }

  /* Portfolio / Updates / Learn / Feedback */
  #view-portfolio, #view-updates, #view-learn, #view-feedback {
    margin-top: 0 !important;
  }
  #view-portfolio .glass-panel,
  #view-updates .glass-panel,
  #view-learn .glass-panel,
  #view-feedback .glass-panel {
    padding: 1.25rem !important;
  }

  /* Feedback form: stack type/rating fields */
  #feedback-form > div:first-child {
    flex-direction: column !important;
  }

  /* Portfolio header: stack title + button */
  #view-portfolio .glass-panel header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem;
  }

  /* Floating feedback button — ensure not overlapping chat */
  .floating-feedback-btn {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }

  /* STAR Modal */
  #star-modal {
    width: 95% !important;
    max-height: 90vh;
  }
}

/* Extra small (≤ 480px) */
@media (max-width: 480px) {
  .main-content { padding: 4rem 0.75rem 2rem; }
  #view-dashboard h1 { font-size: 1.25rem !important; }
  .intent-card h3 { font-size: 1rem; }
  #entry-title { font-size: 1.2rem; }
  .btn { font-size: 0.85rem; padding: 0.65rem 0.875rem; }
  .radar-coverage-count { font-size: 1.8rem; }
}

/* ─── Community Feed ─────────────────────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.7; }
}

.video-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.video-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.video-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.75rem;
}

.poster-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.poster-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.poster-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-role-badge {
  font-size: 0.72rem;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.video-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.video-time {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.video-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.video-delete-btn:hover {
  opacity: 1;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.video-wrapper {
  width: 100%;
  background: #000;
}

.video-player {
  width: 100%;
  max-height: 400px;
  display: block;
  outline: none;
}

.video-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.video-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.video-stats {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ─── Upload Drop Zone ───────────────────────────────────────────────────── */

.upload-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-drop-zone:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.04);
}

/* Upload modal overlay */
#upload-modal-overlay {
  align-items: center;
  justify-content: center;
}

/* Focused Today landing view */
.today-view {
  width: min(100%, 980px);
  padding: 1rem 0 2.5rem;
  text-align: left;
}

.today-heading {
  width: 100%;
  max-width: 650px;
  margin-bottom: 1.4rem;
}

.today-eyebrow,
.today-card-kicker,
.sidebar-nav-label {
  display: block;
  color: #a78bfa;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.today-eyebrow { margin-bottom: 0.75rem; }

.sidebar-nav-label {
  margin: 0.9rem 0 0.15rem 0.5rem;
}

.sidebar-nav-label:first-child { margin-top: 0; }

.today-heading h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin: 0 0 0.85rem;
}

.today-heading p {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.today-capture-card {
  width: 100%;
  max-width: 860px;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-color: rgba(139, 92, 246, 0.26);
  background: linear-gradient(130deg, rgba(99, 102, 241, 0.16), rgba(23, 25, 30, 0.7) 55%);
}

.today-card-kicker { margin-bottom: 0.55rem; }

.today-capture-card h2,
.first-entry-guide h2 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

.today-capture-card p,
.first-entry-guide p {
  color: var(--text-secondary);
  line-height: 1.55;
}

.capture-prompt-grid,
.today-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.capture-prompt {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border-color);
  background: rgba(9, 11, 15, 0.25);
  color: var(--text-primary);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.capture-prompt {
  min-height: 106px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.capture-prompt strong { font-size: 0.92rem; }
.capture-prompt span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.capture-prompt:hover {
  transform: translateY(-2px);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(129, 140, 248, 0.5);
}

.capture-prompt:focus-visible,
.today-primary-action:focus-visible {
  outline: 3px solid rgba(196, 181, 253, 0.9);
  outline-offset: 3px;
}

.today-primary-action {
  width: auto;
  margin-top: 1rem;
  padding: 0.8rem 1.25rem;
}

.capture-prompt.is-opening,
.today-primary-action.is-opening {
  cursor: wait;
  opacity: 0.72;
}

.capture-opening-status {
  margin: 0.8rem 0 0;
  color: #c4b5fd;
  font-size: 0.82rem;
  font-weight: 600;
}

.first-entry-guide {
  width: 100%;
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  border-color: rgba(16, 185, 129, 0.25);
}

/* Guided empty states */
.entries-empty {
  padding: 0.75rem 0.55rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}

.entries-empty button {
  display: block;
  margin-top: 0.45rem;
  padding: 0;
  color: #a78bfa;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.empty-state-copy {
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.88rem;
  line-height: 1.55;
}

.empty-state-action {
  width: auto;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
}

@media (max-width: 768px) {
  .today-view { padding: 0 0 2rem; }
  .today-heading h1 { font-size: 2rem; }
  .capture-prompt-grid { grid-template-columns: 1fr; }
  .today-primary-action { width: 100%; }
}

/* Account pages retain the existing Work IO surfaces while giving security
   settings and connection instructions a clear, readable content rhythm. */
.account-view {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.account-view-header {
  margin-bottom: 1.5rem;
}

.account-view-header h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  letter-spacing: -0.035em;
}

.account-view-header p {
  max-width: 640px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.account-card {
  padding: clamp(1.15rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
}

.account-note {
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1.4rem;
}

.account-form {
  display: grid;
  gap: 1rem;
}

.account-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
}

.account-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font: inherit;
}

.account-form input:focus {
  outline: 2px solid rgba(139, 92, 246, 0.65);
  outline-offset: 1px;
  border-color: var(--accent-color);
}

.account-form small,
.account-footnote {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.4rem;
}

.account-form button {
  width: auto;
  justify-self: start;
  min-width: 190px;
}

.account-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.account-status {
  min-height: 1.15rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.account-status.is-error,
.copy-status.is-error { color: #fca5a5; }
.account-status.is-success { color: #6ee7b7; }

.account-footnote { margin-top: 1.2rem; }
.account-footnote a,
.mcp-guide-section a,
.mcp-doc-links a {
  color: #c4b5fd;
  text-underline-offset: 3px;
}

.mcp-endpoint-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  border-color: rgba(139, 92, 246, 0.28);
}

.mcp-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

#mcp-server-url {
  display: block;
  color: var(--text-primary);
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  overflow-wrap: anywhere;
}

.copy-status {
  grid-column: 1 / -1;
  min-height: 1rem;
  color: #6ee7b7;
  font-size: 0.78rem;
}

.mcp-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.mcp-step {
  flex: 0 0 auto;
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding-top: 0.3rem;
}

.mcp-section-heading h2 {
  font-size: 1.12rem;
  margin-bottom: 0.3rem;
}

.mcp-section-heading p,
.mcp-unavailable-section > p,
.mcp-smallprint {
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.6;
}

.mcp-steps {
  display: grid;
  gap: 0.8rem;
  padding-left: 1.3rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.mcp-steps li { padding-left: 0.25rem; }
.mcp-steps li::marker { color: #a78bfa; font-weight: 700; }

.mcp-test-drive {
  display: flex;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
  margin-top: 1.4rem;
  padding-top: 1.2rem;
}

.mcp-test-drive > div { flex: 1 1 260px; }
.mcp-test-drive h3 { font-size: 0.97rem; margin-bottom: 0.25rem; }
.mcp-test-drive p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }
.mcp-test-drive .copy-status { flex-basis: 100%; }

.mcp-prompt {
  margin: 0.65rem 0 1rem;
  padding: 0.9rem 1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid rgba(167, 139, 250, 0.8);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.mcp-smallprint { font-size: 0.8rem; }
.mcp-unavailable-section { border-color: rgba(245, 158, 11, 0.24); }
.mcp-doc-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; margin-top: 1rem; font-size: 0.85rem; }

@media (max-width: 768px) {
  .account-view { padding-top: 0; }
  .mcp-endpoint-card { grid-template-columns: 1fr; }
  .mcp-endpoint-card .btn { width: 100%; }
  .account-form button { width: 100%; }
}
