:root {
  --bg: #0f1220;
  --panel: #171a2b;
  --text: #edf0ff;
  --muted: #9aa2c3;
  --accent: #6c8cff;
  --supervisor: #8b5cf6;
  --parent: #10b981;
  --gened: #f59e0b;
  --sped: #ef4444;
  --district: #06b6d4;
  --advocate: #f43f5e;
  --coach: #22c55e;
  --bubble: #20243a;
  --border: #2a2f4a;
  --header-bg-start: #14182a;
  --header-bg-end: #0f1220;
  --panel-header-bg: #14182a;
  --tabs-bg: #0b0e1c;
  --avatar-bg: #0b0e1c;
  --code-bg: #0b0e1c;
  --section-border: rgba(255, 255, 255, 0.08);
  --section-bg: rgba(255, 255, 255, 0.02);
  --section-summary-bg: rgba(255, 255, 255, 0.03);
  --section-divider: rgba(255, 255, 255, 0.05);
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.auth-header p {
  margin: -4px 0 16px;
  color: #cbd5f5;
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-size: 14px;
  color: #d1d5db;
}

.auth-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2b3243;
  background: #0f131b;
  color: #f9fafb;
}

.auth-form button {
  margin-top: 8px;
}

.auth-error {
  background: #3b1212;
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 12px;
}

.auth-link {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.auth-link a {
  color: var(--accent);
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-header h2,
.auth-header h3 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-header p {
  margin: 0 0 12px;
  color: #d1d5db;
  font-size: 14px;
}

.auth-collab {
  margin: 8px 0 12px;
  color: #d1d5db;
  font-size: 13px;
  line-height: 1.5;
}

.auth-collab a {
  color: #c7d2fe;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-collab a:hover {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.7);
}

/* auth-two-col removed - login/signup use centered single card */

body.light-mode {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #1e2130;
  --muted: #6b7280;
  --accent: #6c8cff;
  --bubble: #eef1f7;
  --border: #dde1ec;
  --header-bg-start: #ffffff;
  --header-bg-end: #f4f6fa;
  --panel-header-bg: #f7f8fc;
  --tabs-bg: #eef1f7;
  --avatar-bg: #f0f2f8;
  --code-bg: #eef1f7;
  --section-border: rgba(0, 0, 0, 0.1);
  --section-bg: rgba(0, 0, 0, 0.015);
  --section-summary-bg: rgba(0, 0, 0, 0.03);
  --section-divider: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; padding: 0; color: var(--text); background: var(--bg);
  font-family: "IBM Plex Sans", "Source Sans 3", "Noto Sans", "Helvetica Neue", "Nimbus Sans", sans-serif;
}

body.landing-page {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(108, 140, 255, 0.07), transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(139, 92, 246, 0.05), transparent 50%),
    var(--bg);
}

body.landing-page header {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

header { padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg); }
.header-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; }
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-content {
  position: relative;
}

.header-tutorial-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

header h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
header .subtitle { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
  .header-content {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Panel visibility controls */
.panel-controls {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  background: transparent;
  flex-wrap: wrap;
  justify-content: center;
}

.show-panel-btn {
  background: var(--bubble);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.show-panel-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(108, 140, 255, 0.3);
}
/* Sidebar toggle button in header */
.sidebar-toggle-header {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
}

.sidebar-toggle-header:hover {
  background: var(--bubble);
  color: var(--text);
}

.nav-buttons { display: flex; gap: 10px; align-items: center; }
.tutorial-header-btn {
  margin-left: auto;
}
.header-tutorial-actions .tutorial-header-btn {
  margin-left: 0;
}
.walkthrough-replay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.nav-btn { 
  background: var(--bubble); 
  color: var(--text); 
  text-decoration: none; 
  padding: 8px 14px; 
  border-radius: 8px; 
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: var(--advocate);
  border-color: var(--advocate);
  color: white;
}

main {
  padding: 0;
  height: calc(100vh - 52px);
}
main.landing-main {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  min-height: calc(100vh - 52px);
  padding: 56px 24px 72px;
}

/* Dynamic column sizing when panels are hidden */
.conversation-panels.one-hidden { grid-template-columns: 1fr 1fr; }
.conversation-panels.two-hidden { grid-template-columns: 1fr; }

/* Quick answer mode handled by .conversation-panels.quick-answer-mode */

.input-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; height: fit-content; }
.field { display: grid; gap: 8px; margin-bottom: 14px; }
label { color: var(--muted); font-size: 13px; }
input[type="file"], textarea {
  width: 100%; background: var(--bubble); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 14px;
}
.actions { display: flex; justify-content: flex-end; }
button {
  background: var(--accent); color: white; border: none; border-radius: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.05); }
