/**
 * 100x Life Planning System - Interview Modal Styles
 * Styles for the AI interview modal and interview-enabled textareas
 */

/* ===== MULTI-THREAD DISCUSSION CHAT ===== */
.discussion-surface {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.discussion-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.6rem;
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  margin-bottom: 0.5rem;
}

.discussion-toolbar-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-weight: 600;
  color: var(--text-dark, #1a2b4a);
  font-size: calc(0.9rem + var(--text-bump));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discussion-toolbar-title i {
  color: var(--teal-accent);
  flex: 0 0 auto;
}

.discussion-toolbar-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.discussion-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.78rem + var(--text-bump));
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.discussion-toolbar-btn:hover,
.discussion-toolbar-btn:focus-visible {
  background: var(--teal-light, #e8f4f8);
  border-color: var(--teal-accent);
  color: var(--teal-accent);
  outline: none;
}

.discussion-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 40vh;
  overflow-y: auto;
  padding: 0.5rem;
  margin-bottom: 0.6rem;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
}

.discussion-history-header {
  font-size: calc(0.72rem + var(--text-bump));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #718096);
  font-weight: 600;
  padding: 0.15rem 0.25rem;
}

.discussion-history-empty {
  color: var(--text-muted, #718096);
  font-style: italic;
  font-size: calc(0.85rem + var(--text-bump));
  padding: 0.25rem;
  margin: 0;
}

.discussion-history-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  padding: 0.55rem 0.7rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  border-radius: 6px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.discussion-history-item:hover,
.discussion-history-item:focus-visible {
  border-color: var(--teal-accent);
  box-shadow: 0 2px 8px rgba(74, 155, 181, 0.12);
  outline: none;
}

.discussion-history-item.is-current {
  border-color: var(--teal-accent);
  background: var(--teal-light, #e8f4f8);
}

.discussion-history-item-title {
  font-weight: 600;
  color: var(--text-dark, #1a2b4a);
  font-size: calc(0.88rem + var(--text-bump));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discussion-history-item-summary {
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.8rem + var(--text-bump));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discussion-history-item-meta {
  color: var(--text-muted, #718096);
  font-size: calc(0.72rem + var(--text-bump));
}

/* ===== INTERVIEW-ENABLED TEXTAREA ===== */

.interview-textarea-wrapper {
  position: relative;
  width: 100%;
}

.interview-textarea-wrapper textarea {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-family: inherit;
  font-size: calc(1rem + var(--text-bump));
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease;
}

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

.interview-textarea-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.interview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: calc(0.875rem + var(--text-bump));
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.interview-btn-ai {
  background: linear-gradient(135deg, var(--teal-accent), var(--navy-medium));
  color: white;
}

.interview-btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 155, 181, 0.3);
}

.interview-btn-guided {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-secondary);
  border: 1px solid var(--border-color, #e2e8f0);
}

.interview-btn-guided:hover {
  background: var(--bg-primary, #ffffff);
  border-color: var(--teal-accent);
}

/* History indicator */
.interview-textarea-wrapper.has-history .interview-btn-ai::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--teal-accent);
  border-radius: 50%;
  margin-left: 4px;
}

/* ===== MODAL OVERLAY ===== */

.interview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.modal-open {
  overflow: hidden;
}

/* ===== MODAL CONTAINER ===== */

.interview-modal {
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 2rem);
  background: var(--bg-primary, #ffffff);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-y: auto;  /* Allow modal to scroll if content exceeds viewport */
  animation: slideUp 0.3s ease;
}

/* Module "Explore with AI Coach" chat modals (people/family/faith/philanthropy/
   time) share this markup but had per-module padding drift: most flush to the
   top (no vertical padding) and carry a standalone-page `height: 100vh - 150px`
   that overflows the centered dialog, leaving a large empty gap at the bottom.
   Inside the dialog, normalize the inset and let the container fill the modal's
   flex column instead of imposing a viewport height. Scoped to `dialog` so the
   standalone-page rendering (.interview-standalone) is untouched. */
dialog .interview-modal > [class$="-chat-container"] {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--spacing-lg, 1.5rem) var(--spacing-lg, 1.5rem) var(--spacing-md, 1rem);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Assistant text while it streams in token-by-token. pre-wrap preserves the
   newlines the model emits before the finalized bubble re-renders with
   paragraph formatting. */
.streaming-text {
  white-space: pre-wrap;
}

/* Error bubble shown when an AI reply can't be generated (job failure or the
   client-side watchdog). Renders as a muted assistant message with an alert tint. */
.message.ai.chat-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-secondary, #4a5568);
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.18);
}

