/* ==========================================================================
   Fynex Network Candidate Chat — Tiosan Copilot UI/UX Overhaul
   Full-viewport split workspace: Center Thread + Dock | Right Dossier Panel
   ========================================================================== */

body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}

/* Top Header */
.top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hdr-h);
  padding: 0 16px;
  background: var(--bg-main);
  z-index: 15;
}
.hdr-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.step-whisper {
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 12.5px;
}
.dossier-toggle-btn {
  display: none;
}

/* Main Split Workspace */
.chat-workspace {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Center Chat Column + Dock */
.chat-center {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-thread);
  position: relative;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 24px;
}

.chat-column {
  max-width: var(--max-col-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Welcome Context Banner inside Thread */
.ad-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.ad-card .ad-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ad-card strong { color: var(--text-primary); }

/* Conversation Thread */
#thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 15.5px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(18, 33, 27, 0.04);
}

/* Maya's message: crisp white card on left with subtle emerald identity border */
.msg.support {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
}

/* Candidate's message: Tiosan emerald soft card on right */
.msg.candidate {
  align-self: flex-end;
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand-strong);
  border-radius: 16px 4px 16px 16px;
}

.msg.support.complete {
  background: var(--brand-soft);
  border: 1.5px solid var(--brand);
  color: var(--text-primary);
  font-weight: 500;
}

/* 6/6 Completion & Approval Celebration Card */
.completion-card {
  background: linear-gradient(135deg, #f0f9f5 0%, #ffffff 100%);
  border: 1.5px solid var(--brand);
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 6px;
  box-shadow: 0 6px 20px rgba(11, 110, 79, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.completion-card.is-approved {
  background: linear-gradient(135deg, #e3f5ed 0%, #ffffff 100%);
  border-width: 2px;
}
.comp-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.completion-card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--brand-strong);
}
.completion-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.comp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 2px;
}
.comp-grid div {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}
.comp-grid span { color: var(--text-muted); font-size: 11px; }
.comp-grid strong { color: var(--text-primary); font-weight: 600; }
.comp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Welcome Back / Saved Session Resume Pill */
.resume-banner {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-strong);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* File Upload Card in Thread */
.msg.candidate.file-card {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
  width: min(360px, 88%);
  box-shadow: var(--shadow-sm);
}
.thumb {
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 8px;
}
.kindrow {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
select.kind {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
}
select.kind:focus { border-color: var(--brand); background: #ffffff; }
.mini {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.mini:hover { background: var(--brand-strong); }
.mini:disabled { opacity: 0.5; cursor: default; }
.fstatus {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* Typing Indicator */
.typing {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 18px;
  display: none;
  box-shadow: var(--shadow-sm);
}
.typing.show { display: inline-flex; align-items: center; gap: 5px; }
.typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulseDot 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes pulseDot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.fatal-alert {
  display: none;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

/* Drag-and-Drop Overlay */
.drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 30;
  background: rgba(232, 244, 239, 0.92);
  border: 2px dashed var(--brand);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.drop-overlay[hidden] { display: none !important; }
.drop-box {
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-strong);
  box-shadow: var(--shadow-popover);
}

/* Quick-Reply & Smart Upload Chips */
.photo-coach-bar {
  max-width: var(--max-col-width);
  margin: 0 auto 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.quick-chips {
  max-width: var(--max-col-width);
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-chips:empty { display: none; margin: 0; }
.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.06s ease;
}
.quick-chip:hover {
  background: #d5ece2;
  border-color: var(--brand);
}
.quick-chip:active { transform: scale(0.97); }
.quick-chip.is-upload {
  background: #ffffff;
  border-color: var(--brand);
  color: var(--brand);
}
.quick-chip.is-upload:hover {
  background: var(--brand);
  color: #ffffff;
}

/* Live Captured Profile Box in Dossier */
.profile-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-box[hidden] { display: none !important; }
.profile-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.35;
  padding: 2px 4px;
  border-radius: 6px;
}
.profile-row.is-editable { cursor: pointer; transition: background 0.12s ease; }
.profile-row.is-editable:hover { background: var(--brand-soft); }
.profile-row span { color: var(--text-secondary); }
.profile-row strong {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* Bottom Composer Dock (Tiosan Pill Box) */
.composer {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
}
.composer-inner {
  max-width: var(--max-col-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  background: var(--bg-composer);
  border: 1.5px solid var(--border-focus);
  border-radius: 20px;
  box-shadow: var(--shadow-composer);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer-inner:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.14);
}
.attach {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 22px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.attach:hover { background: var(--bg-hover); color: var(--brand-strong); }
.composer-inner input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0 8px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
}
.composer-inner input[type="text"]::placeholder { color: var(--text-muted); }
.send {
  flex-shrink: 0;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 22px;
  background: var(--brand);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.06s ease;
}
.send:hover { background: var(--brand-strong); }
.send:active { transform: scale(0.97); }
.send:disabled { opacity: 0.5; cursor: default; }

/* Right Dossier Sidebar (Applicant File & 6-Step Checklist) */
.dossier-sidebar {
  width: clamp(290px, 33vw, 360px);
  flex-shrink: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border);
}
.sidebar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 8px 16px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}
.sidebar-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-count-pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dossier-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Status & Telemetry Banner inside Dossier */
.keybar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.keybar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.keybar strong { color: var(--brand-strong); font-weight: 600; }
.memoline {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin: 2px 0 0;
  word-break: break-all;
}

.issue-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--kb-soft);
  border: 1px solid var(--kb-border);
  color: var(--kb-accent);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}

/* 6-Step Dossier Checklist Cards (Tiosan .checklist-step-row style) */
.docs-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.doc-item b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.doc-item-body {
  flex: 1;
  min-width: 0;
}
.doc-item span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.doc-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 2px;
}
.doc-item.done {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.doc-item.done b {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}
.doc-item.done span { color: var(--brand-strong); }
.doc-item.warn {
  background: var(--kb-soft);
  border-color: var(--kb-border);
}
.doc-item.warn b {
  background: #d98a00;
  border-color: #d98a00;
  color: #ffffff;
}
.doc-item.warn span { color: var(--kb-accent); }
.doc-item.warn small { color: var(--kb-accent); font-weight: 600; }

.doc-item.is-clickable {
  cursor: pointer;
}
.doc-item.is-clickable:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(11, 110, 79, 0.08);
}
.doc-item .doc-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 2px 7px;
  border-radius: 999px;
  align-self: center;
  flex-shrink: 0;
}
.doc-item.done .doc-cta {
  color: var(--brand-strong);
  background: #ffffff;
}