.clear-btn {
  background: var(--advocate); font-size: 12px; padding: 6px 10px;
}
.conversation-history { 
  margin-bottom: 20px; 
  padding-bottom: 20px; 
  border-bottom: 1px solid var(--border);
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.conversation-history h3 { 
  margin: 0 0 12px; 
  color: var(--muted); 
  font-size: 14px; 
  flex-shrink: 0;
}
.conversation-history .transcript {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 8px;
}
.conversation-history .transcript::-webkit-scrollbar {
  width: 6px;
}
.conversation-history .transcript::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 3px;
}
.conversation-history .transcript::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}
.msg.user .avatar, .msg.user .meta .name { color: var(--accent); }

/* Panel box styling */
.panel-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: opacity 0.3s ease;
}

.panel-box.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--panel-header-bg);
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hide-panel-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hide-panel-btn:hover {
  background: var(--border);
  color: var(--text);
}

.panel-content {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for proper flexbox scrolling */
}

/* PDF Viewer Panel */
.pdf-viewer-panel .panel-content {
  padding: 0;
  overflow: hidden; /* PDF viewer needs hidden, not auto */
}

/* PDF Tabs (Chrome-style) */
.pdf-tabs {
  display: flex;
  background: var(--tabs-bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.pdf-tabs::-webkit-scrollbar {
  height: 6px;
}

.pdf-tabs::-webkit-scrollbar-track {
  background: var(--tabs-bg);
}

.pdf-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.pdf-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  min-width: 120px;
  max-width: 200px;
  position: relative;
  transition: all 0.2s;
}

.pdf-tab:hover {
  background: var(--bubble);
}

.pdf-tab.active {
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
}

.pdf-tab-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.pdf-tab-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-tab.active .pdf-tab-name {
  color: var(--accent);
  font-weight: 600;
}

/* PDF Viewers Container */
.pdf-viewers {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.pdf-viewer,
.pdf-viewers .text-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.pdf-viewer.active,
.pdf-viewers .text-viewer.active {
  display: block;
}

.pdf-viewer {
  border: none;
  background: white;
}

.text-viewer {
  overflow-y: auto;
  padding: 16px;
  background: var(--bubble);
}

.text-viewer.active {
  display: block;
}

.text-viewer-content {
  color: var(--text);
  line-height: 1.6;
}

.notes-viewer {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bubble);
  height: 100%;
  box-sizing: border-box;
}

.notes-viewer.active {
  display: flex;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notes-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notes-save-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.notes-save-btn:hover {
  background: var(--bg);
}

.notes-status {
  font-size: 12px;
  color: var(--muted);
  min-width: 70px;
}

.notes-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--panel);
}

.notes-textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.coach-notes {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  position: sticky;
  bottom: 0;
  background: var(--panel);
  z-index: 3;
}

.coach-notes-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--panel-header-bg);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.coach-notes-toggle:hover {
  background: var(--panel);
}