.message.ai.chat-error i {
  color: #c0392b;
}

/* ===== NATIVE <dialog> MODAL HOST ===== */
/* The interview/chat shell loads into the layout's <dialog> via a lazy
   <turbo-frame id="modal"> (dialog_controller opens it on frame load). The
   dialog is a transparent positioning box; the brand backdrop (dim + blur) is
   the ::backdrop pseudo-element — reproducing .interview-modal-overlay without a
   fixed-position div. showModal() gives focus-trapping, Esc, and an inert
   background for free. */
dialog {
  margin: auto;
  width: calc(100% - 2rem);
  max-width: 900px;
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

dialog[open] {
  animation: slideUp 0.3s ease;
}

dialog turbo-frame#modal {
  display: block;
}

/* The dialog already caps the width; let the card fill it and avoid animating
   twice (the dialog animates on open). */
dialog .interview-modal {
  max-width: none;
  animation: none;
}

/* The dialog box and its card are containers, not controls — showModal() may
   focus the card, but it shouldn't render a focus ring around the whole modal
   (inner buttons/inputs keep theirs). */
dialog:focus,
dialog .interview-modal:focus {
  outline: none;
}

/* The platform "Discussion" chat is a full-page layout; inside the modal, drop
   its centered max-width and let the chat flex instead of a fixed 400px empty
   box, so the modal isn't an oversized full-height card. */
dialog .platform-interview-container {
  max-width: none;
  margin: 0;
}

dialog .platform-interview-container .chat-messages {
  height: auto;
  min-height: 220px;
  max-height: 42vh;
}

/* Lock background scroll while any dialog is open — pure CSS, no JS. */
html:has(dialog[open]) {
  overflow: hidden;
}

/* Bespoke modals migrated to <dialog> keep their card width by capping the
   dialog and letting the inner card fill it (so it stays centered, not
   left-aligned inside a wider dialog). */
dialog.quick-edit-modal {
  max-width: 520px;
}

dialog.quick-edit-modal .modal-content {
  width: 100%;
  max-width: none;
}

dialog.settings-modal-dialog {
  max-width: 720px;
}

dialog.export-modal-dialog {
  max-width: 800px;
}

dialog.scenario-modal-dialog {
  max-width: 600px;
}

dialog.time-modal-dialog {
  max-width: 500px;
}

/* Scripture picker: without a cap it inherited the global 900px and sprawled.
   A verse lookup wants a focused card. (The card shape + scroll live with the
   other .faith-scripture-modal rules in faith.css.) */
dialog.faith-scripture-modal {
  max-width: 600px;
}

/* Standalone fallback (direct visit / refresh / activity deep link): the same
   card centered on the page background, no dialog. */
.interview-standalone {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.interview-standalone .interview-modal {
  margin: 0 auto;
  max-height: calc(100vh - 8rem);
  border: 1px solid var(--border-color, #e2e8f0);
}

/* ===== MODAL HEADER ===== */

.interview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8f9fa);
}

.interview-modal-title-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.interview-modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.interview-modal-close:hover {
  background: var(--teal-light, #e8f4f8);
  border-color: var(--teal-accent);
  color: var(--teal-accent);
}

.interview-modal-header h2 {
  font-size: calc(1.25rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary);
  margin: 0;
}

.interview-modal-subtitle {
  font-size: calc(0.875rem + var(--text-bump));
  color: var(--text-muted);
  margin: 0;
}

.interview-modal-subtitle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2px;
}

