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

:root {
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --border: #e2e8f0;
  --border-strong: #c7d4e3;
  --text-primary: #1F3A5F;
  --text-secondary: #4a6380;
  --text-tertiary: #8a9ab8;
  --accent: #22A06B;
  --accent-light: #EAF7F1;
  --accent-text: #1F3A5F;
  --amber: #b45309;
  --amber-light: #fffbeb;
  --red: #dc2626;
  --red-light: #fef2f2;
  --blue: #2563EB;
  --blue-light: #EFF6FF;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

html, body { height: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text-primary); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 220px; flex-shrink: 0; background: #1F3A5F; border-right: none; display: flex; flex-direction: column; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-mark { width: 30px; height: 30px; background: var(--accent); color: white; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; letter-spacing: 0.05em; font-family: 'DM Mono', monospace; flex-shrink: 0; }
.logo-text { font-size: 14px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }
.sidebar-nav { padding: 10px 10px; flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.6); text-decoration: none; font-size: 13px; transition: all 0.15s; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-item.active { background: var(--accent-light); color: var(--accent-text); font-weight: 500; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 6px; }
.user-info { font-size: 12px; color: rgba(255,255,255,0.5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-badge { font-size: 10.5px; color: var(--text-tertiary); font-family: 'DM Mono', monospace; }

/* Main */
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.view { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.view.active { display: flex; }
.view-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.view-title { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.view-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* Workspace */
.workspace { display: grid; grid-template-columns: 420px 1fr; flex: 1; overflow: hidden; }
.panel { overflow-y: auto; padding: 20px 24px; }
.input-panel { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 18px; }
.output-panel { background: var(--bg); position: relative; display: flex; flex-direction: column; overflow: hidden; }

/* Form */
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 7px; }
.panel-section { display: flex; flex-direction: column; }

/* Writing mode — removed for MVP */

/* Type buttons */
.select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.type-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; text-align: left; }
.type-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.type-btn.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 500; }
.type-btn:last-child { grid-column: 1 / -1; }

.select-field, .input-field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--text-primary); width: 100%; outline: none; transition: border-color 0.15s; appearance: none; }
.select-field:focus, .input-field:focus { border-color: var(--accent); }
.meta-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.meta-field { display: flex; flex-direction: column; }

/* Notes + voice */
.notes-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.notes-label-row .field-label { margin-bottom: 0; }
.voice-btn { display: flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.voice-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.voice-btn.recording { background: var(--red-light); border-color: var(--red); color: var(--red); }
.voice-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--red); margin-bottom: 7px; }
.voice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1s ease-in-out infinite; flex-shrink: 0; }

.notes-section { flex: 1; }
.notes-textarea { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--text-primary); width: 100%; min-height: 180px; resize: vertical; outline: none; line-height: 1.6; transition: border-color 0.15s; }
.notes-textarea:focus { border-color: var(--accent); background: var(--surface); }
.notes-textarea::placeholder { color: var(--text-tertiary); }
.char-count { font-size: 11px; color: var(--text-tertiary); text-align: right; margin-top: 5px; font-family: 'DM Mono', monospace; }