.coach-notes-caret {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.coach-notes.collapsed .coach-notes-toggle {
  margin-bottom: 0;
}

.coach-notes .notes-textarea {
  min-height: 140px;
}

.selection-popover {
  position: fixed;
  z-index: 2000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.selection-popover.mobile-selection-popover {
  left: 12px;
  right: 12px;
  bottom: 14px;
  top: auto;
  border-radius: 12px;
}

.selection-popover-actions {
  display: flex;
  gap: 8px;
}

.selection-action-btn {
  border: 1px solid var(--border);
  background: var(--panel-header-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.selection-action-btn:hover {
  background: var(--panel);
  border-color: var(--accent);
}

.selection-action-btn.primary {
  background: var(--panel-header-bg);
  color: var(--text);
  border-color: var(--border);
}

.liked-text-highlight {
  background: #fde68a;
  color: #111827;
  border-radius: 2px;
  padding: 0 2px;
}

.walkthrough-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
}

.walkthrough-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.62);
}

.walkthrough-highlight {
  position: fixed;
  border: 2px solid #fde68a;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 2201;
}

.walkthrough-tooltip {
  position: fixed;
  width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 2202;
}

.walkthrough-step-count {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.walkthrough-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.walkthrough-body {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.walkthrough-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.walkthrough-tooltip.mobile {
  width: auto;
}

@media (max-width: 900px) {
  .walkthrough-actions {
    justify-content: space-between;
  }
}

.empty-viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-style: italic;
  padding: 40px 20px;
  text-align: center;
}

.conversation { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0; min-height: 200px; }
.conversation-main { }
.conversation-coach { }
.conversation-coach .panel-content {
  overflow: hidden;
}
.conversation-coach .transcript {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  padding-bottom: 8px;
}
.participants { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--panel-header-bg); }
.participants.participants-with-actions { align-items: center; }
.persona-edit-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--bubble);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.persona-edit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.persona-edit-btn:hover:not(:disabled) {
  border-color: var(--accent);
}
.pill { padding: 6px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all 0.2s ease; user-select: none; }
.pill:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.3); opacity: 0.9; }
.pill.active { border-width: 2px; font-weight: 600; box-shadow: 0 0 0 2px currentColor; opacity: 1; }
.pill.supervisor { border-color: var(--supervisor); color: var(--supervisor); }
.pill.parent { border-color: var(--parent); color: var(--parent); }
.pill.gened { border-color: var(--gened); color: var(--gened); }
.pill.sped { border-color: var(--sped); color: var(--sped); }
.pill.district { border-color: var(--district); color: var(--district); }
.pill.advocate { border-color: var(--advocate); color: var(--advocate); }
.pill.coach { border-color: var(--coach); color: var(--coach); }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; font-style: italic; display: block; }
.agent-block {
  display: none;
  padding: 8px 8px 2px;
  border-bottom: 1px solid var(--border);
}

.transcript {
  padding: 8px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.msg {
  display: flex;
  width: 100%;
}

.msg.agent {
  justify-content: flex-start;
}

.msg.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 82%;
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 14px;
  line-height: 1.6;
}

.msg.user .bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

.msg.user.pending-user-message .bubble {
  opacity: 0.92;
}

.msg.agent .bubble {
  max-width: 90%;
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
}

.message-actions {
  margin-top: 8px;
  display: none;
  justify-content: flex-end;
}

.message-like-btn {
  border: 1px solid var(--border);
  background: var(--panel-header-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.message-like-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
}

.message-like-btn.liked {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
}

.message-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  margin-bottom: 4px;
}

.msg.user .message-header {
  display: none;
}

.content {
  white-space: normal;
  line-height: 1.6;
}

.content p {
  margin: 0 0 12px 0;
}

.content p:last-child {
  margin-bottom: 0;
}

.content ul, .content ol {
  margin: 8px 0 12px 0;
  padding-left: 20px;
}

.content li {
  margin: 4px 0;
}

.content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
}

.content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.content pre code {
  background: none;
  padding: 0;
}

.content h1, .content h2, .content h3 {
  margin: 16px 0 8px 0;
  font-weight: 600;
}

.typing-indicator {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Legacy avatar/meta styles for history/imported sections */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--avatar-bg);
  color: var(--muted);
}

.meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}

.meta .name {
  font-weight: 700;
}

.meta .role {
  color: var(--muted);
  font-size: 12px;
}

.bubble.is-collapsible {
  position: relative;
  padding-bottom: 36px;
}

.bubble.is-collapsible .content {
  transition: max-height 0.25s ease;
}

.bubble.is-collapsible.collapsed .content {
  max-height: 180px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
}