.docs-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  padding: 4px 6px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.45);
  z-index: 40;
  display: none;
}
.drawer-backdrop.open { display: block; }
.mobile-close-dossier { display: none; }

@media (max-width: 760px) {
  .dossier-toggle-btn { display: inline-flex; }
  .mobile-close-dossier { display: inline-flex; }
  .dossier-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(90vw, 360px);
    z-index: 50;
    box-shadow: var(--shadow-popover);
    transform: translateX(105%);
    transition: transform 0.24s ease;
  }
  .dossier-sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 600px) {
  /* ── Ultra-compact header: single row ── */
  .top {
    padding: 4px 8px;
    gap: 6px;
    min-height: auto;
    flex-wrap: nowrap;
    align-items: center;
  }
  .mark, .hdr-avatar { width: 28px; height: 28px; font-size: 11px; }
  .brand { flex: 0 1 auto; min-width: 0; }
  .brand strong {
    font-size: 13px; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block;
  }
  .brand span { display: none; }
  .hdr-status-row { display: none; }
  #sidPill { display: none !important; }
  #verPill, .ver-pill { display: none !important; }

  .top-actions {
    flex: 0 0 auto;
    gap: 3px;
    flex-wrap: nowrap;
    margin-left: auto;
  }
  .ghost-btn { padding: 0 7px; font-size: 11px; min-height: 28px; }
  .nav-switch { gap: 1px; padding: 2px; }
  .nav-switch-item { min-height: 26px; padding: 0 8px; font-size: 11px; }

  /* ── Slim step-progress bar ── */
  .step-progress { padding: 2px 10px 4px; gap: 4px; }

  /* ── Compact composer: minimal vertical footprint ── */
  .composer { padding: 3px 8px 5px; }
  .photo-coach-bar {
    padding: 3px 8px; font-size: 10.5px; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
  }
  .quick-chips { gap: 3px; margin-bottom: 2px; }
  .quick-chip { padding: 2px 8px; font-size: 10.5px; }
  .composer-inner { padding: 2px 3px; gap: 5px; border-radius: 16px; }
  .attach { width: 34px; height: 34px; font-size: 17px; border-radius: 11px; }
  .composer-inner input[type="text"] { height: 34px; font-size: 15px; padding: 0 6px; }
  .send { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 17px; }

  /* ── Thread & cards ── */
  .msg { max-width: 92%; font-size: 14.5px; padding: 10px 14px; }
  .ad-card { padding: 10px 12px; font-size: 13px; }
  .ad-card .ad-label { font-size: 10.5px; padding: 1px 7px; margin-bottom: 5px; }
  .chat-scroll { padding: 10px 10px 14px; }
  .chat-column { gap: 10px; }

  /* ── Hide session ID in resume banner ── */
  .resume-banner small { display: none; }
  .resume-banner { padding: 6px 10px; font-size: 12px; }

  /* ── Completion grid single column ── */
  .comp-grid { grid-template-columns: 1fr; }
}

