:root {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-blue: #006645; /* Ensign Green PMS 3425 C */
  --accent-hover: #004d34;
  --accent-gold: #FDB515; /* Ensign Yellow PMS 1235 C */
  --accent-emerald: #33B04A; /* Ensign Light Green PMS 361 C */
  --accent-rose: #dc2626;
  --border-color: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.05);
  --font-sans: "Montserrat", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}



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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-body);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* App Header */
.app-header {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  z-index: 20;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.brand-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.0625rem;
  padding: 0.35rem 0.75rem;
  min-height: 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.offline {
  background-color: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.mode-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--accent-blue);
  color: white;
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 1.0625rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
}

/* Main Layout */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

/* Left Source Panel (matching Internship Expert UI) */
.source-panel {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .source-panel {
    display: none;
  }
}

.application-process-link {
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 102, 69, 0.2);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease;
}

.application-process-link:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
}

.source-panel h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.source-panel p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.5;
  margin: 0;
}

.source-list {
  margin: 0.25rem 0;
  padding: 0;
  list-style: none;
  counter-reset: source;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.source-list li {
  counter-increment: source;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.source-list li::before {
  content: counter(source);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--accent-blue);
  border-radius: 50%;
  color: var(--accent-blue);
  font-size: 1.0625rem;
  font-weight: 800;
  background: rgba(0, 102, 69, 0.08);
}

.source-list a {
  padding-top: 2px;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s;
}

.source-list a:hover {
  color: var(--accent-emerald);
}

.boundary-note {
  padding: 0.75rem;
  border-left: 3px solid var(--accent-gold);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
}

.boundary-note strong {
  color: #92400e;
  font-size: 1.0625rem;
  display: block;
  margin-bottom: 0.2rem;
}

.boundary-note p {
  color: #78350f;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.portfolio-return-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--accent-blue);
  border-radius: 8px;
  background: rgba(0, 102, 69, 0.08);
  color: var(--accent-blue);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.portfolio-return-link:hover {
  border-color: var(--accent-emerald);
  background: var(--brand-tint); /* was CES emerald */
  transform: translateY(-1px);
}

.staff-admin-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.staff-admin-link:hover {
  border-color: var(--brand); /* ECC: gold is identity-only, never a hover state */
  background: var(--brand-tint-soft);
  color: var(--brand);
  transform: translateY(-1px);
}

.reference-only {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.reference-only a {
  display: block;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
}

.reference-only a:hover {
  color: var(--accent-emerald);
}

.reference-only small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.45;
}

/* Chat Main Area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  min-width: 0;
}

/* Chips Bar */
.chips-container {
  padding: 0.6rem var(--gutter);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips-container::-webkit-scrollbar {
  height: 4px;
}

.chips-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.prompt-chip {
  background: var(--bg-primary);
  border: 1.5px solid #94a3b8;
  color: var(--text-primary);
  padding: 0.5rem 0.95rem;
  border-radius: 9999px;
  font-size: 1.0625rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
}

.prompt-chip:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

/* Message Feed — full-width canvas, padding provides elegant white space rail */
.messages-feed {
  flex: 1 1 0%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem var(--gutter);
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
  min-width: 0;
}

.message-row {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
  min-width: 0;
}

.message-row.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.message-row.assistant {
  justify-content: flex-start;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.message-row.assistant .msg-avatar {
  background: linear-gradient(135deg, #004b87, #0284c7);
  color: white;
}

.message-row.user .msg-avatar {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.msg-bubble {
  background: var(--bg-secondary);
  border: 1.5px solid #94a3b8;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  color: var(--text-primary);
  font-size: var(--text-body);
  line-height: 1.7;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.message-row.user .msg-bubble {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  max-width: 78%;
  width: fit-content;
  min-width: 0;
}

.message-row.assistant .msg-bubble {
  max-width: 100%; /* Card aligns with banner and composer edges */
  width: 100%;
  min-width: 0;
}

/* Markdown formatting inside assistant bubble */
.msg-bubble h3 {
  font-size: 1.25rem;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.msg-bubble h3:first-child {
  margin-top: 0;
}

.msg-bubble p {
  margin-bottom: 0.75rem;
}

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

.msg-bubble ul, .msg-bubble ol {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.msg-bubble li {
  margin-bottom: 0.35rem;
}

.msg-bubble blockquote {
  border-left: 3px solid var(--accent-gold);
  padding-left: 0.75rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
}

.msg-bubble code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.95em;
}

.msg-bubble pre {
  background: #090d16;
  padding: 0.85rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.75rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.msg-bubble pre code {
  background: transparent;
  padding: 0;
}

.msg-bubble a {
  color: var(--brand);
  text-decoration: underline;
}

.msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.copy-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  min-height: 44px;
}

.copy-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Chat Input Bar — spans full workspace width with matching 2rem white space padding rail */
.input-container {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 0.875rem var(--gutter) 1.125rem;
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.input-box-wrapper {
  /* ECC: the textarea itself carries the field look (fill, 2px border, focus ring),
     so the wrapper is only a layout row. Was a bordered box around a bare textarea,
     which the audit and screen readers read as an unstyled field. */
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  align-items: flex-end;
  max-width: none;
  margin: 0 auto;
}



.chat-input {
  flex: 1;
  min-width: 0;
  background: var(--input-fill);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: 500;
  resize: none;
  max-height: 160px;
  min-height: 44px;
  line-height: 1.5;
}

.chat-input:focus-visible {
  background: var(--surface);
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.btn-send {
  background: var(--accent-blue);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--accent-hover);
  transform: scale(1.04);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.input-disclaimer {
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.6rem;
}

/* Side Drawers */
.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 380px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer.right {
  right: 0;
  transform: translateX(100%);
}

.drawer:not(.open) {
  /* closed drawers sit off-screen; hide them so they are not tab stops or clipped elements */
  visibility: hidden;
}

.drawer.open {
  transform: translateX(0);
}

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

.drawer-title {
  font-size: 1.0625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Form Styles inside Workbench Drawer */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-label {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
  background: var(--input-fill);
  border: 2px solid var(--input-border);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-family: inherit;
  min-height: 44px;
  box-shadow: var(--shadow-card);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
  border-radius: var(--radius-lg);
}

.drawer-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-height: 44px;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 1.0625rem;
  cursor: pointer;
  min-height: 44px;
}

/* Trace Timeline Styles */
.trace-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trace-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1.0625rem;
  min-width: 0;
}

.trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  min-width: 0;
}

.trace-agent {
  font-weight: 700;
  color: var(--accent-blue);
}

.trace-time {
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.trace-detail {
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Typing cursor animation */
.typing-cursor::after {
  content: '▋';
  color: var(--accent-gold);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Thumbs Up / Down Feedback Section */
.answer-feedback {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feedback-prompt {
  font-size: 1.0625rem;
  color: var(--text-muted);
  font-weight: 500;
}

.feedback-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-button {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 1.0625rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.feedback-button:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.feedback-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feedback-up:hover:not(:disabled) {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.feedback-down:hover:not(:disabled) {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* Feedback Form for Suggested Improvements */
.feedback-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  min-width: 0;
  animation: fadeIn 0.2s ease-in-out;
}

.feedback-form[hidden] {
  display: none !important;
}

.feedback-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.feedback-form label {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.feedback-form textarea {
  background: var(--input-fill);
  border: 2px solid var(--input-border);
  color: var(--text-primary);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-body);
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feedback-form textarea:focus {
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-focus);
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.feedback-form textarea.readonly-field {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.08);
}

.feedback-form textarea.question-box {
  min-height: 90px;
}

.feedback-form textarea.coaching-box {
  min-height: 220px;
}

.feedback-form textarea.correction-box {
  min-height: 140px;
  border-color: var(--border-color);
}

.feedback-form textarea.correction-box:focus {
  border-color: var(--accent-emerald);
  box-shadow: var(--shadow-focus);
}

.feedback-warning {
  font-size: 1.0625rem;
  color: var(--accent-gold);
  line-height: 1.4;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent-gold);
  margin-top: 0.25rem;
}

.feedback-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.feedback-submit {
  background: var(--accent-emerald);
  color: #07110c;
  border: none;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 1.0625rem;
  min-height: 44px;
}

.feedback-submit:hover:not(:disabled) {
  background: #34d399;
  color: #07110c;
}

.feedback-status {
  font-size: 1.0625rem;
  padding: 0.25rem 0;
  font-weight: 500;
}

.feedback-success {
  color: var(--accent-emerald);
}

.feedback-error {
  color: var(--accent-rose);
}

/* Header Value Proposition Banner */
.header-value-prop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.3;
  min-width: 0;
}

.value-prop-badge {
  background: var(--brand-tint); /* ECC: gold text on light was 1.7:1 */
  color: var(--brand);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Modal Overlay & Card for Upfront Onboarding */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 780px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  min-width: 0;
}

.modal-icon {
  font-size: 2rem;
  background: var(--bg-primary);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.step-heading {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

/* Choice Cards Grid */
.choice-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
  min-width: 0;
}

@media (max-width: 540px) {
  .choice-cards-grid {
    grid-template-columns: 1fr;
  }
}

.choice-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  min-width: 0;
}

.choice-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.choice-card.featured {
  border-color: var(--accent-emerald);
  background: var(--brand-tint-soft); /* was CES emerald */
}

.choice-card.featured:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 8px 24px rgba(0, 102, 69, 0.2); /* brand glow, was CES emerald */
}

.choice-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-emerald);
  color: #07110c;
  font-size: 1.0625rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.choice-icon {
  font-size: 1.5rem;
}

.choice-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
}

.choice-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}

/* Profile Ready Banner in Goal step */
.profile-ready-banner {
  background: var(--brand-tint-soft); /* was CES emerald */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Goal Options List */
.goal-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.goal-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}

.goal-option:hover {
  border-color: var(--accent-blue);
  background: var(--bg-tertiary);
}

.goal-option input[type="radio"] {
  margin-top: 0.2rem;
}

.goal-option strong {
  display: block;
  font-size: 1.0625rem;
  color: var(--text-primary);
}

.goal-option small {
  display: block;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.15rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Ingest Tabs in Modal */
.ingest-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.25rem;
  flex-wrap: wrap;
}

.ingest-tab {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex: 1 1 auto;
  text-align: center;
  min-height: 44px;
}

.ingest-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
  background: var(--bg-tertiary);
}

.ingest-tab.active {
  color: #07110c;
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  font-weight: 700;
}

.ingest-tab-view {
  display: none;
}

.ingest-tab-view.active {
  display: block;
}

/* 3-Step Illustrated Guide for LinkedIn PDF */
.pdf-guide-box {
  background: var(--brand-tint-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.guide-header {
  font-size: 1.0625rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  color: var(--text-primary);
}

.step-num {
  width: 18px;
  height: 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 1.0625rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* PDF Drag and Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-emerald);
  background: var(--brand-tint-soft); /* was CES emerald */
  transform: scale(1.01);
}

.drop-icon {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.drop-text {
  font-size: 1.0625rem;
  color: var(--text-primary);
}

.drop-sub {
  font-size: 1.0625rem;
  color: var(--text-muted);
}




/* ==============================================================================
   ChatGPT Edu Institutional Privacy Bridge Banner
   ============================================================================== */
.ai-bridge-banner {
    max-width: none;
    margin: 8px var(--gutter) 14px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1.5px solid #20c785;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(32, 199, 133, 0.15);
    box-sizing: border-box;
}

.ai-bridge-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.ai-bridge-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 260px;
}

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

.ai-bridge-badge {
    display: inline-block;
    align-self: flex-start;
    background: #dcfce7;
    color: #166534;
    font-size: 1.0625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 12px;
}

.bridge-tag {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #047857;
}

.ai-bridge-desc {
    margin: 0;
    font-size: var(--text-body);
    color: #1e293b;
    line-height: 1.5;
}

.ai-bridge-desc strong {
    color: #0f172a;
}

.ai-bridge-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.bridge-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.0625rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 44px;
}

.bridge-action-btn.copy-btn {
    background: var(--brand); /* ECC: #10b981 under white text was 2.54:1 */
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-card);
}

.bridge-action-btn.copy-btn:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.bridge-action-btn.launch-btn {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.bridge-action-btn.launch-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-prompt-toast {
    margin-top: 10px;
    padding: 8px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 1.0625rem;
    font-weight: 600;
}

/* CES Brand Versioning & WCAG 2.2 AA Interaction Enhancements */
.ces-version-tag {
    display: inline-block;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ces-gold, #f5a81c);
    background: rgba(245, 168, 28, 0.15);
    border: 1px solid rgba(245, 168, 28, 0.35);
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

button, input, select, textarea, .btn-primary, .btn-secondary, .bridge-action-btn {
    min-height: 44px;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

@media (forced-colors: active) {
    button, a, input, textarea, select {
        border: 2px solid ButtonText !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ECC touch targets and phone layout (ecc/brewcoach-for-linkedin).
   Trailing block so it wins over the helper-rewritten rules above. Fold in later if desired. */
.source-panel a,
.source-list a,
.source-panel li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.bridge-action-btn {
  min-height: 44px;
}

@media (max-width: 640px) {
  /* copy and open buttons take full width and wrap text instead of overflowing at 320 */
  .ai-bridge-actions {
    min-width: 0;
  }

  .ai-bridge-actions .bridge-action-btn {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
}

/* Phones: the header used to take about 600px of a 812px screen and left no room for chat.
   Drop the two descriptive lines and the helpfulness badge, and wrap the controls compactly.
   Nothing here removes a control. The title, mode toggle and all buttons stay. */
@media (max-width: 640px) {
  .brand-subtitle,
  .header-value-prop,
  #feedbackStatsBadge {
    display: none;
  }

  .app-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .header-controls {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .header-controls > .btn-icon,
  .header-controls > .status-badge {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 10px;
  }
}

/* Chat rail: the assistant avatar hangs in the left gutter so the card lines up
   with the banner and composer. The gutter widens to fit the avatar above 640px. */
@media (min-width: 641px) {
  .chat-area { --gutter: 3.5rem; }
  .message-row.assistant .msg-avatar { margin-left: calc(-34px - 0.85rem); }
}
@media (max-width: 640px) {
  .message-row.assistant .msg-avatar { display: none; }
}
button, input, select, textarea { font-family: var(--font-sans); } /* Form controls do not inherit font by default; this keeps them in Montserrat */