.collapse-toggle {
  position: absolute;
  right: 16px;
  bottom: 10px;
  background: transparent;
  color: var(--accent);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collapse-toggle::after {
  content: '▾';
  font-size: 10px;
  transition: transform 0.2s ease;
}

.bubble.is-collapsible.collapsed .collapse-toggle::after {
  transform: rotate(-90deg);
}

.collapsible-section {
  border: 1px solid var(--section-border);
  border-radius: 10px;
  margin: 8px 0;
  overflow: hidden;
  background: var(--section-bg);
}

.collapsible-section summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 10px 12px;
  background: var(--section-summary-bg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapsible-section summary::-webkit-details-marker {
  display: none;
}

.collapsible-section summary::before {
  content: '▸';
  font-size: 12px;
  transition: transform 0.2s ease;
}

.collapsible-section[open] summary::before {
  transform: rotate(90deg);
}

.collapsible-body {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--section-divider);
}

.content h1 { font-size: 18px; }
.content h2 { font-size: 16px; }
.content h3 { font-size: 14px; }

.content strong {
  font-weight: 600;
}

.content em {
  font-style: italic;
}

/* Color-code messages by agent */
.msg.supervisor .avatar, .msg.supervisor .meta .name { color: var(--supervisor); }
.msg.parents_agent .avatar, .msg.parents_agent .meta .name { color: var(--parent); }
.msg.gen_ed_teacher_agent .avatar, .msg.gen_ed_teacher_agent .meta .name { color: var(--gened); }
.msg.sped_slp_agent .avatar, .msg.sped_slp_agent .meta .name { color: var(--sped); }
.msg.district_rep_agent .avatar, .msg.district_rep_agent .meta .name { color: var(--district); }
.msg.advocate_agent .avatar, .msg.advocate_agent .meta .name { color: var(--advocate); }
.msg.research_coach_agent .avatar, .msg.research_coach_agent .meta .name { color: var(--coach); }

footer { padding: 16px 24px; color: var(--muted); border-top: 1px solid var(--border); }

/* Parent personalities page layout - equal width 3 columns */
.parents-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px;
  height: calc(100vh - 140px);
}

/* Context notice */
.context-notice {
  background: var(--accent);
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Imported context */
.imported-context {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  max-height: 300px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.imported-context h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.imported-context .transcript {
  flex: 1;
  overflow-y: auto;
  max-height: 240px;
  padding-right: 8px;
}

.imported-context .transcript::-webkit-scrollbar {
  width: 4px;
}

.imported-context .transcript::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 2px;
}

.imported-context .transcript::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 2px;
}

.msg.imported .avatar, .msg.imported .meta .name {
  color: var(--supervisor);
  opacity: 0.8;
}

.msg.imported .bubble {
  background: var(--panel);
  opacity: 0.9;
}