/* ===== v5.9 SOTA chat layer (mobile-first) ===== */
body { background: var(--thread-grad); }
.top {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-t);
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 8px 24px rgba(18,33,27,.04);
}
.chat-center { background: var(--thread-grad); }
.chat-scroll { scroll-behavior: smooth; padding: 20px 16px 28px; }

/* Hero / welcome card */
.ad-card {
  background: var(--hero-grad);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-bubble);
  position: relative; overflow: hidden;
}
.ad-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand-grad);
}
.ad-card .ad-label { font-size: 12px; padding: 4px 11px; box-shadow: var(--shadow-sm); }
.ad-points { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ad-points span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.ad-points span::before { content: "✓"; color: var(--brand); font-weight: 800; }
.ad-disclosure { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Messages */
.msg { box-shadow: var(--shadow-bubble); animation: msgIn .24s var(--ease-out); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.support { border-radius: 6px 18px 18px 18px; }
.msg.candidate { background: var(--brand-grad); border: none; border-radius: 18px 6px 18px 18px; box-shadow: 0 4px 14px rgba(11,110,79,.22); }
.msg.candidate.file-card { background: #fff; box-shadow: var(--shadow-bubble); border: 1px solid var(--border); }
.completion-card, .resume-banner { border-radius: var(--radius-xl); box-shadow: var(--shadow-bubble); animation: msgIn .3s var(--ease-out); }

/* Composer: floating, safe-area aware */
.composer {
  background: linear-gradient(180deg, rgba(247,250,248,0) 0%, rgba(247,250,248,.92) 22%, #fff 100%);
  border-top: none;
  padding: 14px 16px calc(12px + var(--safe-b));
}
.composer-inner {
  border-radius: 24px; padding: 6px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-float);
}
.composer-inner:focus-within { border-color: var(--brand); box-shadow: var(--shadow-float), 0 0 0 4px rgba(11,110,79,.13); }
.attach { border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.attach:hover { background: var(--brand); color: #fff; }
.send { background: var(--brand-grad); border-radius: 999px; box-shadow: 0 4px 12px rgba(11,110,79,.28); min-width: 76px; }
.send:hover { background: var(--brand-grad); filter: brightness(1.07); }
.composer-hint { max-width: var(--max-col-width); margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--text-muted); }

/* Chips: one confident row */
.quick-chips { flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.quick-chip { min-height: 38px; padding: 7px 14px; font-size: 13px; background: #fff; border-color: var(--brand-border); box-shadow: var(--shadow-sm); }
.quick-chip.is-upload { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(11,110,79,.25); }
.quick-chip.is-upload:hover { background: var(--brand-grad); filter: brightness(1.07); color: #fff; }
.photo-coach-bar { border-radius: 12px; padding: 9px 12px; font-size: 12.5px; background: #fff; box-shadow: var(--shadow-sm); }

/* Dossier polish */
.dossier-sidebar { background: linear-gradient(180deg, #fbfcfb, var(--bg-subtle)); }
.doc-item { border-radius: 16px; padding: 13px; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease-out); }
.doc-item.is-clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.keybar { border-radius: 16px; }
.profile-box, .issue-banner { border-radius: 16px; }

@media (max-width: 600px) {
  /* Keep step context visible: whisper only, no conn noise */
  .hdr-status-row { display: flex !important; margin-top: 1px; }
  .hdr-status-row .status-dot, #connLabel, .hdr-status-row .ai-badge { display: none !important; }
  .brand .hdr-status-row .step-whisper { display: inline !important; }
  /* Candidate phones: staff nav is expendable, brand + File are not */
  .top .nav-switch { display: none; }
  .brand { flex: 1 1 auto !important; min-width: 0; }
  .step-whisper { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 158px; }
  #freshBtn { padding: 0 9px; }
  .step-whisper { font-size: 11.5px; }
  .brand strong { font-size: 13.5px; }
  .top { padding: 8px 10px; min-height: 52px; }
  #toggleDossierBtn { min-height: 38px; padding: 0 12px; border-radius: 999px; background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-strong); font-weight: 700; }
  .ghost-btn { min-height: 34px; }
  .composer { padding: 10px 10px calc(8px + var(--safe-b)); }
  .composer-hint { display: none; }
  .composer-inner { border-radius: 22px; }
  .attach { width: 42px; height: 42px; }
  .composer-inner input[type="text"] { height: 42px; font-size: 16px; }
  .send { height: 42px; min-width: 68px; padding: 0 16px; }
  /* Chips become a single swipeable row: zero vertical cost */
  .quick-chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -2px 8px; padding: 2px; }
  .quick-chips::-webkit-scrollbar { display: none; }
  .quick-chip { flex: 0 0 auto; min-height: 36px; padding: 6px 13px; font-size: 12.5px; white-space: nowrap; }
  .photo-coach-bar { white-space: normal; font-size: 11.5px; }
  .msg { max-width: 90%; }
  .ad-card { padding: 14px; }
  .chat-scroll { padding: 12px 10px 20px; }
}
/* Chat history (this browser's chats, click to reopen) */
.history-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 12px; }
.history-list { display: grid; gap: 8px; }
.history-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 13px; border: 1px solid var(--border); border-radius: 14px;
  background: #fff; cursor: pointer; text-align: left;
}
.history-row:hover { border-color: var(--brand-border); box-shadow: var(--shadow-sm); }
.history-row.is-current { border-color: var(--brand); background: var(--brand-soft); }
.history-main { flex: 1 1 auto; min-width: 0; }
.history-title { font-weight: 700; font-size: 13.5px; color: var(--text-primary); }
.history-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.history-preview { font-size: 12.5px; color: var(--text-secondary); margin-top: 5px; line-height: 1.45; }
.history-sid { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 5px; overflow-wrap: anywhere; }
.history-remove { flex: 0 0 auto; font-size: 11.5px; }
.history-empty { padding: 16px; border: 1px dashed var(--border); border-radius: 14px; color: var(--text-muted); font-size: 13px; text-align: center; }
.history-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.history-footer a { font-size: 12.5px; font-weight: 600; color: var(--brand-strong); }

@media (min-width: 761px) {
  .drawer-backdrop { display: none !important; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .composer { padding: 6px 12px calc(6px + var(--safe-b)); }
  .composer-hint { display: none; }
  .quick-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 6px; }
  .quick-chips::-webkit-scrollbar { display: none; }
  .quick-chip { flex: 0 0 auto; white-space: nowrap; }
  .chat-scroll { padding-top: 10px; }
}