.interview-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: calc(0.75rem + var(--text-bump));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  background: var(--teal-light, #e8f4f8);
  color: var(--teal-accent, #4a9bb5);
}

.interview-mode-badge i {
  font-size: calc(0.7rem + var(--text-bump));
}

/* ===== MODE TOGGLE ===== */

.interview-modal-mode-toggle {
  display: flex;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 4px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: calc(0.8125rem + var(--text-bump));
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: var(--text-secondary);
}

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

.mode-btn i {
  font-size: calc(1rem + var(--text-bump));
}

.mode-btn span {
  display: none;
}

@media (min-width: 480px) {
  .mode-btn span {
    display: inline;
  }
}

/* ===== MODAL BODY ===== */

.interview-modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== MODE PANELS ===== */

.interview-mode-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;  /* Critical for nested flex scroll */
}

.interview-mode-panel.active {
  display: flex;
}

/* ===== INTERVIEW MODE (CHAT) ===== */

#interviewPanel .chat-container {
  flex: 1;
  min-height: 0;  /* Critical for nested flex scroll */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#interviewPanel .chat-messages {
  flex: 1;
  min-height: 0;  /* Critical for nested flex scroll */
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-secondary, #f8f9fa);
}

#interviewPanel .chat-input-container {
  flex-shrink: 0;  /* Don't shrink, maintain fixed height */
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-primary, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
}

#interviewPanel .chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: calc(1rem + var(--text-bump));
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  resize: none;
  max-height: 120px;
}

#interviewPanel .chat-input:focus {
  outline: none;
  border-color: var(--teal-accent);
}

#interviewPanel .send-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

#interviewPanel .send-btn:hover {
  background: var(--navy-medium);
  transform: scale(1.05);
}

/* ===== INTERVIEW ACTION BAR ===== */

.interview-action-bar {
  flex-shrink: 0;  /* Don't shrink, maintain fixed height */
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem;
  background: var(--bg-primary, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.interview-action-bar .btn {
  min-width: 200px;
}

/* ===== GUIDED MODE ===== */

#guidedPanel .guided-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.guided-question {
  margin-bottom: 1.5rem;
}

.guided-question label {
  display: block;
  font-weight: 500;
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
}

.guided-question textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: calc(1rem + var(--text-bump));
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  resize: vertical;
  min-height: 80px;
}

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

.guided-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ===== SYNTHESIS MODE ===== */

#synthesisPanel .synthesis-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.synthesis-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.synthesis-header i {
  font-size: calc(2rem + var(--text-bump));
  color: var(--teal-accent);
  margin-bottom: 0.5rem;
}

.synthesis-header h3 {
  font-size: calc(1.25rem + var(--text-bump));
  color: var(--navy-primary);
  margin: 0 0 0.25rem;
}

.synthesis-header p {
  font-size: calc(0.875rem + var(--text-bump));
  color: var(--text-muted);
  margin: 0;
}

.synthesis-textarea {
  flex: 1;
  width: 100%;
  padding: 1.25rem;
  font-size: calc(1.05rem + var(--text-bump));
  line-height: 1.7;
  border: 2px solid var(--teal-accent);
  border-radius: 12px;
  resize: vertical;
  min-height: 250px;
  background: var(--teal-light, #e8f4f8);
}

.synthesis-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 155, 181, 0.2);
}

.synthesis-textarea:disabled {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-muted);
}