/* Parent personality pill colors */
.pill.skeptical { border-color: #dc2626; color: #dc2626; }
.pill.confused { border-color: #7c3aed; color: #7c3aed; }
.pill.upset { border-color: #ea580c; color: #ea580c; }
.pill.legally-assertive { border-color: #059669; color: #059669; }
.pill.demanding { border-color: #c2410c; color: #c2410c; }
.pill.detached { border-color: #6b7280; color: #6b7280; }
.pill.inconsistent { border-color: #7c2d12; color: #7c2d12; }
.pill.collaborative { border-color: #0891b2; color: #0891b2; }
.pill.advocacy-driven { border-color: #be123c; color: #be123c; }

/* Parent personality message colors */
.msg.skeptical_parent .avatar, .msg.skeptical_parent .meta .name { color: #dc2626; }
.msg.confused_parent .avatar, .msg.confused_parent .meta .name { color: #7c3aed; }
.msg.upset_parent .avatar, .msg.upset_parent .meta .name { color: #ea580c; }
.msg.legally_assertive_parent .avatar, .msg.legally_assertive_parent .meta .name { color: #059669; }
.msg.demanding_parent .avatar, .msg.demanding_parent .meta .name { color: #c2410c; }
.msg.detached_parent .avatar, .msg.detached_parent .meta .name { color: #6b7280; }
.msg.inconsistent_parent .avatar, .msg.inconsistent_parent .meta .name { color: #7c2d12; }
.msg.collaborative_parent .avatar, .msg.collaborative_parent .meta .name { color: #0891b2; }
.msg.advocacy_driven_parent .avatar, .msg.advocacy_driven_parent .meta .name { color: #be123c; }

/* Loading indicator */
.loading-indicator {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  margin-top: 20px;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.loading-subtext {
  color: var(--muted);
  font-size: 13px;
}

/* Streaming loading indicator (inside panels) */
.streaming-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.streaming-spinner {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.streaming-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.streaming-progress {
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
}

/* Per-agent loading state inside transcript */
.agent-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.agent-loading-state .streaming-spinner {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}

.agent-loading-state .streaming-text {
  font-size: 14px;
  font-weight: 500;
}

/* Pill loading animation */
.pill.loading {
  position: relative;
  animation: pill-pulse 1.5s ease-in-out infinite;
}

@keyframes pill-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Pill with response indicator */
.pill.has-response {
  position: relative;
}

.pill.has-response::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--panel);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Landing page styles */
.landing-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-left,
.landing-right {
  animation: landing-rise 0.6s ease both;
}

.landing-right { animation-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
  .landing-left,
  .landing-right {
    animation: none;
  }
}

.landing-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px;
  text-align: center;
}

.landing-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.landing-title {
  font-size: 30px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 16px;
}

.landing-description {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 32px;
}

.landing-form {
  text-align: left;
  margin-bottom: 32px;
}

.landing-form .field {
  margin-bottom: 16px;
}

.landing-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.landing-form input,
.landing-form textarea,
.landing-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bubble);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.landing-form input:focus,
.landing-form textarea:focus,
.landing-form select:focus {
  outline: none;
  border-color: rgba(108, 140, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.12);
  background: var(--panel);
}

.landing-form input[type="file"] {
  padding: 10px 12px;
  background: var(--bubble);
}

.landing-form textarea {
  min-height: 120px;
  font-size: 15px;
}

.landing-form .actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.landing-submit {
  font-size: 15px;
  padding: 12px 28px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.landing-submit:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.auth-cta-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-cta-title {
  font-size: 22px;
  margin: 0;
}

.auth-cta-text {
  margin: 0;
  color: var(--muted);
}

.auth-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.landing-submit.secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Main app shell */
.app-shell {
  display: grid;
  grid-template-columns: 18% 1fr;
  gap: 0;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  height: 100%;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.new-chat-form .landing-submit {
  width: 100%;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b93a7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.sidebar-section.stakeholder-section {
  border-left: 2px solid #3b82f6;
  padding-left: 12px;
}

.sidebar-section.stakeholder-section .sidebar-title {
  color: #e5edff;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(37, 99, 235, 0.28);
}

.sidebar-section.instant-section {
  border-left: 2px solid #10b981;
  padding-left: 12px;
}

.sidebar-section.instant-section .sidebar-title {
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.conversation-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.sidebar-survey-reminder {
  margin-top: auto;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.sidebar-survey-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #fde68a;
}

.sidebar-survey-button {
  width: 100%;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(217, 119, 6, 0.3);
  color: #fff7d6;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sidebar-survey-button:hover {
  background: rgba(217, 119, 6, 0.45);
  border-color: rgba(251, 191, 36, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.conversation-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.conversation-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex: 1;
  min-width: 0;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.16);
}

.conversation-item:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

.conversation-title {
  font-size: 14px;
  font-weight: 600;
}

.conversation-date {
  font-size: 12px;
  color: #9aa2b1;
}

.conversation-empty {
  font-size: 12px;
  color: #9aa2b1;
}

.conversation-delete-form {
  margin: 0;
  display: flex;
}

.conversation-delete-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 8px;
  padding: 0;
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conversation-delete-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  color: #f3f4f6;
}

.main-panel {
  padding: 20px 24px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Grid layout for conversation panels inside main-panel */
.conversation-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.conversation-panels.quick-answer-mode {
  grid-template-columns: 1fr 1fr;
}

.conversation-panels.quick-answer-mode.one-hidden,
.conversation-panels.quick-answer-mode.two-hidden {
  grid-template-columns: 1fr;
}

.centered-form {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6vh;
  flex: 1;
  overflow-y: auto;
}

.centered-form .landing-right {
  width: min(680px, 100%);
}

.summary-view {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6vh;
  flex: 1;
  overflow-y: auto;
}

.summary-card {
  width: min(700px, 100%);
  background: var(--panel);
  border-radius: 14px;
  padding: 28px 32px;
  border: 1px solid var(--border);
}

.summary-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}

.summary-card.empty {
  text-align: center;
  color: #9aa2b1;
}

.summary-meta {
  color: #9aa2b1;
  font-size: 13px;
  margin-top: -6px;
}

.summary-body {
  margin-top: 16px;
}

.summary-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .sidebar {
  display: none;
}

.dashboard-main {
  display: block;
  background: var(--bg);
  padding: 0;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.landing-container .loading-indicator {
  margin-top: 32px;
}

/* Claude-style agent chat inputs */
.agent-chat-input {
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.field-help {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.persona-selection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bubble);
}

.persona-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.persona-check input {
  width: 14px;
  height: 14px;
}

.persona-check.all-check {
  grid-column: 1 / -1;
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  transition: border-color 0.2s ease;
}

.chat-input-container:focus-within {
  border-color: var(--accent);
}

.agent-chat-textarea {
  flex: 1;
  min-height: 40px;
  max-height: 200px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.agent-chat-textarea::placeholder {
  color: var(--muted);
}

.agent-chat-submit {
  flex-shrink: 0;
  min-width: 64px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-chat-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.agent-chat-submit:active {
  transform: translateY(0);
}

.agent-chat-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.coach-mode-fieldset,
.coach-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.coach-mode-toggle {
  padding: 10px 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.coach-mode-options,
.coach-mode-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.coach-mode-toggle .mode-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Theme toggle button */
.theme-toggle {
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 60px;
}

.theme-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Show/hide theme text based on mode */
.theme-icon-light {
  display: none;
}

.theme-icon-dark {
  display: inline;
}

body.light-mode .theme-icon-light {
  display: inline;
}

body.light-mode .theme-icon-dark {
  display: none;
}

/* Two-column landing layout */
.landing-two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  width: 100%;
  align-items: center;
}

.landing-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-left .landing-icon {
  font-size: 44px;
  margin-bottom: 2px;
}

.landing-left .landing-title {
  font-size: 32px;
  font-weight: 700;
  text-align: left;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.landing-left .landing-description {
  text-align: left;
  margin-bottom: 4px;
  font-size: 15.5px;
}

.landing-left .landing-description-secondary {
  margin-top: 6px;
  color: var(--muted);
}

.landing-left .auth-collab {
  color: var(--muted);
}

.landing-left .auth-collab a {
  color: var(--accent);
}

.landing-left .auth-collab a:hover {
  color: #8ea6ff;
  border-color: rgba(142, 166, 255, 0.75);
}

.landing-features-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.landing-features-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.compliance-alert {
  margin-top: 18px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.14);
  border-radius: 12px;
  padding: 14px 16px;
}

.compliance-alert h3 {
  margin: 0 0 8px;
  color: #fef3c7;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.compliance-alert p {
  margin: 0 0 10px;
  color: #fff7d6;
  font-size: 13px;
  line-height: 1.55;
}

.compliance-alert p:last-child {
  margin-bottom: 0;
}

body.light-mode .sidebar-section.stakeholder-section .sidebar-title {
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.16);
}

body.light-mode .sidebar-section.instant-section .sidebar-title {
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.16);
}

body.light-mode .conversation-delete-btn {
  color: #475569;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(148, 163, 184, 0.5);
}

body.light-mode .conversation-delete-btn:hover {
  background: rgba(15, 23, 42, 0.12);
  border-color: rgba(71, 85, 105, 0.55);
  color: #0f172a;
}

body.light-mode .sidebar-survey-reminder {
  border-color: rgba(180, 83, 9, 0.5);
  background: rgba(251, 191, 36, 0.2);
}

body.light-mode .sidebar-survey-text {
  color: #78350f;
}

body.light-mode .sidebar-survey-button {
  background: rgba(217, 119, 6, 0.18);
  border-color: rgba(180, 83, 9, 0.45);
  color: #78350f;
}

body.light-mode .sidebar-survey-button:hover {
  background: rgba(217, 119, 6, 0.3);
  border-color: rgba(180, 83, 9, 0.65);
}

body.light-mode .compliance-alert {
  border-color: rgba(180, 83, 9, 0.5);
  background: rgba(251, 191, 36, 0.2);
}

body.light-mode .compliance-alert h3 {
  color: #92400e;
}

body.light-mode .compliance-alert p {
  color: #78350f;
}

.landing-highlight {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.landing-highlight:hover {
  text-decoration: underline;
}

.landing-right {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.landing-right .landing-form {
  margin-bottom: 0;
}

/* Mode selection buttons */
.mode-selection {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bubble);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--muted);
}

.mode-btn:hover {
  background: rgba(108, 140, 255, 0.06);
  color: var(--text);
}

.mode-btn.active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mode-btn-icon {
  font-size: 24px;
}

.mode-btn-text {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

/* Placeholder tag (for future use) */
.placeholder-tag {
  display: inline-block;
  background: var(--bubble);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 1200px) {
  .conversation-panels { grid-template-columns: 1fr 1fr; }
  .conversation-panels .conversation-coach { grid-column: 1 / -1; }
  .parents-main { grid-template-columns: 320px 1fr; }
}

@media (max-width: 768px) {
  .landing-two-col {
    grid-template-columns: 1fr;
  }
}

/* ==================== Top Action Toolbar ==================== */
.top-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ai-warning {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  min-width: 200px;
}

.ai-warning-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ai-warning-text {
  line-height: 1.3;
}

.persona-prompt-modal-content {
  max-width: 760px;
}

.persona-prompt-textarea {
  width: 100%;
  resize: vertical;
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bubble);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
}

.persona-prompt-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bubble);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.toolbar-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.toolbar-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.toolbar-btn.primary:hover {
  filter: brightness(1.1);
}

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

.toolbar-btn.danger:hover {
  filter: brightness(1.1);
}

.toolbar-btn-icon {
  font-size: 14px;
}

/* Export button styling */
.toolbar-btn.export-btn {
  background: var(--coach);
  border-color: var(--coach);
  color: white;
}

.toolbar-btn.export-btn:hover {
  filter: brightness(1.1);
}

.export-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.export-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.export-btn-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== Modal Overlay ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 70%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-header-bg);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  color: var(--text);
  line-height: 1.7;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--panel-header-bg);
}

/* Smaller confirmation dialog */
.modal-content.modal-confirm {
  max-width: 480px;
}

.modal-confirm .modal-body {
  text-align: center;
}

.modal-confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.modal-confirm-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text);
}

.modal-confirm-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px 0;
}

.modal-confirm-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  text-align: left;
}

.modal-confirm-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.modal-confirm-option input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.modal-confirm-option label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.modal-confirm-option label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  flex-shrink: 0;
}

.mode-banner .mode-label {
  color: var(--muted);
}

.mode-banner .mode-name {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

/* Tutorial modal styles */
.tutorial-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tutorial-section {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tutorial-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tutorial-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--accent);
}

.tutorial-section h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.tutorial-mode-tag {
  display: inline-block;
  margin: 0 0 12px 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bubble);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.tutorial-section p {
  margin: 0 0 12px 0;
  color: var(--text);
}

.tutorial-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.tutorial-section li {
  margin: 8px 0;
}

.tutorial-banner {
  margin: 16px 0 20px 0;
  display: flex;
  justify-content: center;
}

.tutorial-banner img {
  width: 100%;
  max-width: 720px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.tutorial-row {
  display: flex;
  gap: 20px;
  margin: 16px 0 20px 0;
  align-items: flex-start;
}

.tutorial-text {
  flex: 1 1 60%;
}

.tutorial-media {
  flex: 1 1 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tutorial-media img {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.tutorial-media .placeholder-tag {
  margin: 0;
  text-align: center;
}

.tutorial-warning {
  color: #b42318;
  background: #fff3f1;
  border: 1px solid #fecdca;
  border-radius: 10px;
  padding: 10px 12px;
}

.tutorial-dashed-divider {
  border-top: 1px dashed rgba(147, 197, 253, 0.75);
  margin: 12px 0 20px;
}

.tutorial-feature-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 20px;
  color: var(--muted);
}

.tutorial-feature-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto 0;
  border-top: 1px dashed rgba(147, 197, 253, 0.75);
  transform: translateY(-50%);
}

.tutorial-feature-divider span {
  position: relative;
  z-index: 1;
  background: var(--panel);
  padding: 0 10px;
}

.tutorial-highlight-text {
  color: #93c5fd;
  font-weight: 700;
}

@media (max-width: 900px) {
  .tutorial-row {
    flex-direction: column;
  }

  .tutorial-media {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .message-actions {
    display: flex;
  }
}

/* Preparation Summary tab/viewer */
.summary-viewer {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bubble);
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

.summary-viewer.active {
  display: flex;
}

.summary-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.summary-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--panel-header-bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.summary-section-header .section-icon {
  font-size: 16px;
}

.summary-section-content {
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-height: 200px;
  overflow-y: auto;
}

.summary-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
}

/* AI Summary Styles */
.summary-section.ai-summary {
  background: var(--panel);
  border: none;
  border-radius: 0;
}

.summary-section.ai-summary .summary-section-content {
  max-height: none;
  padding: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.summary-section.ai-summary h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-section.ai-summary h2:not(:first-child) {
  margin-top: 24px;
}

.summary-section.ai-summary h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 8px 0;
}

.summary-section.ai-summary ul {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.summary-section.ai-summary li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.summary-section.ai-summary li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: bold;
}

.summary-section.ai-summary p {
  margin: 8px 0;
  color: var(--muted);
}

.summary-section.ai-summary strong {
  color: var(--text);
  font-weight: 600;
}

.summary-section.ai-summary hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

@media (max-width: 900px) {
  .dashboard-main {
    height: auto;
    min-height: calc(100vh - 52px);
    overflow-y: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    position: relative;
    height: auto;
    min-height: calc(100vh - 52px);
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    width: min(86vw, 340px);
    height: calc(100vh - 52px);
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.35);
    border-right: 1px solid var(--border);
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 8, 23, 0.58);
    z-index: 1100;
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    display: block;
  }

  .main-panel {
    padding: 12px;
    height: auto;
    overflow: visible;
  }

  .conversation-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: auto;
  }

  .conversation-panels .conversation-coach {
    grid-column: auto;
  }

  .panel-box {
    width: 100%;
    height: auto;
    min-height: 420px;
  }

  .panel-content {
    max-height: 70vh;
  }

  .pdf-viewer-panel {
    min-height: 72vh;
  }

  .pdf-viewers {
    min-height: 56vh;
  }

  .top-action-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-warning {
    min-width: 100%;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .toolbar-btn {
    flex: 1;
    justify-content: center;
    min-height: 40px;
  }

  .participants {
    gap: 6px;
    padding: 10px 12px;
  }

  .persona-selection-list {
    grid-template-columns: 1fr;
  }

  .pill {
    padding: 8px 12px;
    font-size: 13px;
  }

  .agent-block {
    padding: 10px 6px 4px;
  }

  .transcript {
    padding: 10px 4px 14px;
  }

  .bubble,
  .msg.agent .bubble {
    max-width: 100%;
  }

  .message-like-btn {
    min-height: 40px;
    font-size: 13px;
    padding: 6px 14px;
  }

  .selection-popover-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .selection-action-btn {
    min-height: 42px;
    font-size: 13px;
    font-weight: 600;
  }

  .agent-chat-input {
    padding: 10px;
  }

  .agent-chat-submit {
    min-width: 78px;
    height: 40px;
    font-size: 14px;
  }

  .modal-content {
    max-width: 95%;
  }
}

@media (max-width: 768px) {
  .mode-banner {
    justify-content: center;
    padding: 8px 0;
  }
}