/* Generate button */
.generate-btn { background: var(--accent); color: white; border: none; border-radius: var(--radius-md); padding: 12px 20px; font-size: 14px; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s; width: 100%; letter-spacing: -0.01em; }
.generate-btn:hover { background: #143d27; }
.generate-btn:active { transform: scale(0.99); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Output */
.output-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex: 1; min-height: 200px; color: var(--text-tertiary); text-align: center; }
.empty-icon { width: 56px; height: 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.output-empty p { font-size: 13px; max-width: 200px; }
.output-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; flex: 1; min-height: 200px; }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; opacity: 0.3; animation: pulse 1.2s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.loading-text { font-size: 13px; color: var(--text-secondary); }

.output-content { display: flex; flex-direction: column; gap: 14px; flex: 1; overflow-y: auto; }
.output-toolbar { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; }
.output-meta { font-size: 12px; color: var(--text-secondary); }
.toolbar-actions { display: flex; gap: 6px; }
.tool-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all 0.15s; }
.tool-btn:hover { background: var(--bg); color: var(--text-primary); border-color: var(--border-strong); }
.tool-btn.copied { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* Flags */
.flags-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.flag-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.flag-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.flag-dot.missing { background: var(--amber); }
.flag-dot.risk { background: var(--red); }
.flag-dot.info { background: var(--blue); }
.flag-label { font-weight: 500; }
.flag-missing .flag-label { color: var(--amber); }
.flag-risk .flag-label { color: var(--red); }
.flag-info .flag-label { color: var(--blue); }
.flag-text { color: var(--text-secondary); }

/* Note sections (read view) */
.note-sections { display: flex; flex-direction: column; gap: 10px; }
.note-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.note-section-header { padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.note-section-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }
.note-section-body { padding: 12px 14px; font-size: 13.5px; line-height: 1.65; color: var(--text-primary); white-space: pre-wrap; }
.missing-field { background: var(--amber-light); color: var(--amber); padding: 2px 6px; border-radius: 4px; font-family: 'DM Mono', monospace; font-size: 12px; }


/* Full-page editor overlay */
.editor-overlay { position: absolute; inset: 0; background: var(--bg); z-index: 100; display: flex; flex-direction: column; }
.editor-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.editor-title-wrap { display: flex; align-items: center; gap: 10px; }
.editor-meta-label { font-size: 13px; color: var(--text-secondary); }
.editor-header-actions { display: flex; gap: 8px; align-items: center; }
.btn-save-close { background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); padding: 7px 16px; font-size: 13px; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-save-close:hover { background: #143d27; }
.editor-body { flex: 1; overflow-y: auto; padding: 32px; max-width: 860px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.editor-section { display: flex; flex-direction: column; gap: 6px; }
.editor-section-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }
.editor-section-textarea { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; font-size: 14px; font-family: 'DM Sans', sans-serif; line-height: 1.7; color: var(--text-primary); resize: vertical; min-height: 80px; outline: none; transition: border-color 0.15s; width: 100%; }
.editor-section-textarea:focus { border-color: var(--accent); }

/* Coming soon */
.coming-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex: 1; color: var(--text-tertiary); }
.cs-icon { color: var(--border-strong); }
.coming-soon p { font-size: 13px; max-width: 260px; text-align: center; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---- Role selector ---- */
.role-selector { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.role-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.role-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.role-btn.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 500; }
.role-btn.em.active { background: var(--accent); border-color: var(--accent); }
.role-btn.iwm.active { background: var(--blue); border-color: var(--blue); }
.role-btn.ees.active { background: #6B3FA0; border-color: #6B3FA0; }

/* ---- Phase row (hideable) ---- */
.phase-row { transition: opacity 0.2s; }
.phase-row.hidden { display: none; }

/* ---- Template select ---- */
.template-select-wrap { display: flex; flex-direction: column; }

/* ---- Bullet points in note sections ---- */
.note-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-bullets li {
  padding-left: 16px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.note-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ---- Note section title — sentence case, not all caps ---- */
.note-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  text-transform: none;
}

/* ================================================================
   PARTICIPANT COMPONENTS
   ================================================================ */

/* Participant select row */
.participant-select-row { display: flex; gap: 6px; }
.participant-select-row .select-field { flex: 1; }
.icon-btn { width: 34px; height: 34px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Participants layout */
.participants-layout { display: grid; grid-template-columns: 300px 1fr; flex: 1; overflow: hidden; }
.participants-list-panel { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.search-wrap { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.participants-list { flex: 1; overflow-y: auto; }
.list-empty { padding: 32px 20px; text-align: center; font-size: 13px; color: var(--text-tertiary); }

/* Participant list item */
.participant-list-item { display: flex; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; gap: 10px; }
.participant-list-item:hover { background: var(--bg); }
.participant-list-item.active { background: var(--accent-light); }
.pli-avatar { width: 32px; height: 32px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.participant-list-item.active .pli-avatar { background: var(--accent-text); }
.pli-main { flex: 1; min-width: 0; }
.pli-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-list-item.active .pli-name { color: var(--accent-text); }
.pli-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.pli-phase { font-size: 11.5px; color: var(--text-secondary); }
.pli-notes { font-size: 11.5px; color: var(--text-tertiary); }
.pli-notes-empty { font-style: italic; }
.pli-main { flex: 1; min-width: 0; }
.pli-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pli-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.pli-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.pli-count { font-size: 11px; color: var(--text-tertiary); font-family: 'DM Mono', monospace; }

/* Badges */
.badge { display: inline-block; font-size: 10.5px; font-weight: 500; padding: 2px 7px; border-radius: 99px; }
.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-gray { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }

/* Participant detail panel */
.participant-detail-panel { overflow-y: auto; padding: 24px 28px; background: var(--bg); }
.detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; color: var(--text-tertiary); text-align: center; }
.detail-empty p { font-size: 13px; max-width: 200px; }
.detail-content { display: flex; flex-direction: column; gap: 20px; }

/* Detail header */
.detail-header { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; gap: 12px; flex-wrap: nowrap; }
.detail-header-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; overflow: hidden; }
.detail-avatar { width: 42px; height: 42px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; flex-shrink: 0; }
.detail-name { font-size: 16px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.detail-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Profile grid */
.detail-profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.profile-card-label { font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 4px; }
.profile-card-value { font-size: 13px; color: var(--text-primary); font-weight: 400; }

/* Note history */
.detail-section-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); }
.notes-empty { font-size: 13px; color: var(--text-tertiary); padding: 20px 0; }
.note-history { display: flex; flex-direction: column; gap: 12px; }
.history-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.history-note-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.history-note-left { display: flex; align-items: center; gap: 10px; }
.history-note-title { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
.history-note-date { font-size: 12px; color: var(--text-secondary); }
.history-note-method { font-size: 11.5px; color: var(--text-tertiary); }
.history-note-actions { display: flex; gap: 6px; }
.history-note-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.history-section { }
.history-section-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 5px; }
.history-section-body { font-size: 13px; color: var(--text-primary); line-height: 1.6; }

/* Danger button */
.tool-btn.danger { color: var(--red); border-color: transparent; }
.tool-btn.danger:hover { background: var(--red-light); border-color: var(--red); }

/* Primary button */
.primary-btn { background: var(--accent); color: white; border: none; border-radius: var(--radius-md); padding: 9px 18px; font-size: 13px; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.primary-btn:hover { background: #143d27; }

/* View header with button */
.view-header { display: flex; align-items: flex-start; justify-content: space-between; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }
.modal-close { background: transparent; border: none; cursor: pointer; color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 4px; transition: all 0.15s; }
.modal-close:hover { background: var(--bg); color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.modal-hint { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }

.btn-primary { background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-primary:hover { background: #143d27; }
.btn-secondary { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.btn-secondary:hover { background: var(--bg); color: var(--text-primary); }

/* ---- Auth / sidebar footer ---- */
.user-info { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); cursor: pointer; width: 100%; margin-top: 6px; transition: all 0.15s; }
.logout-btn:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* ---- Brief button ---- */
.brief-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.brief-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---- Brief sections ---- */
.brief-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.brief-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Plain text lines in note sections ---- */
.note-line {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

/* ---- Template mismatch warning ---- */
.template-warning {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid #E8C170;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---- Participant context panel ---- */
.participant-context {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctx-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ctx-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ctx-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ctx-pill-green {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-light);
}

.ctx-barriers {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 0;
}

.ctx-section-label {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.ctx-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ctx-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.ctx-note-header:hover { background: var(--bg); }

.ctx-note-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.ctx-note-date {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.ctx-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.ctx-note-body {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}

.ctx-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctx-bullets li {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 12px;
  position: relative;
  line-height: 1.5;
}

.ctx-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

.ctx-more {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 6px 0 0;
  font-style: italic;
}

.ctx-no-notes {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  font-style: italic;
}

.ctx-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}

/* ---- Participant context — right panel ---- */
#participant-context {
  flex-direction: column;
  gap: 14px;
}

.ctx-header {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.ctx-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ctx-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.ctx-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ctx-pill-green {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-light);
}

.ctx-barriers {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
}

.ctx-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.ctx-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ctx-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.ctx-note-header:hover { background: var(--bg); }

.ctx-note-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.ctx-note-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.ctx-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.ctx-note-body {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}

.ctx-bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctx-bullets li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.ctx-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

.ctx-more {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-style: italic;
}

.ctx-no-notes {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
}

.ctx-empty {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---- Full note in context panel ---- */
.ctx-full-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctx-full-section { }

.ctx-full-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.ctx-full-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.ctx-full-body .note-bullets {
  margin: 0;
}

.ctx-full-body .note-bullets li {
  font-size: 13px;
}

.ctx-full-body .note-line {
  font-size: 13px;
}

/* ---- Profile tabs ---- */
.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.profile-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.profile-tab:hover { color: var(--text-primary); }
.profile-tab-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Employment profile placeholder ---- */
.employment-profile-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.employment-profile-placeholder p {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

/* ---- Compliance link in sidebar ---- */
.compliance-link {
  font-size: 11px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.compliance-link:hover { color: var(--text-secondary); }

/* ---- Modal section divider ---- */
.modal-section-divider {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  padding: 10px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.modal-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.modal-accordion-header:hover { color: var(--text-primary); }
.modal-accordion-chevron { transition: transform 0.2s; flex-shrink: 0; }
.modal-accordion-body { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }

/* ---- Employment profile tab ---- */
.emp-profile-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.emp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.emp-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  display: block;
}

.emp-section-body {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.5;
}

.emp-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.emp-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.emp-label {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.emp-value {
  font-size: 13px;
  color: var(--text-primary);
}

.emp-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---- Milestone tracking ---- */
.milestone-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestone-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.milestone-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.milestone-group-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.milestone-item-label { font-size: 13px; color: var(--text-primary); flex: 1; }
.milestone-item-date { font-size: 12px; color: var(--text-secondary); }
.milestone-item-status { font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

.milestone-tag-past { background: var(--accent-light); }
.milestone-tag-past .milestone-item-status { background: var(--accent-light); color: var(--accent); }
.milestone-tag-soon { background: var(--amber-light); border-color: #E8C170; }
.milestone-tag-soon .milestone-item-status { background: var(--amber-light); color: var(--amber); }
.milestone-tag-upcoming .milestone-item-status { background: var(--bg); color: var(--text-secondary); }

.milestone-servicing {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.milestone-sub { font-size: 12px; color: var(--text-secondary); }

.milestone-empty {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---- Job matching ---- */
.job-match-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.job-match-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-match-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.job-match-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.job-match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-match-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.job-match-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-match-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); flex: 1; }
.job-match-industry { font-size: 12px; color: var(--text-secondary); }

.job-match-readiness {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
}

.match-ready { background: var(--accent-light); color: var(--accent); }
.match-support { background: var(--amber-light); color: var(--amber); }
.match-future { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

.job-match-why { font-size: 13px; color: var(--text-primary); line-height: 1.55; }
.job-match-note { font-size: 12px; color: var(--text-secondary); font-style: italic; }

/* ---- Milestone anchor alert ---- */
.milestone-alert {
  font-size: 12.5px;
  color: var(--amber);
  background: var(--amber-light);
  border: 1px solid #E8C170;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}

/* ================================================================
   SPRINT 4 — CV & COVER LETTER
   ================================================================ */

.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
}
.upload-area:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.upload-area svg { opacity: 0.6; }
.upload-area p { font-size: 13px; margin: 0; }

.cv-output-body {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  font-family: 'DM Mono', 'Courier New', monospace;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex: 1;
}

/* ================================================================
   SPRINT 5 — COACHING
   ================================================================ */

.view-content-full {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.coaching-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.coaching-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.readiness-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.readiness-bar-track {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.readiness-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

.readiness-high .readiness-bar-fill { background: var(--accent); }
.readiness-mid .readiness-bar-fill { background: #2563eb; }
.readiness-low .readiness-bar-fill { background: var(--amber); }

.readiness-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }

.coaching-summary {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 12px 14px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
}

.coaching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.coaching-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coaching-card-full { grid-column: 1 / -1; }

.coaching-card-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.coaching-item {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.coaching-item-green { background: var(--accent-light); color: var(--accent); }
.coaching-item-red { background: var(--amber-light); color: var(--amber); }
.coaching-item-blue { background: #eff6ff; color: #1e40af; }

.coaching-action {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.coaching-action-text { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.coaching-action-why { font-size: 12.5px; color: var(--text-secondary); }

.tag-gray { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.tag-blue { background: #eff6ff; color: #1e40af; }

/* ================================================================
   SPRINT 6 — KPI DASHBOARD
   ================================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-section-full { grid-column: 1 / -1; }

.dash-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.dash-stat-row { display: flex; gap: 20px; }

.dash-stat { display: flex; flex-direction: column; gap: 3px; }
.dash-stat-num { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; color: var(--text-primary); }
.dash-stat-label { font-size: 12px; color: var(--text-tertiary); }
.dash-green { color: var(--accent); }
.dash-amber { color: var(--amber); }
.dash-gray { color: var(--text-tertiary); }

.dash-phase-bars { display: flex; flex-direction: column; gap: 8px; }
.dash-phase-row { display: flex; align-items: center; gap: 10px; }
.dash-phase-label { font-size: 12px; color: var(--text-secondary); width: 160px; flex-shrink: 0; }
.dash-phase-bar-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.dash-phase-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; min-width: 2px; }
.dash-phase-count { font-size: 12px; font-weight: 500; color: var(--text-primary); width: 24px; text-align: right; }

.dash-placed-list { display: flex; flex-direction: column; gap: 6px; }
.dash-placed-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dash-placed-item:last-child { border-bottom: none; }
.dash-placed-name { font-weight: 500; color: var(--text-primary); min-width: 120px; }
.dash-placed-detail { color: var(--text-secondary); flex: 1; }
.dash-placed-date { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }

.dash-quarter-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.dash-progress-bar-wrap { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.dash-progress-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.6s ease; }

.dash-service-reqs { display: flex; flex-direction: column; gap: 6px; }
.dash-service-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 6px 10px; background: var(--bg); border-radius: var(--radius-sm); }
.dash-service-num { font-weight: 500; color: var(--text-primary); }

.dash-alert {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.dash-alert-red { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }
.dash-alert-amber { background: var(--amber-light); color: var(--amber); border-left: 3px solid #f59e0b; }
.dash-alert-green { background: var(--accent-light); color: var(--accent); border-left: 3px solid var(--accent); }

.dash-empty { font-size: 13px; color: var(--text-tertiary); }
.dash-more { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ================================================================
   POLICY ASSISTANT
   ================================================================ */

.policy-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.policy-chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px 20px;
  gap: 8px;
}

.policy-welcome-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.policy-welcome-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.policy-welcome-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.6;
}

.policy-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  max-width: 600px;
}

.policy-suggestion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  line-height: 1.4;
}

.policy-suggestion:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Messages */
.policy-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.policy-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.policy-msg-assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.policy-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.65;
}

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

.policy-msg-assistant .policy-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.policy-msg-assistant .policy-msg-bubble p { margin: 0 0 8px; }
.policy-msg-assistant .policy-msg-bubble p:last-child { margin-bottom: 0; }
.policy-msg-assistant .policy-msg-bubble ul { margin: 6px 0; padding-left: 18px; }
.policy-msg-assistant .policy-msg-bubble li { margin-bottom: 4px; }
.policy-msg-assistant .policy-msg-bubble strong { font-weight: 500; color: var(--text-primary); }

.policy-msg-loading {
  min-width: 60px;
}

.policy-msg-error {
  color: var(--red, #dc2626);
  font-size: 13px;
}

/* Input area */
.policy-input-area {
  border-top: 1px solid var(--border);
  padding: 14px 28px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.policy-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.policy-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.5;
  transition: border-color 0.15s;
}

.policy-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.policy-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.policy-send-btn:hover { background: #143d27; }
.policy-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.policy-disclaimer {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0;
}

/* ================================================================
   AWARD LOOKUP
   ================================================================ */

.award-lookup-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.award-lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.award-lookup-header:hover { background: var(--bg); }

.award-chevron { transition: transform 0.2s; color: var(--text-tertiary); }

.award-lookup-body {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border);
}

.award-result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.award-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.award-result-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.award-result-conf {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.award-result-code {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: 'DM Mono', monospace;
}

.award-result-rates {
  display: flex;
  gap: 10px;
}

.award-rate-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  flex: 1;
}

.award-rate-item span { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.award-rate-item strong { font-size: 12.5px; color: var(--text-primary); font-weight: 500; }

.award-result-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  padding: 6px 10px;
  background: var(--amber-light);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--amber);
}

.award-verify-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.award-verify-link:hover { text-decoration: underline; }

/* ================================================================
   HOTLIST
   ================================================================ */

.dash-hotlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-hotlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

.dash-hotlist-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.dash-hotlist-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dash-hotlist-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.dash-hotlist-detail {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-hotlist-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-hotlist-tag {
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
  color: var(--text-secondary);
}

/* ---- Hotlist ---- */
.hotlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hotlist-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hotlist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hotlist-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotlist-readiness {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hotlist-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hotlist-meta span {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotlist-placed {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* ---- Award lookup ---- */
.award-lookup-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.award-lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.award-lookup-header:hover { background: var(--surface); }
.award-chevron { transition: transform 0.2s; }

.award-lookup-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.award-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.award-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.award-result-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.award-result-conf {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.award-result-code {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: 'DM Mono', monospace;
}

.award-result-rates {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.award-result-rates span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.award-result-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.award-result-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.award-result-link:hover { text-decoration: underline; }

/* ---- Servicing fee tracker ---- */
.servicing-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.servicing-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr 1.2fr;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.servicing-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr 1.2fr;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
}

.servicing-row:last-child { border-bottom: none; }
.servicing-row:nth-child(even) { background: var(--bg); }

.servicing-name { font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.servicing-type { color: var(--text-secondary); font-size: 12px; }
.servicing-required { color: var(--text-secondary); text-align: center; }
.servicing-status { font-weight: 500; font-size: 12.5px; }

.servicing-count {
  display: flex;
  align-items: center;
  gap: 8px;
}

.servicing-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.servicing-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* ---- Coaching question context ---- */
.coaching-question-context {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 4px;
}

/* ---- Coaching role toggle ---- */
.coaching-role-toggle {
  display: flex;
  gap: 6px;
}

.coaching-role-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.coaching-role-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.coaching-role-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 500;
}

/* ---- Milestone note ---- */
.milestone-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent);
  margin-top: 4px;
}

/* ---- Background context paste ---- */
.context-paste-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.context-paste-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.context-paste-header:hover { background: var(--surface); }
.context-chevron { transition: transform 0.2s; flex-shrink: 0; }

.context-paste-body {
  padding: 0 12px 12px;
}

/* ---- Award utility bar (relocated) ---- */
.award-utility-bar {
  display: flex;
  justify-content: flex-end;
  padding: 6px 20px 0;
  border-top: 1px solid var(--border);
}

.award-utility-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.award-utility-toggle:hover { color: var(--text-secondary); }

.award-utility-panel {
  padding: 10px 20px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.award-utility-panel .form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Profile view ---- */
.sidebar-profile-link {
  padding: 0 10px 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.profile-style-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-style-preview-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

/* ---- Sidebar footer actions ---- */
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.footer-link {
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  cursor: pointer;
}

.footer-link:hover, .footer-link.active { color: rgba(255,255,255,0.9); }

.footer-divider {
  color: var(--border-strong);
  font-size: 11px;
}

/* ---- Toast notifications ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1a1a;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
  background: #dc2626;
}

/* ---- Team Leader coaching ---- */
.tl-metrics-strip {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tl-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 70px;
  flex: 1;
}

.tl-metric-num {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.tl-metric-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
}

.dash-red { color: #dc2626; }

.tl-flags-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tl-flags-header {
  display: grid;
  grid-template-columns: 1.2fr 2fr 2fr 0.8fr;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.tl-flags-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 2fr 0.8fr;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.tl-flags-row:last-child { border-bottom: none; }
.tl-flags-row:nth-child(even) { background: var(--bg); }

.tl-flag-name { font-weight: 500; color: var(--text-primary); }
.tl-flag-issue { color: var(--text-secondary); }
.tl-flag-action { color: var(--text-secondary); }
.tl-flag-priority { font-weight: 500; text-transform: capitalize; }

/* ---- Mobile-only elements (hidden on desktop) ---- */
.mobile-panel-toggle { display: none; }
.mobile-close-panel { display: none; }

/* ================================================================
   SPRINT 9 — MOBILE RESPONSIVE
   Breakpoints: 768px (tablet), 480px (phone)
   ================================================================ */

@media (max-width: 768px) {

  /* ---- App shell ---- */
  html, body { height: 100%; height: 100dvh; }

  .app {
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  /* ---- Sidebar becomes a top nav bar ---- */
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
  }

  .sidebar-logo {
    padding: 8px 12px;
    border-bottom: none;
    flex-shrink: 0;
  }

  .sidebar-logo span { display: none; }
  .sidebar-logo svg, .sidebar-logo img { width: 28px; height: 28px; }

  .sidebar-nav {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px;
    gap: 2px;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar { display: none; }

  .nav-item {
    flex-direction: column;
    gap: 0;
    padding: 8px 10px;
    font-size: 0;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    min-width: 44px;
    text-align: center;
    justify-content: center;
    line-height: 0;
  }

  .nav-item svg { width: 20px; height: 20px; }

  .sidebar-footer { display: none; }
  .sidebar-profile-link { display: none; }

  /* Tighter role toggle on mobile */
  .role-toggle { gap: 6px; }
  .role-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Tighter view header */
  .view-header {
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--border);
  }

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

  /* Smaller note settings button */
  .mobile-panel-toggle {
    margin: 8px 16px;
    width: calc(100% - 32px);
    padding: 8px 14px;
    font-size: 13px;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
  }

  /* Tighten award utility bar */
  .award-utility-bar { padding: 4px 16px 0; }

  /* ---- Main content ---- */
  .main {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .view.active {
    display: flex;
    flex-direction: column;
  }

  /* ---- View headers ---- */
  .view-header {
    padding: 8px 16px 6px;
  }

  .view-title { font-size: 15px; }
  .view-subtitle { display: none; }

  /* Role toggle compact */
  .role-toggle-wrap { padding: 6px 16px 4px; }

  .role-btn-group {
    display: flex;
    gap: 4px;
  }

  .role-btn-group button {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  /* ---- Generate note workspace ---- */
  .workspace {
    grid-template-columns: 1fr;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .input-panel {
    display: none;
  }

  .input-panel.mobile-visible {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: var(--surface);
    overflow-y: auto;
    padding: 16px;
    flex-direction: column;
    gap: 14px;
  }

  .output-panel {
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  /* ---- View content full ---- */
  .view-content-full {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  /* ---- Mobile panel toggle button ---- */
  .mobile-panel-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 13.5px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    margin: 12px 16px;
    width: calc(100% - 32px);
    justify-content: center;
  }

  .mobile-panel-toggle { display: flex; }

  .mobile-close-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .mobile-close-panel span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
  }

  .mobile-close-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-secondary);
    cursor: pointer;
  }

  /* ---- Participants view ---- */
  .participants-layout {
    flex-direction: column !important;
    overflow-y: auto;
  }

  .participants-list-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .participant-detail-panel {
    width: 100% !important;
    flex: 1;
    overflow-y: auto;
    min-height: 400px;
  }

  /* ---- Modals ---- */
  .modal-box {
    width: 95vw;
    max-height: 90dvh;
    margin: 5vh auto;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  /* ---- Dashboard ---- */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dash-section-full {
    grid-column: 1;
  }

  .hotlist-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Coaching ---- */
  .coaching-role-toggle {
    flex-wrap: wrap;
  }

  .coaching-grid {
    grid-template-columns: 1fr;
  }

  .coaching-card-full {
    grid-column: 1;
  }

  /* ---- CV view ---- */
  .cv-output-body {
    font-size: 12.5px;
  }

  /* ---- Policy chat ---- */
  .policy-msg {
    max-width: 95%;
  }

  /* ---- Servicing table ---- */
  .servicing-table-header { display: none; }
  .servicing-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .servicing-required { display: none; }

  /* ---- TL flags table ---- */
  .tl-flags-header { display: none; }
  .tl-flags-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }

  .tl-metrics-strip {
    gap: 8px;
  }

  .tl-metric-num { font-size: 20px; }
}

@media (max-width: 480px) {
  .nav-item {
    font-size: 9px;
    padding: 6px 8px;
    min-width: 48px;
  }

  .coaching-role-btn {
    font-size: 11.5px;
    padding: 6px 10px;
  }

  .dash-stat-row {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  /* ---- Role selector strip ---- */
  .role-selector {
    padding: 6px 12px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .role-selector::-webkit-scrollbar { display: none; }

  .role-btn {
    padding: 4px 10px;
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ---- Generate view header area ---- */
  .view-header + .mobile-panel-toggle,
  .mobile-panel-toggle {
    margin: 6px 12px;
    width: calc(100% - 24px);
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    justify-content: flex-start;
    gap: 8px;
  }

  .award-utility-bar {
    padding: 2px 12px 0;
  }
}

@media (max-width: 768px) {
  /* CV input panel hides on mobile like generate */
  #cv-input-panel {
    display: none;
  }

  #cv-input-panel.mobile-visible {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    background: var(--surface);
    overflow-y: auto;
    padding: 16px;
    flex-direction: column;
    gap: 14px;
  }

  /* Role toggle — tighten further */
  .role-selector {
    padding: 4px 10px;
  }

  .role-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* Generate note title row */
  .view-header {
    padding: 8px 16px 6px;
  }

  .view-title {
    font-size: 15px;
    font-weight: 500;
  }
}

@media (max-width: 768px) {
  /* Hide nav labels — icons only */
  .nav-label { display: none; }

  .nav-item {
    padding: 10px 12px;
    min-width: 40px;
    gap: 0;
  }

  .nav-item svg {
    width: 22px;
    height: 22px;
  }

  /* Also tighten the role buttons further */
  .role-selector {
    padding: 4px 12px 6px;
    gap: 6px;
  }

  .role-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* ---- Background Context Tab ---- */
.context-tab-body {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctx-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.ctx-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.ctx-result-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.ctx-summary-text {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.ctx-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctx-suggestions-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ctx-suggestion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.ctx-suggestion-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.ctx-suggestion-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.ctx-suggestion-value {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: right;
}

.ctx-strengths-barriers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ctx-mini-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.ctx-mini-item {
  font-size: 12.5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.ctx-focus {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Background summary note card */
.history-note-summary {
  border-left: 3px solid var(--accent) !important;
  background: var(--accent-light) !important;
}

/* Context level badge on tab */
.context-level-badge {
  font-size: 11px;
  margin-left: 4px;
}

/* ================================================================
   ONBOARDING OVERLAY
   ================================================================ */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.onboarding-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.onboarding-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.onboarding-icon-green { background: #f0fdf4; color: #16a34a; }
.onboarding-icon-blue { background: #eff6ff; color: #1d4ed8; }

.onboarding-step-label {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.onboarding-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.3;
}

.onboarding-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  max-width: 340px;
}

.onboarding-field {
  width: 100%;
  margin-top: 4px;
}

.onboarding-field .input-field {
  text-align: center;
  font-size: 15px;
  padding: 12px 16px;
}

.onboarding-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.onboarding-btn:hover { background: #143d27; }
.onboarding-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.onboarding-skip {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.onboarding-skip:hover { color: var(--text-secondary); }

.onboarding-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.onboarding-example-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.onboarding-example-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

@media (max-width: 480px) {
  .onboarding-box {
    padding: 28px 20px;
  }
  .onboarding-title { font-size: 18px; }
}

/* ---- Option 2 Navy sidebar overrides ---- */
.logo-text { color: white !important; }
.nav-item.active { background: rgba(255,255,255,0.12) !important; color: white !important; }
.footer-link { color: rgba(255,255,255,0.45) !important; }
.footer-link:hover, .footer-link.active { color: rgba(255,255,255,0.9) !important; }
.footer-divider { color: rgba(255,255,255,0.2) !important; }
.logout-btn { border-color: rgba(255,255,255,0.15) !important; color: rgba(255,255,255,0.5) !important; }
.logout-btn:hover { background: rgba(255,255,255,0.08) !important; color: white !important; border-color: rgba(255,255,255,0.3) !important; }
.version-badge { color: rgba(255,255,255,0.35) !important; }
.version-badge a { color: rgba(255,255,255,0.45) !important; }
.sidebar-profile-link { border-top-color: rgba(255,255,255,0.1) !important; }

/* ---- Sidebar footer restructured ---- */
.footer-link-profile {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  padding: 2px 0;
}

.footer-link-profile:hover { color: rgba(255,255,255,0.9); }

.sidebar-legal-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.footer-link-legal {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.footer-link-legal:hover { color: rgba(255,255,255,0.7); }

.footer-divider {
  color: rgba(255,255,255,0.15);
  font-size: 10px;
}