.synthesis-wordcount {
  margin-top: 0.5rem;
  text-align: right;
  font-size: calc(0.8125rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

.synthesis-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.synthesis-actions .btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
}

/* Resynthesis banner */
.resynthesis-banner {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
}

.resynthesis-banner p {
  margin: 0 0 0.75rem;
  font-size: calc(0.9375rem + var(--text-bump));
  color: var(--text-secondary);
}

/* Disabled "Use This Statement" button */
#useSynthesisBtn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== CURRENT VALUE SECTION ===== */

.interview-modal-current {
  border-top: 2px solid var(--teal-accent);
  background: linear-gradient(to bottom, var(--teal-light, #e8f4f8), var(--bg-secondary, #f8f9fa));
}

.current-value-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: calc(0.9375rem + var(--text-bump));
  font-weight: 500;
  color: var(--navy-medium, #2d4a6f);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.current-value-toggle:hover {
  color: var(--teal-accent);
}

.current-value-toggle i {
  font-size: calc(0.75rem + var(--text-bump));
  transition: transform 0.2s;
}

.current-value-content {
  display: none;
  padding: 0 1.5rem 1.25rem;
}

.current-value-content.expanded {
  display: block;
}

.current-value-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: calc(0.9375rem + var(--text-bump));
  line-height: 1.7;
  border: 1px solid rgba(74, 155, 181, 0.3);
  border-radius: 10px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-dark, #1a2b4a);
  resize: none;
  min-height: 120px;
  overflow-y: hidden;
}

.current-value-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0 0.25rem;
}

.current-value-wordcount {
  font-size: calc(0.8125rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

#makeConciseBtn {
  font-size: calc(0.8125rem + var(--text-bump));
  padding: 0.4rem 0.85rem;
}

/* ===== CHAT MESSAGE BUBBLES =====
 * Chat bubbles themselves (assistant left / user right) are styled by the
 * shared `.message`, `.message.ai`, `.message.user` rules in modules/roadmap.css
 * — the same classes the current Firebase app's chat.js renderMessages emits.
 * The interview/area/module chats all render through messages/_inline_chat
 * (and the opener through messages/_opener) so those rules apply unchanged.
 * Only the message-entrance animation is interview-local. */

.chat-messages .message {
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
  .interview-modal-overlay {
    padding: 0;
  }

  .interview-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  /* Stack the header so the title, badge/subtitle, and the Interview/Guided
     toggle don't cram into one row on a narrow screen. */
  .interview-modal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .interview-modal-header h2 {
    font-size: calc(1.125rem + var(--text-bump));
  }

  .interview-modal-subtitle-row {
    flex-wrap: wrap;
  }

  .interview-modal-mode-toggle {
    align-self: flex-start;
    padding: 2px;
  }

  .mode-btn {
    padding: 0.375rem 0.625rem;
  }

  /* Park / Synthesize stack full-width so neither gets clipped. */
  .interview-action-bar,
  .interview-action-bar--split {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .interview-action-bar .btn,
  .interview-action-bar--split .btn {
    width: 100%;
    justify-content: center;
  }

  #interviewPanel .chat-messages,
  #guidedPanel .guided-container,
  #synthesisPanel .synthesis-container {
    padding: 1rem;
  }

  #interviewPanel .chat-input-container {
    padding: 0.75rem 1rem;
  }

  .synthesis-actions {
    flex-direction: column;
  }
}

/* ===== LOADING STATE ===== */

.interview-modal .chat-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: calc(0.875rem + var(--text-bump));
}

.interview-modal .chat-loading::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--teal-accent);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ===== RAILS INLINE-CHAT PARITY =====
 * The current Firebase app builds the inline interview chat with a single
 * `.chat-container` > `.chat-messages` + `.chat-input-container` structure (see
 * public/js/modules/people.js). The Rails rebuild keeps those exact class names
 * so the copied "CHAT INTERFACE" rules in modules/roadmap.css apply unchanged,
 * but it must wrap the input row in a `form_with` and a bookmarkable
 * `.interview-surface`. These rules keep those Rails-only elements
 * layout-transparent so the visual result is identical to the original. */

/* The standalone interview view (interviews#show) wrapper — passes through. */
.interview-surface {
  display: block;
}

/* Rails wraps the input row in a real <form>; `display: contents` lets the
 * inner `.chat-input-container` lay out as a direct child of `.chat-container`,
 * exactly as the original markup does (no extra box, no extra spacing). */
.interview-chat-form {
  display: contents;
}

/* The hidden Rails CSRF/routing fields inside the form must never reserve
 * space — `display: contents` already removes the form box, this guards the
 * inputs themselves in case a browser renders them. */
