/*
 * Major & Career Explorer Coach AI — Ensign College Brand Stylesheet
 * ------------------------------------------------------------------
 * Mobile-first, responsive, clean enterprise educational styling.
 */

:root {
  --primary: var(--brand);
  --primary-deep: var(--ink);
  --primary-light: var(--brand-tint, #e6f0ec);
  --accent-gold: var(--ces-gold);          /* ENSIGN wordmark text only */
  --accent-gold-hover: var(--ces-gold-hover);
  --text-dark: var(--ink);
  --text-muted: var(--ink-muted);
  --bg-page: var(--surface-sunken);
  --border: var(--ces-line);
  --surface: var(--ces-surface);
  --user-bubble: var(--brand);
  --assistant-bubble: var(--surface);
  --radius-lg: var(--ces-radius-lg);
  --radius-md: var(--ces-radius-md);
  --radius-sm: var(--ces-radius-sm);
  --font-sans: "Montserrat", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-container {
  width: 100%;
  max-width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Header */
.topbar {
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Return to Career Services Tools link - styled per design reference (media_1789511401369.png) */
.dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 6px 14px;
  min-height: 44px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--brand);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1.2;
}

.dashboard-link .dashboard-arrow {
  font-size: var(--text-body);
  line-height: 1;
  color: var(--brand);
  text-decoration: none;
}

.dashboard-link .dashboard-text {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.dashboard-link:hover,
.dashboard-link:focus-visible {
  background: var(--surface-sunken);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-focus);
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.dashboard-link:hover .dashboard-arrow,
.dashboard-link:hover .dashboard-text {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background-color: var(--brand);
  color: #ffffff;
  font-weight: 700; /* Montserrat loads 400-700 only, 800 rounded to 700 anyway */
  font-size: 17px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.08em;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.brand-sub {
  font-size: 17px;
  color: var(--ink-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.zoom-btn {
  min-width: 44px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface);
  color: var(--brand);
  border: 2px solid var(--border-strong);
  padding: 6px 11px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.zoom-btn:hover {
  background-color: var(--surface-sunken);
}

.quiet-button {
  min-width: 44px;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border-strong); /* ECC rule 8: controls take border-strong */
  color: var(--ink);
  font-size: 17px;
  padding: 6px 10px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
  white-space: nowrap;
}

.quiet-button:hover {
  background: var(--surface-sunken);
}

/* Quick Links Strip (Single row, touch scrollable on mobile) */
.quick-strip {
  background-color: var(--primary-light);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  font-size: 17px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  flex-shrink: 0;
}

.quick-strip::-webkit-scrollbar {
  display: none;
}

.strip-label {
  font-weight: 700;
  color: var(--primary);
  margin-right: 2px;
}

.strip-link {
  color: var(--brand);
  text-decoration: underline;
  background: var(--surface);
  padding: 2px 7px;
  min-height: 44px;
  border-radius: 4px;
  border: 2px solid var(--border);
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
}

.strip-link:hover {
  background: var(--surface-sunken);
  border-color: var(--brand);
}

.strip-link.gold {
  color: var(--brand);
  border: 2px solid var(--border-strong);
  background-color: var(--surface);
}

.strip-link.gold:hover {
  background-color: var(--surface-sunken);
}

/* 4-Step Nav */
.step-nav {
  padding: 5px 12px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.step-btn {
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  padding: 5px 6px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-btn .step-num {
  background-color: var(--surface-sunken);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.step-btn.active {
  background-color: var(--brand-tint, #e6f0ec);
  border: 2px solid var(--brand);
  color: var(--brand);
}

.step-btn.active .step-num {
  background-color: var(--brand);
  color: #ffffff;
}

.strip-link.roadmap-link {
  background: var(--brand-tint, #e6f0ec);
  color: var(--brand);
  font-weight: 700;
  border-color: var(--brand);
}

.strip-link.roadmap-link:hover {
  background: var(--surface-sunken);
  color: var(--brand);
}

/* Dual-Path AI Experience Banner (Sleek, Compact, Above-the-fold) */
.ai-bridge-banner {
  margin: 4px 12px 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0, 102, 69, 0.08);
  flex-shrink: 0;
}

.ai-bridge-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-bridge-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ai-bridge-badge {
  display: inline-block;
  background: var(--brand-tint, #e6f0ec);
  color: var(--brand);
  font-size: 17px;
  font-weight: 700; /* Montserrat loads 400-700 only, 800 rounded to 700 anyway */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.ai-bridge-title {
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-bridge-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bridge-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  padding: 4px 10px;
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bridge-action-btn.copy-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 102, 69, 0.25);
}

.bridge-action-btn.copy-btn:hover {
  background: var(--brand-hover, #00503a); /* ECC token, was raw #005236 */
  transform: translateY(-1px);
}

.bridge-action-btn.launch-btn {
  background: var(--surface-sunken);
  color: var(--ink);
  border: 2px solid var(--border);
}

.bridge-action-btn.launch-btn:hover {
  background: var(--surface-sunken);
  border-color: var(--border);
  transform: translateY(-1px);
}

.copy-prompt-toast {
  margin: 6px 16px 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 17px;
  box-shadow: var(--shadow-card);
  animation: fadeInToast 0.2s ease-out;
}

@keyframes fadeInToast {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.copy-prompt-toast .toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.copy-prompt-toast .toast-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-prompt-toast .toast-close {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  min-height: 44px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s, background-color 0.15s;
}

.copy-prompt-toast .toast-close:hover {
  opacity: 1;
  background: var(--surface-sunken);
}

.copy-prompt-toast .toast-body p {
  margin: 0 0 8px 0;
  line-height: 1.4;
  color: var(--ink);
}

.copy-prompt-toast .toast-body p.toast-subtext {
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.copy-prompt-toast .toast-body p.toast-subtext a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
}

.copy-prompt-toast .toast-body p.toast-subtext a:hover {
  color: var(--brand);
}

.copy-prompt-toast .toast-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-prompt-toast .toast-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  min-height: 44px;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.copy-prompt-toast .toast-btn-edu {
  background: var(--brand);
  color: #ffffff !important;
  border: 2px solid var(--brand);
}

.copy-prompt-toast .toast-btn-edu:hover {
  background: var(--brand-hover, #00503a); /* ECC token, was raw #005236 */
  box-shadow: 0 2px 6px rgba(0, 102, 69, 0.25);
  transform: translateY(-1px);
}

.copy-prompt-toast .toast-btn-regular {
  background: var(--surface);
  color: var(--brand) !important;
  border: 2px solid var(--border);
}

.copy-prompt-toast .toast-btn-regular:hover {
  background: var(--surface-sunken);
  border-color: var(--border);
  transform: translateY(-1px);
}

.copy-prompt-toast .toast-or {
  font-size: 17px;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Upload Panel Dropzone */
.upload-panel {
  padding: 10px 16px;
  background-color: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s;
}

.upload-panel.highlight {
  background-color: var(--brand-tint, #e6f0ec);
  border-bottom-color: var(--brand);
}

.upload-dropzone {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  cursor: pointer;
  background-color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.15s;
}

.upload-dropzone:hover, .upload-dropzone.drag-active {
  border-color: var(--primary);
  background-color: var(--surface-sunken);
}

.upload-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.drop-text {
  font-size: 17px;
  text-align: left;
}

.drop-text strong {
  display: block;
  color: var(--primary-deep);
}

.drop-text span {
  font-size: 17px;
  color: var(--text-muted);
}

.browse-btn {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.upload-status {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 17px;
}

.upload-status.upload-success {
  background-color: var(--brand-tint, #e6f0ec);
  color: var(--brand);
  border: 2px solid var(--border);
}

.upload-status.upload-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

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

.coach-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
}

.coach-head {
  padding: 7px 16px;
  background-color: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.coach-avatar {
  width: 34px;
  height: 34px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.coach-info {
  flex: 1;
}

.coach-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-deep);
}

.mode-label {
  font-size: 17px;
  color: var(--text-muted);
}

.status {
  font-size: 17px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: var(--brand-tint, #e6f0ec);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.status-dot {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brand);
  box-shadow: 0 0 6px rgba(0, 102, 69, 0.5), 0 0 2px var(--brand);
  flex-shrink: 0;
}

/* Strobing Analyzing State */
.status.analyzing {
  background-color: var(--brand-tint, #e6f0ec);
  color: var(--brand);
  border-color: var(--brand);
  animation: strobe-status 0.9s ease-in-out infinite alternate;
}

.status.analyzing .status-dot {
  background-color: var(--brand);
  box-shadow: 0 0 6px rgba(0, 102, 69, 0.5);
}

.status-dot.connected {
  background-color: var(--brand);
  box-shadow: 0 0 6px rgba(0, 102, 69, 0.5), 0 0 2px var(--brand);
}

.status-dot.fallback-gemini {
  background-color: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
}

.status-dot.offline {
  background-color: #94a3b8;
  box-shadow: none;
}

@keyframes strobe-status {
  0% {
    opacity: 1;
    background-color: var(--brand-tint, #e6f0ec);
    color: var(--brand);
    box-shadow: 0 0 10px rgba(0, 102, 69, 0.3);
  }
  100% {
    opacity: 0.35;
    background-color: var(--surface-sunken);
    color: var(--ink-muted);
    box-shadow: 0 0 2px rgba(0, 102, 69, 0.1);
  }
}

.message.analyzing-bubble {
  /* border-color first: the shorthand would otherwise overwrite the brand left accent */
  border-color: var(--border);
  border-left: 3.5px solid var(--brand);
  background-color: var(--surface-sunken);
}

.analyzing-strobe-wrap {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
}

.analyzing-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  animation: strobe-text 0.85s ease-in-out infinite alternate;
}

.analyzing-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--brand);
  box-shadow: 0 0 0 0 rgba(0, 102, 69, 0.7);
  animation: strobe-dot 0.85s ease-in-out infinite;
}

@keyframes strobe-text {
  0% {
    opacity: 1;
    color: var(--brand);
    text-shadow: 0 0 8px rgba(0, 102, 69, 0.5);
  }
  100% {
    opacity: 0.3;
    color: var(--brand);
    text-shadow: none;
  }
}

@keyframes strobe-dot {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(0, 102, 69, 0.7);
    opacity: 0.5;
  }
  70% {
    transform: scale(1.25);
    box-shadow: 0 0 0 6px rgba(0, 102, 69, 0);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(0, 102, 69, 0);
    opacity: 0.5;
  }
}

.strobe-ellipsis {
  display: inline-block;
  letter-spacing: 1.5px;
}

/* Messages */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--surface-sunken);
}

.step-messages-pane {
  display: flex;
  flex-direction: column;
  gap: inherit;
  width: 100%;
}

.step-messages-pane[hidden] {
  display: none !important;
}

.message {
  max-width: 92%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  position: relative;
  line-height: 1.5;
}

.message small {
  display: block;
  font-size: 17px;
  font-weight: 700; /* Montserrat loads 400-700 only, 750 rounded to 700 anyway */
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message.assistant {
  align-self: flex-start;
  background-color: var(--surface);
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-card); /* was navy rgba(0,46,93) */
}

.message.assistant small {
  color: var(--primary);
}

.message.user {
  align-self: flex-end;
  background-color: var(--user-bubble);
  color: #ffffff;
}

.message.user small {
  color: #cbd5e1;
}

.message-text p {
  margin-bottom: 8px;
  line-height: 1.5;
}

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

/* Enhanced Bold & Field Headings in Messages */
.message-text strong,
.message-text b {
  font-weight: 700; /* Montserrat loads 400-700 only, 750 rounded to 700 anyway */
  color: var(--ink);
}

.message.user strong,
.message.user b {
  font-weight: 700; /* Montserrat loads 400-700 only, 750 rounded to 700 anyway */
  color: #ffffff;
}

.message-text .message-heading,
.message-text h2,
.message-text h3,
.message-text h4 {
  font-size: 17px;
  font-weight: 700; /* Montserrat loads 400-700 only, 800 rounded to 700 anyway */
  color: var(--ink);
  margin-top: 14px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.message-text .message-heading:first-child,
.message-text h2:first-child,
.message-text h3:first-child,
.message-text h4:first-child {
  margin-top: 2px;
}

.message.user .message-heading,
.message.user h2,
.message.user h3,
.message.user h4 {
  color: #ffffff;
}

.message-text ul.message-list,
.message-text ol.message-list {
  margin: 6px 0 10px 20px;
  padding-left: 4px;
}

.message-text ul.message-list li,
.message-text ol.message-list li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.message-text ul.message-list li:last-child,
.message-text ol.message-list li:last-child {
  margin-bottom: 0;
}

.message-text .message-quote {
  margin: 8px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--brand);
  background: var(--brand-tint, #e6f0ec);
  border-radius: 0 6px 6px 0;
}

.message-text .message-quote p {
  margin-bottom: 0;
  color: var(--ink);
}

.message-text a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: normal;
  transition: color 0.15s ease-in-out;
}

.message-text a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.message.user a {
  color: #ffffff;
}

/* Feedback Region */
.answer-feedback {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.feedback-prompt {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.feedback-controls {
  display: flex;
  gap: 6px;
}

.feedback-button {
  background: var(--surface);
  border: 1px solid var(--border-strong); /* ECC rule 8: controls take border-strong */
  font-size: 17px;
  padding: 4px 8px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.feedback-button:hover {
  background: var(--surface-sunken);
  border-color: var(--primary);
  color: var(--primary);
}

.feedback-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.feedback-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-body);
  padding: 6px 8px;
  background: var(--input-fill);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
  min-height: 44px;
  box-shadow: var(--shadow-card);
  resize: vertical;
}
.feedback-form textarea:focus {
  background: var(--surface); /* ECC field spec: white fill, brand border and focus shadow on focus */
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}


.feedback-warning {
  font-size: 17px;
  color: var(--danger-text, #991b1b); /* ECC danger token, was raw #b91c1c */
}

.feedback-form-actions {
  display: flex;
  gap: 6px;
}

.feedback-submit {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  min-height: 44px;
}

.feedback-status {
  margin-top: 5px;
  font-size: 17px;
}

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

.feedback-error {
  color: #991b1b;
}

/* Prompt Suggestions Chips (Key Interaction Starters) */
.suggestions-wrap {
  padding: 8px 14px 10px;
  background-color: var(--surface-sunken);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.suggestions-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}

.suggestions-header .suggestions-icon {
  font-size: 17px;
  color: var(--brand);
}

.suggestions-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.starters-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--border-strong); /* ECC rule 8: controls take border-strong */
  border-radius: 50%;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card); /* was navy rgba(0,46,93) */
}

.starters-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.08);
}

.starters-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.suggestions {
  display: flex;
  flex-wrap: nowrap; /* one horizontal rail: app.js arrows and drag move scrollLeft */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  gap: 6px;
  padding-bottom: 4px;
  overflow-y: hidden;
  flex: 1;
  cursor: grab;
  user-select: none;
  scroll-behavior: smooth;
}

.suggestions.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.suggestions::-webkit-scrollbar {
  height: 4px;
}

.suggestions::-webkit-scrollbar-track {
  background: transparent;
}

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

.suggestions::-webkit-scrollbar-thumb:hover {
  background-color: var(--ink-muted);
}

.suggestions button {
  background-color: var(--surface);
  border: 1.5px solid var(--primary);
  padding: 6px 12px;
  min-height: 44px;
  border-radius: 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  text-align: left;
  box-shadow: var(--shadow-card); /* was navy rgba(0,46,93) */
  white-space: normal;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suggestions button:hover, .suggestions button:active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-card); /* was navy rgba(0,46,93) */
  transform: translateY(-1px);
}

/* Input Composer (Eye-Catching, High-Contrast, Always Visible Above the Fold) */
.composer {
  padding: 0.875rem 2rem 1.25rem;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

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

.composer-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.composer-beacon {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand);
}

.beacon-pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(0, 102, 69, 0.5);
  animation: beacon-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes beacon-ping {
  0% {
    transform: scale(0.75);
    opacity: 0.95;
  }
  70%, 100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

.composer-label-title {
  font-size: 17px;
  font-weight: 700; /* Montserrat loads 400-700 only, 800 rounded to 700 anyway */
  color: var(--primary-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.composer-hint {
  font-size: 17px;
  color: var(--text-muted);
}

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

.composer-input-wrap {
  flex: 1;
  position: relative;
}

.composer textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-body);
  padding: 11px 14px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  resize: none;
  min-height: 48px;
  max-height: 90px;
  line-height: 1.45;
  outline: none;
  background-color: var(--input-fill);
  color: var(--text-dark);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
}

.composer textarea:focus {
  background-color: var(--surface);
  border-color: var(--input-border);
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.composer textarea::placeholder {
  color: var(--ink-muted);
  font-size: 17px;
}

.composer button {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 0 18px;
  height: 48px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 102, 69, 0.25);
  flex-shrink: 0;
}

.composer button svg {
  color: #ffffff;
}

.composer button:hover:not(:disabled) {
  background: var(--brand-hover, #00503a); /* ECC token, was raw #005236 */
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 102, 69, 0.35);
}

.composer button:active {
  transform: translateY(0);
}

/* Footer */
.app-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4px 14px 5px;
  text-align: center;
  flex-shrink: 0;
}

.footer-privacy {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.inline-copy-prompt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-tint, #e6f0ec);
  color: var(--brand) !important;
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: normal;
}

.inline-copy-prompt-link:hover {
  background: var(--surface-sunken);
  border-color: var(--border);
  color: var(--brand) !important;
  transform: translateY(-1px);
}

/* Inline Video Action Button / Pill in Chat Messages */
.video-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  color: #991b1b !important;
  border: 2px solid var(--border-strong); /* was pink #fca5a5, not an ECC color */
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none !important;
  margin: 4px 0;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.08);
}

.video-action-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #7f1d1d !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.18);
}

.video-action-btn .video-play-icon {
  color: #dc2626;
  flex-shrink: 0;
}

.video-action-btn .video-ext-icon {
  font-size: 17px;
  opacity: 0.8;
  margin-left: 2px;
}

/* Video Spotlight Widget: Dual video buttons with player */
.video-spotlight-card {
  background: transparent;
  border-bottom: 1px solid var(--border);
  margin: 3px 12px 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.video-btn-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.single-video-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  min-height: 44px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card); /* was navy rgba(0,46,93) */
}

.single-video-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.single-video-btn .video-play-icon {
  color: #dc2626;
  flex-shrink: 0;
}

.single-video-btn .chevron {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.single-video-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.single-video-btn[aria-expanded="true"] {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Strobing Hide Video button: delayed until 2 minutes after watching, with relaxed 2.6s frequency */
.single-video-btn.strobe-hide {
  color: #ffffff !important;
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  font-weight: 700;
  animation: strobe-hide-video 2.6s ease-in-out infinite alternate;
}

@keyframes strobe-hide-video {
  0% {
    background-color: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 0 14px rgba(0, 102, 69, 0.7), 0 0 4px rgba(0, 102, 69, 0.5);
  }
  50% {
    background-color: var(--brand-tint, #e6f0ec);
    color: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 0 8px rgba(0, 102, 69, 0.3);
  }
  100% {
    background-color: var(--surface-sunken);
    color: var(--ink-muted);
    border-color: var(--border);
    box-shadow: 0 0 2px rgba(0, 102, 69, 0.1);
  }
}

.video-player-container {
  padding: 12px 16px;
  background: var(--surface);
}

.responsive-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.responsive-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption {
  margin-top: 8px;
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-bottom: 0;
}

/* Mobile-First Responsive Adjustments */
@media (max-width: 640px) {
  html, body {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
  }
  .app-container {
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    max-width: 100%;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }
  .topbar {
    padding: 6px 10px;
    gap: 8px;
    flex-shrink: 0;
  }
  .brand {
    font-size: 17px;
  }
  .brand-sub {
    display: none;
  }
  .quick-strip {
    padding: 3px 8px;
    font-size: 17px;
    gap: 5px;
    flex-shrink: 0;
  }
  .step-nav {
    padding: 3px 6px;
    flex-shrink: 0;
  }
  .step-list {
    gap: 4px;
  }
  .step-btn {
    padding: 4px 2px;
  }
  .step-text {
    display: none;
  }
  .step-btn .step-num {
    width: 20px;
    height: 20px;
    font-size: 17px;
  }
  .zoom-btn span {
    display: none;
  }
  .zoom-btn {
    padding: 5px 8px;
  }
  .quiet-button span {
    display: none;
  }
  .quiet-button {
    padding: 5px 8px;
  }
  .video-spotlight-card {
    margin: 2px 8px 3px;
    flex-shrink: 0;
  }
  .single-video-btn {
    padding: 4px 8px;
    font-size: 17px;
  }
  .main-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .coach-panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .status {
    font-size: 17px;
    padding: 2px 7px;
    gap: 4px;
  }
  .status::before {
    width: 6px;
    height: 6px;
  }
  .messages {
    flex: 1;
    min-height: 0;
    padding: 8px 10px;
    gap: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .message {
    max-width: 96%;
    padding: 9px 11px;
    font-size: var(--text-body);
  }
  .suggestions-wrap {
    padding: 4px 8px 5px;
    flex-shrink: 0;
  }
  .suggestions-header {
    font-size: 17px;
    margin-bottom: 3px;
  }
  .starters-nav-btn {
    width: 44px;
    height: 44px;
  }
  .suggestions button {
    padding: 4px 9px;
    font-size: 17px;
    min-height: 44px;
  }
  .composer {
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
  }
  .composer-header {
    margin-bottom: 3px;
  }
  .composer-label-title {
    font-size: 17px;
  }
  .composer-hint {
    display: none;
  }
  .composer textarea {
    font-size: var(--text-body);
    padding: 10px 12px;
    min-height: 62px;
    max-height: 95px;
    line-height: 1.45;
  }
  .composer button {
    height: 62px;
    padding: 0 14px;
    font-size: 17px;
  }
  .app-footer {
    display: none;
  }
  .copy-prompt-toast {
    margin: 6px 10px 2px;
    padding: 8px 10px;
  }
  .copy-prompt-toast .toast-links {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .copy-prompt-toast .toast-or {
    text-align: center;
    margin: -2px 0;
  }
  .copy-prompt-toast .toast-btn {
    justify-content: center;
    text-align: center;
    padding: 7px 10px;
    min-height: 44px;
  }
}

/* CES Brand Versioning & WCAG 2.2 AA Interaction Enhancements */
.ces-version-tag {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--brand-tint, #e6f0ec);
  border: 1px solid var(--border);
  border-radius: var(--ces-radius-full, 9999px);
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

button, input, select, textarea, a.dashboard-link, .starter-btn {
  min-height: 44px;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  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;
  }
}

/* Phones: keep the chat feed visible. Link strip and starters scroll inside a capped height. */
@media (max-width: 640px) {
  .quick-strip {
    max-height: 96px;
    overflow-y: auto;
  }
}
/* ECC: form controls do not inherit font by default, so they rendered in Arial */
button, input, select, textarea { font-family: inherit; }
/* ECC: under 640px the field takes its own full-width row and Send wraps below it */
@media (max-width: 639px) {
  .composer-row { flex-wrap: wrap; }
  .composer-row .composer-input-wrap { flex: 1 1 100%; min-width: 0; }
  .composer-row #send-button { flex: 1 1 100%; justify-content: center; }
}
/* ECC: keep the chat above the fold on phones. The locked-height shell left the feed about 30px tall at 375,
   so header actions, quick links, videos and starter chips each collapse to one row under 640px. */
@media (max-width: 639px) {
  .header-actions { flex-wrap: nowrap; }
  .dashboard-link .dashboard-text { display: none; } /* icon-only under 640; the link carries an aria-label */
  .quick-strip { flex-wrap: nowrap; }
  .quick-strip .strip-link { flex: 0 0 auto; white-space: nowrap; }
  .video-btn-group { flex-direction: row; }
  .video-btn-group .single-video-btn { flex: 1 1 0; min-width: 0; }
  .suggestions { flex-wrap: nowrap; }
  .suggestions button { flex: 0 0 auto; white-space: nowrap; max-width: none; } /* single-row rail, scrolled by the arrow buttons */
}
/* ECC: under 360px the badge pushed the app title to four lines; the title alone carries the identity there */
@media (max-width: 359px) {
  .brand-badge { display: none; }
  .header-actions { flex-wrap: wrap; } /* four controls plus the status pill do not fit one 300px row */
}