.interview-chat-form input[type="hidden"] {
  display: none;
}

/* JS/test hook classes that ride alongside the original brand classes on the
 * same elements (`.interview-chat` on `.chat-container`, `.interview-chat-send`
 * on `.send-btn`, `.interview-chat-textarea` on `.chat-input`). They carry no
 * visual rules of their own — the original classes own the look — but are
 * declared here so every class the markup uses is accounted for in the CSS. */
.interview-chat,
.interview-chat-send,
.interview-chat-textarea {
  /* styling inherited from .chat-container / .send-btn / .chat-input */
  box-sizing: border-box;
}

/* ===== FOCUSED FOUNDATION INTERVIEW (inline, non-overlay) =====
 * The foundation interview (interviews#foundation) reuses the modal's class
 * names but renders inline in the content area instead of inside an overlay.
 * These rules adapt the modal card to a focused page: it sits in normal flow,
 * fills the available height, and the action bar splits Park (left) from
 * Synthesize (right). Everything inside reuses the existing modal CSS above. */

.interview-surface--focused {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.interview-modal--inline {
  margin: 0 auto;
  max-height: calc(100vh - 8rem);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border-color, #e2e8f0);
}

/* The chat panel already lays itself out via #interviewPanel rules; the seeded
 * opener renders as the first `.message.ai` bubble INSIDE `.chat-messages`
 * (via messages/_opener), so this wrapper only needs to let the chat fill the
 * available height. */
.interview-chat-with-opener {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Park left, Synthesize right. */
.interview-action-bar--split {
  justify-content: space-between;
  gap: 1rem;
}

.interview-action-bar--split .btn {
  min-width: 0;
}

.interview-action-bar--split .btn-gold {
  min-width: 200px;
}

/* The inline Park form sits between the action bar and the drawer. */
#interviewPanel .park-inline-form {
  padding: 0 1.5rem 1rem;
}

#interviewPanel .park-inline-form .park-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  resize: vertical;
  font-size: calc(0.95rem + var(--text-bump));
}

#interviewPanel .park-inline-form .park-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Saved-synthesis confirmation block (re-uses .synthesis-container chrome). */
.synthesis-container--saved {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-secondary, #f8f9fa);
}

.synthesis-container--saved .synthesis-textarea {
  min-height: 120px;
}

/* Inline synth error mirrors the area interview's error bubble. */
.foundation-synth-error {
  margin: 1rem 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fdecea;
  color: #b3261e;
  font-size: calc(0.9rem + var(--text-bump));
}

/* ── Area interview (contract G) shell tweaks ─────────────────────────────
   The focused area interview reuses the .interview-modal shell + the original
   app's .area-* chip/review class names. These rules adapt those pieces to the
   inline (non-overlay) shell and style the Rails-only current-plan drawer. */

/* The coverage-chip synth button is a button_to (wrapped in a <form>); keep the
   form layout-transparent so the chip stays a single inline-flex pill. */
.area-interview-chips .button_to {
  display: inline-flex;
  margin: 0;
}

.area-chip-synth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--teal-accent, #4a9bb5);
  cursor: pointer;
}

.area-chip-synth-btn:hover,
.area-chip-synth-btn:focus-visible {
  background: var(--teal-light, #e8f4f8);
  outline: none;
}

.area-chip-synth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Current-plan drawer: one labelled, read-only textarea per dimension. */
#currentCellsContent .area-current-cell {
  margin-bottom: 0.75rem;
}

.area-current-cell-label {
  display: block;
  font-size: calc(0.8rem + var(--text-bump));
  font-weight: 600;
  color: var(--text-secondary, #4a5568);
  margin-bottom: 0.25rem;
}

/* Manual-edit overwrite confirm in the review panel. */
.area-review-overwrite {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: calc(0.82rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

/* The area review panel renders inline (not the overlay flex child). */
.interview-modal .area-interview-review-panel {
  padding: 1rem 1.5rem;
}
