﻿* { box-sizing: border-box; margin: 0; padding: 0; }
  html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body {
    font-family: 'Outfit', sans-serif;
    background: #f5f3ef;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-x: hidden;
  }
  /* Outer wrapper: at least fills the viewport, can grow taller so page scrolls */
  .widget-wrapper {
    width: 100%;
    max-width: 1140px;
    height: calc(100vh - 32px);
    border-radius: 16px;
    overflow-x: hidden;
    box-shadow: 0 16px 72px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    font-family: 'Geist', sans-serif;
    zoom: 0.9;
  }

  /* ── HEADER ─────────────────────────────────────────────────────── */
  .widget-header {
    background: #3d9ea3;
    border-bottom: none;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    transition: background 0.4s ease;
  }
  .widget-header > a:first-child { margin-right: auto; }
  .widget-header.test-mode { background: #0d2e2b; }
  .test-mode-badge {
    display: none; margin-left: 8px;
    background: rgba(255,220,80,0.15); border: 1px solid rgba(255,220,80,0.45);
    color: #ffd84d; font-size: 10px; font-weight: 700; padding: 3px 9px;
    border-radius: 4px; letter-spacing: 0.08em; text-transform: uppercase;
    flex-shrink: 0;
  }
  .widget-header.test-mode .test-mode-badge { display: inline-flex; align-items: center; gap: 5px; }
  .test-mode-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ffd84d; display: inline-block; animation: tmPulse 1.4s infinite ease-in-out; }
  @keyframes tmPulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

  .logo-text {
    font-size: 16px; font-weight: 700; color: #ffffff;
    letter-spacing: 0.01em; white-space: nowrap;
  }
  .logo-text .logo-acorn { font-weight: 300; }
  .logo-text .logo-detect { font-weight: 700; }

  /* Confidential session badge — centered in header */
  .confidential-badge {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    color: rgba(255,255,255,0.80);
    font-weight: 500;
    letter-spacing: 0.01em;
    min-width: 0;
    overflow: hidden;
  }
  .confidential-badge-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #3db870; flex-shrink: 0;
    animation: confPulse 2.5s infinite ease-in-out;
  }
  @keyframes confPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
  .confidential-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .widget-header.test-mode .confidential-badge { color: rgba(255,255,255,0.5); }

  /* Legacy divider / subtitle kept for any JS that references them */
  .header-divider { display: none; }
  .header-subtitle { display: none; }
  .privacy-badge { display: none; }

  /* Help button */
  .help-btn {
    background: none; border: 1.5px solid #c5e8ea; border-radius: 7px;
    color: #8ecbce; font-family: 'Geist', sans-serif; font-size: 12px;
    font-weight: 600; padding: 6px 14px; cursor: pointer; flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
    display: flex; align-items: center; gap: 5px;
  }
  .help-btn:hover { border-color: #7ec0c4; background: #eff8f9; }

  /* Byline bar (keep but restyle subtly) */
  .byline-bar {
    background: #f9f8f5;
    border-bottom: 1px solid #e8e4dc;
    padding: 7px 20px;
    font-size: 11px;
    color: #8a8a82;
    line-height: 1.45;
    text-align: center;
    letter-spacing: 0.01em;
    flex-shrink: 0;
  }

  /* ── PROGRESS STEPPER ────────────────────────────────────────────── */
  .progress-stepper {
    display: none;
    align-items: center;
    gap: 0;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e8e4dc;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .progress-stepper.visible { display: flex; }
  .ps-step {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    font-size: 13px; color: #b0b0a8; font-weight: 500;
    cursor: pointer; border-radius: 6px; padding: 3px 5px; margin: -3px -5px;
    transition: background 0.15s;
  }
  .ps-step:hover { background: rgba(0,0,0,0.04); }
  .ps-step.active { color: #1a1a18; cursor: default; }
  .ps-step.active:hover { background: none; }
  .ps-step.done { color: #7ec0c4; }

  /* ── STEP SKIP WARNING MODAL ────────────────────────────────────── */
  .step-skip-overlay {
    display: none; position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.38); align-items: center; justify-content: center;
  }
  .step-skip-overlay.open { display: flex; }
  .step-skip-box {
    background: #fff; border-radius: 14px; padding: 28px 28px 22px;
    max-width: 400px; width: calc(100% - 40px); box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  }
  .step-skip-icon { font-size: 28px; margin-bottom: 10px; }
  .step-skip-box h3 { font-family: 'Geist',sans-serif; font-size: 16px; font-weight: 700; margin: 0 0 10px; color: #1a1a18; }
  .step-skip-box p { font-family: 'Geist',sans-serif; font-size: 13px; color: #555; line-height: 1.55; margin: 0 0 20px; }
  .step-skip-actions { display: flex; gap: 10px; justify-content: flex-end; }
  .step-skip-cancel {
    background: none; border: 1.5px solid #d0d0c8; border-radius: 8px;
    font-family: 'Geist',sans-serif; font-size: 13px; font-weight: 600;
    padding: 8px 18px; cursor: pointer; color: #666;
  }
  .step-skip-cancel:hover { border-color: #999; }
  .step-skip-confirm {
    background: #c85a14; color: #fff; border: none; border-radius: 8px;
    font-family: 'Geist',sans-serif; font-size: 13px; font-weight: 700;
    padding: 8px 18px; cursor: pointer;
  }
  .step-skip-confirm:hover { background: #a04510; }
  .ps-num {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    background: #e8e4dc; color: #b0b0a8;
  }
  .ps-step.active .ps-num { background: #1a1a18; color: #fff; }
  .ps-step.done .ps-num { background: #7ec0c4; color: #fff; }

  /* Finding-level colouring — overrides .done teal */
  .ps-step.found-clear .ps-num  { background: #7ec0c4; color: #fff; }
  .ps-step.found-clear           { color: #7ec0c4; }
  .ps-step.found-medium .ps-num { background: #d48b0a; color: #fff; }
  .ps-step.found-medium          { color: #a06010; }
  .ps-step.found-high .ps-num,
  .ps-step.found-critical .ps-num { background: #c0392b; color: #fff; }
  .ps-step.found-high,
  .ps-step.found-critical        { color: #c0392b; }

  .ps-label { white-space: nowrap; }
  .ps-connector {
    flex: 1; min-width: 10px; height: 1px;
    background: #e8e4dc; flex-shrink: 0; margin: 0 3px;
  }
  .ps-actions {
    margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  }
  .ps-pause-btn {
    background: none; border: 1.5px solid #c5e8ea; border-radius: 6px;
    color: #9acfd2; font-family: 'Geist', sans-serif; font-size: 11px;
    font-weight: 600; padding: 4px 10px; cursor: pointer;
    transition: border-color 0.15s;
  }
  .ps-pause-btn:hover { border-color: #7ec0c4; }
  .ps-save-btn {
    background: none; border: 1.5px solid #c85a14; border-radius: 6px;
    color: #c85a14; font-family: 'Geist', sans-serif; font-size: 11px;
    font-weight: 600; padding: 4px 10px; cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
  }
  .ps-save-btn:hover { border-color: #a04510; color: #a04510; }
  .ps-save-btn:disabled { opacity: 0.55; cursor: default; }

  /* ── RESUME BANNER ────────────────────────────────────────────────── */
  .resume-banner {
    background: #fffbf5; border: 1.5px solid #f0c98c; border-radius: 12px;
    padding: 14px 16px; margin-bottom: 16px;
  }
  .resume-banner-row {
    display: flex; align-items: center; gap: 12px;
  }
  .resume-icon {
    font-size: 22px; color: #c85a14; flex-shrink: 0;
  }
  .resume-info {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
  }
  .resume-info strong { font-size: 14px; color: #2a2a2a; font-family: 'Geist', sans-serif; font-weight: 700; }
  .resume-info span { font-size: 12px; color: #777; font-family: 'Geist', sans-serif; }
  .resume-btn {
    background: #c85a14; color: #fff; border: none; border-radius: 8px;
    font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 700;
    padding: 8px 18px; cursor: pointer; flex-shrink: 0;
    transition: background 0.15s;
  }
  .resume-btn:hover { background: #a04510; }
  .resume-fresh-btn {
    background: none; border: none; color: #999; font-family: 'Geist', sans-serif;
    font-size: 12px; cursor: pointer; margin-top: 8px; padding: 0;
    text-decoration: underline; display: block; text-align: right;
  }
  .resume-fresh-btn:hover { color: #555; }

  /* ── CHAT AREA ────────────────────────────────────────────────────── */
  .chat-area {
    background: #f9f8f5;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #c5e8ea transparent;
  }
  .chat-area::-webkit-scrollbar { width: 3px; }
  .chat-area::-webkit-scrollbar-thumb { background: #bde5e7; border-radius: 3px; }

  /* Date separator */
  .date-separator {
    display: flex; align-items: center; gap: 12px;
    font-size: 10.5px; font-weight: 700; color: #b0b0a8;
    letter-spacing: 0.08em; text-transform: uppercase;
    margin: 4px 0;
  }
  .date-separator::before, .date-separator::after {
    content: ''; flex: 1; height: 1px; background: #e8e4dc;
  }

  /* ── MESSAGES ────────────────────────────────────────────────────── */
  .message { display: flex; gap: 10px; align-items: flex-start; animation: fadeUp 0.25s ease forwards; opacity: 0; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  .message.user { flex-direction: row-reverse; }

  /* Circular avatar */
  .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    letter-spacing: 0.01em; position: relative;
  }
  .avatar.ai {
    background: #e4f4f5; border: 2px solid #7ec0c4;
    color: #3d9ea3;
  }
  .avatar.ai::after {
    content: ''; position: absolute; bottom: 1px; right: 1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--myrtle-status-dot, #3db870); border: 1.5px solid #3d9ea3;
  }
  .avatar.user { background: #9acfd2; color: #fff; }

  /* Message column: meta + bubble */
  .msg-col {
    display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 76%;
  }
  .message.user .msg-col { align-items: flex-end; }
  .msg-meta {
    font-size: 11px; color: #b0b0a8; font-weight: 500;
    display: flex; align-items: center; gap: 6px;
  }
  .msg-meta-name { color: #5a5a52; font-weight: 600; }

  .bubble {
    padding: 12px 16px; border-radius: 14px;
    font-size: 14.5px; line-height: 1.65; color: #0c2428;
  }
  .message.ai .bubble {
    background: #ffffff; border: 1px solid #e8e4dc;
    border-top-left-radius: 3px;
  }
  .message.user .bubble {
    background: #3d9ea3; color: #fff;
    border-top-right-radius: 3px;
  }

  .bubble-with-image { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; max-width: 76%; }
  .bubble-image-thumb { border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,0.2); max-width: 240px; cursor: zoom-in; background: #000; }
  .bubble-image-thumb img { display: block; width: 100%; height: auto; max-height: 160px; object-fit: cover; }
  .bubble-image-label { font-size: 10px; color: rgba(255,255,255,0.45); text-align: right; }
  .bubble-text-after { background: #3d9ea3; color: #fff; padding: 10px 14px; border-radius: 12px; border-top-right-radius: 3px; font-size: 14.5px; line-height: 1.6; max-width: 240px; }
  .video-guide-btn { display: inline-flex; align-items: center; gap: 11px; margin-top: 10px; background: #e4f4f5; border: 1px solid #b5e0e2; border-radius: 11px; padding: 11px 20px; font-size: 19px; font-weight: 600; color: #7ec0c4; text-decoration: none; cursor: pointer; transition: background 0.15s; }
  .video-guide-btn:hover { background: #d2ecee; }

  /* ── QUICK REPLY BUTTONS ─────────────────────────────────────────── */
  .quick-replies {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding-left: 44px; /* align under avatar */
    animation: fadeUp 0.3s ease forwards; opacity: 0;
  }
  .qr-btn {
    border-radius: 20px; font-family: 'Geist', sans-serif;
    font-size: 13px; font-weight: 600; padding: 8px 16px;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
  }
  .qr-btn:active { transform: scale(0.97); }
  .qr-btn.primary {
    background: #3d9ea3; color: #fff; border: none;
  }
  .qr-btn.primary:hover { background: #53aab0; }
  .qr-btn.outline {
    background: #fff; color: #1a1a18;
    border: 1.5px solid #c5e8ea;
  }
  .qr-btn.outline:hover { border-color: #7ec0c4; background: #eff8f9; }
  .qr-btn.danger {
    background: #fff; color: #b03020;
    border: 1.5px solid #f0c4bf;
  }
  .qr-btn.danger:hover { border-color: #b03020; background: #fdecea; }

  /* ── TYPING INDICATOR ────────────────────────────────────────────── */
  .typing-indicator { display: flex; gap: 10px; align-items: flex-start; animation: fadeUp 0.25s ease forwards; }
  .typing-dots {
    background: #ffffff; border: 1px solid #e8e4dc;
    border-radius: 14px; border-top-left-radius: 3px;
    padding: 13px 17px; display: flex; gap: 5px; align-items: center;
  }
  .dot { width: 6px; height: 6px; background: #c5e8ea; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; }
  .dot:nth-child(2) { animation-delay: 0.2s; }
  .dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-5px); opacity: 1; } }
  .stream-cursor { display: inline-block; width: 2px; height: 0.85em; background: #a8d9db; margin-left: 2px; vertical-align: text-bottom; animation: scBlink 0.8s step-end infinite; }
  @keyframes scBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

  /* ── CAMERA PANEL ────────────────────────────────────────────────── */
  .camera-panel { background: #0a1618; border-left: 1px solid #080f0e; border-right: 1px solid #080f0e; max-height: 0; overflow: hidden; transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0; }
  .camera-panel.open { max-height: 710px; }
  .camera-panel-inner { padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
  .camera-topbar { display: flex; align-items: center; justify-content: space-between; }
  .camera-topbar-left { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.5); letter-spacing: 0.02em; }
  .camera-close-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: rgba(255,255,255,0.4); width: 26px; height: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
  .camera-close-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.65); }
  .camera-content { display: flex; gap: 12px; height: 540px; }
  .camera-live-pane { flex: 1; position: relative; border-radius: 10px; overflow: hidden; background: #000; min-width: 0; }
  #cameraVideo { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); transform-origin: center center; transition: transform 0.1s; }
  #cameraVideo.no-mirror { transform: scaleX(1); }

  /* Guide frame — portrait oriented to match phone screen held vertically */
  .phone-guide-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
  .phone-guide-frame { width: 240px; height: 400px; border: 1.5px dashed rgba(255,255,255,0.22); border-radius: 14px; box-shadow: 0 0 0 2000px rgba(0,0,0,0.12); position: relative; }
  .phone-guide-corner { position: absolute; width: 20px; height: 20px; border-color: rgba(255,255,255,0.5); border-style: solid; }
  .phone-guide-corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
  .phone-guide-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; border-radius: 0 3px 0 0; }
  .phone-guide-corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; border-radius: 0 0 0 3px; }
  .phone-guide-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }
  .phone-guide-label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: rgba(255,255,255,0.3); white-space: nowrap; letter-spacing: 0.05em; font-family: 'Geist', sans-serif; }

  .capture-btn { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: #7ec0c4; border: none; border-radius: 8px; color: #fff; font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 600; padding: 9px 22px; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: background 0.15s, transform 0.1s; white-space: nowrap; letter-spacing: 0.01em; z-index: 2; }
  .capture-btn:hover { background: #7ec0c4; }
  .capture-btn:active { transform: translateX(-50%) scale(0.96); }

  /* Zoom controls */
  .zoom-bar { display: flex; align-items: center; gap: 8px; padding: 2px 2px; }
  .zoom-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); border-radius: 5px; color: rgba(255,255,255,0.6); width: 26px; height: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; transition: background 0.12s; flex-shrink: 0; font-family: monospace; }
  .zoom-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
  .zoom-label { font-size: 10px; color: rgba(255,255,255,0.35); min-width: 28px; text-align: center; font-family: 'Geist', sans-serif; }
  #zoomSlider { flex: 1; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.15); outline: none; cursor: pointer; }
  #zoomSlider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #7ec0c4; cursor: pointer; border: 2px solid rgba(255,255,255,0.4); }
  #zoomSlider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #7ec0c4; cursor: pointer; border: 2px solid rgba(255,255,255,0.4); }

  /* Preview pane */
  .camera-preview-pane { flex: 1; display: none; position: relative; border-radius: 10px; overflow: hidden; background: #000; min-width: 0; }
  .camera-preview-pane.active { display: block; }
  #capturePreviewImg { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.2s ease; }
  .preview-actions { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.8)); padding: 28px 10px 10px; display: flex; gap: 7px; }
  .preview-btn { flex: 1; border: none; border-radius: 7px; font-family: 'Geist', sans-serif; font-size: 12.5px; font-weight: 600; padding: 8px 10px; cursor: pointer; }
  .preview-btn.retake { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.18); }
  .preview-btn.rotate { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); flex: 0 0 auto; padding: 8px 12px; }
  .preview-btn.use { background: #7ec0c4; color: #fff; }

  /* Camera sidebar */
  .camera-sidebar { width: 138px; flex-shrink: 0; display: flex; flex-direction: column; gap: 9px; }
  .cam-tip { font-size: 10.5px; color: rgba(255,255,255,0.3); line-height: 1.55; }
  .cam-tip strong { color: rgba(255,255,255,0.48); }
  .cam-quality-badge { background: rgba(45,125,114,0.25); border: 1px solid rgba(45,125,114,0.4); border-radius: 5px; padding: 5px 8px; font-size: 10px; color: rgba(255,255,255,0.45); line-height: 1.5; }
  .cam-privacy { font-size: 9.5px; color: rgba(255,255,255,0.18); line-height: 1.5; margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.05); }

  /* ── VIDEO MODAL ──────────────────────────────────────────────────── */
  .video-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(5,20,18,0.92); z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
  .video-modal-overlay.open { display: flex; }
  .video-modal-box { width: 100%; max-width: 780px; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 20px 80px rgba(0,0,0,0.6); position: relative; aspect-ratio: 16/9; }
  .video-modal-close { position: absolute; top: -40px; right: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 7px; color: rgba(255,255,255,0.7); font-size: 18px; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; z-index: 1; }
  .video-modal-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
  .video-modal-box iframe { width: 100%; height: 100%; border: none; display: block; }

  /* ── INPUT AREA ───────────────────────────────────────────────────── */
  .input-area {
    background: #ffffff;
    border-top: 2px solid #3d9ea3;
    box-shadow: 0 -3px 12px rgba(26,92,83,0.08);
    padding: 12px 16px 14px;
    flex-shrink: 0;
  }
  .attachment-strip { display: none; align-items: center; gap: 10px; background: #e4f4f5; border: 1px solid #b5e0e2; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
  .attachment-strip.visible { display: flex; }
  .attachment-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid #b5e0e2; flex-shrink: 0; cursor: zoom-in; }
  .attachment-info { flex: 1; min-width: 0; }
  .attachment-title { font-size: 12px; font-weight: 600; color: #1f6b72; }
  .attachment-sub { font-size: 11px; color: #9acfd2; margin-top: 1px; }
  .attachment-remove { background: none; border: none; color: #a8d9db; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
  .attachment-remove:hover { color: #b03020; background: #fdecea; }

  /* Input row: textarea-wrap + camera + mic inline */
  .input-main-row { display: flex; gap: 8px; align-items: stretch; }
  .textarea-wrap {
    flex: 1; background: #fff; border: 2px solid #7ec0c4;
    border-radius: 22px; padding: 10px 14px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; gap: 8px;
    min-height: 44px;
  }
  .textarea-wrap:focus-within { border-color: #3d9ea3; box-shadow: 0 0 0 3px rgba(126,192,196,0.12); background: #fff; }

  /* WCAG 2.1 AA — visible keyboard focus ring for all interactive elements */
  :focus-visible { outline: 2px solid #7ec0c4; outline-offset: 2px; border-radius: 4px; }
  button:focus-visible { border-radius: 8px; }
  input[type="checkbox"]:focus-visible { border-radius: 3px; }
  .ps-step:focus-visible { border-radius: 8px; }
  textarea {
    flex: 1; border: none; background: transparent;
    font-family: 'Geist', sans-serif; font-size: 14.5px; color: #1a1a18;
    resize: none; outline: none; line-height: 1.5; max-height: 130px; min-height: 24px;
  }
  textarea::placeholder { color: #b0b0a8; }

  /* Inline send button inside textarea-wrap */
  .send-btn {
    width: 34px; height: 34px; background: #e8e4dc; border: none;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background 0.15s; flex-shrink: 0;
  }
  .send-btn:hover { background: #3d9ea3; }
  .send-btn:hover svg path { stroke: #fff; }
  .send-btn:active { transform: scale(0.93); }
  .send-btn:disabled { background: #e8e4dc; cursor: not-allowed; opacity: 0.5; }

  /* Camera & mic: compact round buttons beside textarea */
  .camera-cta-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex-shrink: 0;
    background: #3d9ea3; border: 2px solid #3d9ea3;
    border-radius: 50%; color: #fff;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
    position: relative;
  }
  .camera-cta-btn:hover { background: #7ec0c4; border-color: #7ec0c4; }
  .camera-cta-btn:active { transform: scale(0.97); }
  .camera-cta-btn.cam-active { background: #0a1618; border-color: #0a1618; color: #fff; }
  .camera-cta-btn.has-image { background: #53aab0; border-color: #53aab0; color: #fff; }
  .camera-cta-btn svg { flex-shrink: 0; }
  .camera-cta-label { display: none; }
  .camera-cta-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #5ecece; border: 1.5px solid #fff; display: none; }
  .camera-cta-btn.has-image .camera-cta-dot { display: block; }

  .mic-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex-shrink: 0;
    background: #3d9ea3; border: 2px solid #3d9ea3;
    border-radius: 50%; color: #fff;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
  }
  .mic-btn:hover { background: #7ec0c4; border-color: #7ec0c4; }
  .mic-btn:active { transform: scale(0.97); }
  .mic-btn.recording {
    background: #c0392b; border-color: #c0392b; color: #fff;
    /* --stt-level (0–1) set by JS; drives breathing glow proportional to voice volume */
    box-shadow:
      0 0 0 calc(var(--stt-level, 0) * 8px + 3px) rgba(192,57,43,0.35),
      0 0 0 calc(var(--stt-level, 0) * 16px + 6px) rgba(192,57,43,0.12);
    transition: box-shadow 0.12s ease-out;
    animation: none;
  }
  .mic-btn.recording:hover { background: #a93226; }
  .mic-btn:disabled { background: #f0f0f0; border-color: #e0e0e0; color: #c0c0c0; cursor: not-allowed; animation: none; }
  .mic-btn svg { flex-shrink: 0; }
  .mic-btn-label { display: none; }
  .mic-dot {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #ff6b6b; border: 1.5px solid #fff;
    display: none;
  }
  .mic-btn.recording .mic-dot { display: block; }
  textarea.listening { border-color: #c0392b !important; background: #fff9f9 !important; }

  .footer-note { text-align: center; font-size: 10.5px; color: #7a7a72; margin-top: 10px; line-height: 1.5; }
  .footer-disclaimer { text-align: center; font-size: 10.5px; color: #7a7a72; margin-top: 5px; line-height: 1.5; border-top: 1px solid #e8e4dc; padding-top: 7px; }
  .footer-disclaimer a { color: #7ec0c4; text-decoration: none; }
  .footer-disclaimer a:hover { text-decoration: underline; }

  /* ── EMERGENCY BAR ────────────────────────────────────────────────── */
  .emergency-bar {
    background: #fef8ec; border: 1px solid #e8c96e;
    border-radius: 8px; padding: 8px 14px;
    font-size: 12.5px; color: #6b4f00; line-height: 1.5;
    margin-bottom: 10px; flex-shrink: 0;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    justify-content: center;
  }
  .emergency-bar-text { flex: 1; min-width: 160px; text-align: center; }
  .emergency-bar-dv { display: block; width: 100%; text-align: center; font-size: 12px; font-weight: 600; color: #6b4f00; margin-top: 3px; }
  .crisis-lines-btn {
    background: none; border: 1.5px solid #c8a830; border-radius: 6px;
    color: #7a5800; font-family: 'Geist', sans-serif; font-size: 11.5px;
    font-weight: 700; padding: 4px 12px; cursor: pointer; flex-shrink: 0;
    transition: background 0.15s;
  }
  .crisis-lines-btn:hover { background: #fef3de; }

  /* ── DSA REPORT CARD ──────────────────────────────────────────────── */
  .dsa-report-card { background: #eff8f9; border: 1px solid #c5e8ea; border-radius: 12px; overflow: hidden; margin-top: 4px; animation: fadeUp 0.3s ease forwards; opacity: 0; }
  .card-left-LOW { border-left: 5px solid #53aab0; }
  .card-left-MEDIUM { border-left: 5px solid #c07a10; }
  .card-left-HIGH { border-left: 5px solid #b03020; }
  .card-left-CRITICAL { border-left: 5px solid #7b0e0e; }
  .report-header { padding: 14px 18px 12px; border-bottom: 1px solid #c5e8ea; display: flex; align-items: center; gap: 12px; background: #e4f4f5; }
  .report-title { font-size: 13px; font-weight: 700; color: #1f6b72; }
  .report-subtitle { font-size: 11px; color: #9acfd2; margin-top: 1px; }
  .risk-level-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; margin-left: auto; letter-spacing: 0.06em; text-transform: uppercase; flex-shrink: 0; }
  .risk-dot { width: 7px; height: 7px; border-radius: 50%; }
  .badge-LOW { background: #e4f4f5; color: #7ec0c4; } .badge-LOW .risk-dot { background: #53aab0; }
  .badge-MEDIUM { background: #fdf3e3; color: #c07a10; } .badge-MEDIUM .risk-dot { background: #c07a10; }
  .badge-HIGH { background: #fdecea; color: #b03020; } .badge-HIGH .risk-dot { background: #b03020; }
  .badge-CRITICAL { background: #fce8e8; color: #7b0e0e; } .badge-CRITICAL .risk-dot { background: #7b0e0e; }
  .report-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
  .report-section h4 { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #9acfd2; margin-bottom: 6px; font-weight: 700; }
  .report-section p { font-size: 13.5px; color: #0c2428; line-height: 1.65; }
  .report-section ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }
  .report-section ul li { font-size: 13px; color: #1f6b72; line-height: 1.55; padding: 7px 11px 7px 22px; background: #fff; border: 1px solid #c5e8ea; border-radius: 7px; position: relative; }
  .report-section ul li::before { content: ''; position: absolute; left: 9px; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: #53aab0; }
  .report-divider { border: none; border-top: 1px solid #c5e8ea; margin: 0; }
  .referral-block { background: #fff; border: 1px solid #c5e8ea; border-radius: 7px; padding: 10px 13px; font-size: 13px; color: #0c2428; line-height: 1.6; }
  .referral-block + .referral-block { margin-top: 6px; }
  .referral-block strong { color: #7ec0c4; font-weight: 600; }
  .referral-block a { color: #53aab0; }
  .safety-note-block { background: #fffbf0; border: 1px solid #e8c96e; border-radius: 7px; padding: 10px 13px; font-size: 13px; color: #6b4f00; line-height: 1.6; }
  .footer-always { font-size: 12px; color: #9acfd2; line-height: 1.6; padding-top: 4px; border-top: 1px solid #c5e8ea; }
  .report-card-wrap { padding-left: 44px; }

  /* ── DOWNLOAD WARNING MODAL ───────────────────────────────────────── */
  .dl-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.55); align-items: center; justify-content: center;
    padding: 16px;
  }
  .dl-modal-overlay.open { display: flex; }
  .dl-modal {
    background: #fff; border-radius: 14px; max-width: 480px; width: 100%;
    box-shadow: 0 16px 64px rgba(0,0,0,0.22); overflow: hidden;
  }
  .dl-modal-hdr {
    background: #fffbf0; border-bottom: 1px solid #e8c96e;
    padding: 16px 20px; display: flex; align-items: center; gap: 10px;
  }
  .dl-modal-hdr-icon { font-size: 20px; flex-shrink: 0; }
  .dl-modal-hdr-title { font-size: 14px; font-weight: 700; color: #6b4f00; }
  .dl-modal-body { padding: 18px 20px; }
  .dl-modal-body p { font-size: 13.5px; color: #0c2428; line-height: 1.65; margin-bottom: 12px; }
  .dl-modal-body p:last-child { margin-bottom: 0; }
  .dl-modal-body strong { color: #1f6b72; }
  .dl-modal-actions { padding: 14px 20px 18px; display: flex; gap: 10px; flex-direction: column; }
  .dl-modal-confirm {
    background: #1f6b72; color: #fff; border: none; border-radius: 8px;
    font-family: 'Geist', sans-serif; font-size: 13.5px; font-weight: 600;
    padding: 11px 18px; cursor: pointer; transition: background 0.15s;
  }
  .dl-modal-confirm:hover { background: #53aab0; }
  .dl-modal-cancel {
    background: none; color: #9acfd2; border: 1.5px solid #c5e8ea;
    border-radius: 8px; font-family: 'Geist', sans-serif; font-size: 13px;
    font-weight: 500; padding: 9px 18px; cursor: pointer; transition: background 0.15s;
  }
  .dl-modal-cancel:hover { background: #eff8f9; }

  /* ── OTHER APPS MODAL ────────────────────────────────────────────── */
  .other-apps-modal {
    background: #fff; border-radius: 14px; max-width: 520px; width: 100%;
    box-shadow: 0 16px 64px rgba(0,0,0,0.22); overflow: hidden;
    max-height: 85vh; display: flex; flex-direction: column;
  }
  .other-apps-modal-hdr {
    background: #eff8f9; border-bottom: 1px solid #c5e8ea;
    padding: 14px 18px; display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 700; color: #0c2428; flex-shrink: 0;
  }
  .other-apps-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
  .other-apps-section-label {
    font-size: 11px; font-weight: 700; color: #5a8080; text-transform: uppercase;
    letter-spacing: 0.06em; margin: 0 0 8px;
  }
  .other-apps-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .other-app-chip {
    background: #f8f7f4; border: 1.5px solid #ddd; border-radius: 10px;
    padding: 10px 12px; cursor: pointer; text-align: left;
    font-family: 'Geist', sans-serif; transition: all 0.15s;
  }
  .other-app-chip strong { font-size: 13px; color: #0c2428; display: block; margin-bottom: 2px; }
  .other-app-chip span { font-size: 11px; color: #6a8080; }
  .other-app-chip:hover { border-color: #7ec0c4; background: #eff8f9; }
  .other-app-chip.selected { border-color: #3d9ea3; background: #e8f5f6; }
  .other-app-chip.selected strong { color: #3d9ea3; }
  .other-apps-modal-ftr {
    padding: 14px 20px; border-top: 1px solid #e8e8e0; display: flex;
    align-items: center; justify-content: flex-end; gap: 10px; flex-shrink: 0;
  }
  @media (max-width: 480px) { .other-apps-chips { grid-template-columns: 1fr; } }

  /* ── DOWNLOAD BUTTON ──────────────────────────────────────────────── */
  .download-report-btn { display: flex; align-items: center; gap: 9px; background: #1f6b72; border: none; border-radius: 8px; color: #fff; font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 600; padding: 10px 18px; cursor: pointer; transition: background 0.15s, transform 0.1s; width: 100%; justify-content: center; margin-top: 4px; }
  .download-report-btn:hover { background: #53aab0; }
  .download-report-btn:active { transform: scale(0.98); }
  .download-report-btn:disabled { background: #9acfd2; cursor: not-allowed; }
  .download-report-btn svg { flex-shrink: 0; }
  .download-report-btn .btn-sub { font-size: 10.5px; font-weight: 400; opacity: 0.7; }

  /* ── LIGHTBOX ─────────────────────────────────────────────────────── */
  .lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
  .lightbox.open { display: flex; }
  .lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }
  .lightbox-close { position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; color: #fff; font-size: 20px; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

  /* ═══════════════════════════════════════════════════════════════════
     ACKNOWLEDGEMENT / WELCOME PAGE
  ═══════════════════════════════════════════════════════════════════ */
  #langPage {
    position: fixed; inset: 0; z-index: 9000;
    background: #f5f3ef;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 16px; overflow-y: auto;
    transition: opacity 0.35s ease;
  }
  #langPage.hidden { opacity: 0; pointer-events: none; }

  .lang-card {
    background: #f5f3ef; border-radius: 0;
    width: 100%; max-width: 1026px;
    box-shadow: none; overflow: visible;
  }

  /* Header: dark teal bar matching screenshot */
  .lang-hdr {
    background: #3d9ea3; border-radius: 0;
    padding: 18px 24px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .lang-hdr img { height: 30px; width: auto; filter: brightness(0) invert(1); }
  .lang-hdr-logo-text { display: none; }
  .lang-hdr-quick-exit {
    background: #c85a14; color: #fff; border: none; border-radius: 8px;
    font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 9px 16px; cursor: pointer; display: flex; align-items: center; gap: 7px;
    flex-shrink: 0; transition: background 0.15s;
  }
  .lang-hdr-quick-exit:hover { background: #a04510; }
  .lang-hdr-sub { display: none; }
  .lang-hdr-logo-text { display: none; }
  /* Show PNG logo in header, invert to white on teal background */
  .lang-hdr > img { display: block; height: 30px; width: auto; filter: brightness(0) invert(1); }
  /* Hide PNG logo in main chat header — not needed there */
  #acornLogo { display: none; filter: brightness(0) invert(1); }

  /* Welcome label + heading */
  .lang-welcome-label {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 11px; font-weight: 700; color: #3d9ea3;
    letter-spacing: 0.12em; text-transform: uppercase;
    margin-top: 12px; margin-bottom: 10px;
  }
  .lang-heading {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 30px; font-weight: 400; color: #1a1a18;
    line-height: 1.2; margin-bottom: 4px;
  }
  .lang-heading em {
    font-style: italic;
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 400;
    color: #3d9ea3;
  }
  .lang-intro {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 14px; color: #5a5a52; line-height: 1.7; margin-top: 14px;
  }

  /* Icon cards */
  .ack-cards {
    display: flex; flex-direction: column; gap: 5px; margin-top: 16px;
    padding-left: 6px;
  }
  .ack-card {
    display: flex; align-items: baseline; gap: 10px;
    padding: 1px 0;
  }
  .ack-card::before {
    content: '•'; color: #7ec0c4; font-size: 18px; flex-shrink: 0; line-height: 1.5;
  }
  .ack-card.amber::before { color: #c8a830; }
  .ack-card-icon { display: none; }
  .ack-card-text {
    font-size: 13px; color: #2e6b70; line-height: 1.6;
  }
  .ack-card.amber .ack-card-text { color: #6b4f00; }
  .ack-card-title {
    font-weight: 700; display: block; margin-bottom: 2px; font-size: 13px;
  }
  .ack-privacy-tip {
    font-size: 12.5px; color: #5a5a52; line-height: 1.6;
    margin-top: 14px; padding-top: 10px;
    border-top: 1px solid #e8e4dc;
  }

  /* Divider label */
  .setup-divider {
    font-size: 10px; font-weight: 700; color: #b0b0a8;
    letter-spacing: 0.12em; text-transform: uppercase;
    margin: 20px 0 12px;
  }

  /* Lang body / footer */
  .lang-body { padding: 10px 28px 8px; font-family: 'Newsreader', Georgia, serif; }
  .lang-footer { padding: 0 28px 28px; font-family: 'Newsreader', Georgia, serif; }

  /* Legacy title (hidden in favour of heading above, but keep ID for JS) */
  .lang-title { display: none; }

  /* Caseworker + toggle rows */
  .ack-body { margin-bottom: 0; }
  .ack-para { display: none; }
  .ack-list { display: none; }
  .ack-sub { display: none; }
  .ack-footer { border-top: none; padding-top: 0; }

  .toggle-block { margin-bottom: 12px; }
  /* Compact top 3 setup tiles (caseworker, language, TTS) — 6px gap between them */
  .ack-footer .toggle-block { margin-bottom: 6px; }
  .ack-footer > div:first-of-type { margin-bottom: 6px; }
  #manualLangRow { margin-bottom: 6px; }
  .toggle-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 10px;
    background: #fff; border: 1.5px solid #b8b4ac; cursor: pointer;
    transition: border-color 0.15s;
  }
  .toggle-row:hover { border-color: #7ec0c4; }
  .toggle-row.prominent { border-color: #7ec0c4; background: #fff; }
  .toggle-row-label { flex: 1; }
  .toggle-row-label strong { display: block; font-size: 13.5px; font-weight: 600; color: #0e1f1d; }
  .toggle-row-label span { font-size: 11.5px; color: #4a4a42; }
  .toggle-sw {
    width: 40px; height: 22px; border-radius: 11px; border: none;
    background: #d8d8d0; cursor: pointer; position: relative;
    transition: background 0.2s; flex-shrink: 0;
  }
  .toggle-sw::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .toggle-sw.on { background: #3d9ea3; }
  .toggle-sw.on::after { transform: translateX(18px); }

  /* Language row — clickable row showing current language */
  #manualLangRow { margin-bottom: 6px; }
  #manualLangRow {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 10px;
    background: #fff; border: 1.5px solid #b8b4ac; cursor: pointer;
    transition: border-color 0.15s;
  }
  #manualLangRow:hover { border-color: #3d9ea3; }
  .lang-row-icon { font-size: 16px; flex-shrink: 0; }
  .lang-row-label { flex: 1; }
  .lang-row-label strong { display: block; font-size: 13px; font-weight: 600; color: #0e1f1d; }
  .lang-row-label span { font-size: 11.5px; color: #4a4a42; }
  .lang-row-chevron {
    font-size: 14px; color: #5a5a52; flex-shrink: 0;
    transition: transform 0.2s;
  }

  /* Continue button — amber */
  .ack-btn {
    width: 100%; padding: 15px; margin-top: 16px;
    background: #c85a14; color: #fff; border: none;
    border-radius: 12px; font-family: 'Newsreader', Georgia, serif;
    font-size: 16px; font-weight: 700;
    cursor: pointer; letter-spacing: 0.02em;
    transition: background 0.15s, transform 0.1s;
  }
  .ack-btn:hover { background: #b04e10; }
  .ack-btn:active { transform: scale(0.98); }
  .ack-btn:disabled { background: #d8c4b8; cursor: not-allowed; transform: none; }
  .ack-legal {
    font-size: 10.5px; color: #6b6b63; text-align: center; margin: 10px 0 0;
    line-height: 1.55;
  }

  /* Checkbox row */
  .ack-check-row {
    display: flex; align-items: center; gap: 12px; margin: 14px 0 10px;
    padding: 12px 14px; border-radius: 10px;
    border: 1.5px solid #e8c96e; background: #fef8ec;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
  }
  .ack-check-row:hover { border-color: #c8a830; background: #fef3de; }
  .ack-check-row input[type=checkbox] {
    width: 18px; height: 18px; flex-shrink: 0; accent-color: #3d9ea3;
    cursor: pointer; margin: 0;
  }
  .ack-check-row label { font-size: 13px; color: #5a4a18; line-height: 1.5; cursor: pointer; margin: 0; }

  /* Mobile warning banner */
  .mobile-banner {
    background: #fff2f2; border: 2px solid #e05555;
    border-radius: 10px; padding: 14px 16px; margin-bottom: 18px;
  }
  .mobile-banner-title {
    font-size: 13.5px; font-weight: 700; color: #b52222;
    display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  }
  .mobile-banner-body { font-size: 13px; color: #7a2020; line-height: 1.6; }
  .mobile-banner-body p { margin: 0 0 7px; }
  .mobile-banner-body p:last-child { margin-bottom: 0; }
  .mobile-banner-alt {
    display: inline-block; margin-top: 10px;
    font-size: 12px; color: #b52222; text-decoration: underline;
    cursor: pointer; background: none; border: none;
    font-family: 'Geist', sans-serif; padding: 0;
  }
  .mobile-banner-alt:hover { color: #7a2020; }

  /* Lang select page */
  #langSelectPage { position: fixed; inset: 0; z-index: 9100; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; padding: 16px; }
  #langSelectPage.visible { display: flex; }
  .lsp-card { background: #fff; border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.12); overflow: hidden; width: 100%; max-width: 660px; max-height: 90vh; display: flex; flex-direction: column; }
  .lsp-hdr { background: #3d9ea3; padding: 16px 24px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
  .lsp-back { background: rgba(255,255,255,0.18); border: none; border-radius: 8px; color: #fff; padding: 6px 12px; font-family: inherit; font-size: 13px; cursor: pointer; }
  .lsp-back:hover { background: rgba(255,255,255,0.28); }
  .lsp-hdr-title { color: #fff; font-size: 16px; font-weight: 700; }
  .lsp-body { padding: 20px 24px 24px; overflow-y: auto; }
  .lsp-sub { font-size: 12px; color: #8a8a82; text-align: center; margin-bottom: 16px; }
  .lsp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .lsp-btn { background: #f9f8f5; border: 1.5px solid #e8e4dc; border-radius: 10px; padding: 12px 10px; cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; font-family: inherit; width: 100%; }
  .lsp-btn:hover { border-color: #3d9ea3; background: #eff8f9; }
  .lsp-btn.selected { border-color: #3d9ea3; background: #e8f5f6; }
  .lsp-btn .lb-main { display: block; font-size: 15px; font-weight: 700; color: #1a1a18; }
  .lsp-btn .lb-sub { display: block; font-size: 11px; color: #8a8a82; margin-top: 2px; }
  @media(max-width:500px){ .lsp-grid{ grid-template-columns: 1fr 1fr; } }

  /* Caseworker row (legacy selector styles kept for compatibility) */
  .caseworker-row { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid #d8eeef; margin-top: 4px; }
  .caseworker-toggle { width: 36px; height: 20px; background: #c5e8ea; border: none; border-radius: 10px; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
  .caseworker-toggle.on { background: #3d9ea3; }
  .caseworker-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
  .caseworker-toggle.on::after { transform: translateX(16px); }
  .caseworker-label { font-size: 11.5px; color: #8ecbce; }

  /* ── Panic / Quick Exit button ── */
  .panic-btn {
    background: #c85a14; border: none; border-radius: 7px;
    color: #fff; font-family: 'Geist', sans-serif; font-size: 11px;
    font-weight: 700; padding: 8px 14px; cursor: pointer;
    letter-spacing: 0.05em; flex-shrink: 0;
    display: flex; align-items: center; gap: 5px;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 0 0 2px rgba(192,57,43,0.3);
    animation: panic-pulse 3s infinite;
    margin-left: 0;
  }
  .panic-btn:hover { background: #a93226; transform: scale(1.04); }
  .panic-btn:active { transform: scale(0.97); }
  @keyframes panic-pulse {
    0%,80%,100% { box-shadow: 0 0 0 2px rgba(192,57,43,0.3); }
    40% { box-shadow: 0 0 0 5px rgba(192,57,43,0.0); }
  }

  /* ── Session timeout warning ── */
  .timeout-bar {
    background: #fff3cd; border-bottom: 1px solid #ffc107;
    padding: 7px 20px; font-size: 11.5px; color: #856404;
    text-align: center; flex-shrink: 0; display: none;
    align-items: center; justify-content: center; gap: 10px;
  }
  .timeout-bar.visible { display: flex; }
  .timeout-extend {
    background: #856404; color: #fff; border: none;
    border-radius: 5px; padding: 3px 10px; font-size: 11px;
    font-family: 'Geist',sans-serif; cursor: pointer; font-weight: 600;
  }

  /* ── Concern selector (IBA pathway) ── */
  .concern-selector { background: #eff8f9; border: 1.5px solid #c5e8ea; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
  .concern-label { font-size: 12px; color: #8ecbce; font-weight: 600; margin-bottom: 8px; display: block; }
  .concern-btn { display: flex; align-items: center; gap: 8px; width: 100%; background: #fff; border: 1.5px solid #c5e8ea; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; font-family: 'Geist',sans-serif; font-size: 13px; color: #0c2428; text-align: left; transition: border-color 0.15s, background 0.15s; }
  .concern-btn:last-child { margin-bottom: 0; }
  .concern-btn:hover { border-color: #3d9ea3; background: #e4f4f5; }
  .concern-btn-icon { font-size: 16px; flex-shrink: 0; }

  /* ── EVIDENCE BADGE ── */
  .evidence-badge {
    display: none; margin-left: 8px;
    background: rgba(126,192,196,0.12); border: 1px solid rgba(45,125,114,0.4);
    color: #a8d9db; font-size: 10px; font-weight: 700; padding: 3px 9px;
    border-radius: 4px; letter-spacing: 0.05em; cursor: pointer;
    align-items: center; gap: 5px; font-family: 'Geist',sans-serif;
    transition: background 0.15s;
  }
  .evidence-badge:hover { background: rgba(126,192,196,0.22); color: #7ec0c4; }
  .evidence-badge::before { content: '📸'; font-size: 11px; }

  .transcript-dl-btn {
    display: none; margin-left: 8px;
    background: rgba(45,125,114,0.10); border: 1px solid rgba(45,125,114,0.35);
    color: #a8d9db; font-size: 10px; font-weight: 700; padding: 3px 9px;
    border-radius: 4px; letter-spacing: 0.05em; cursor: pointer;
    align-items: center; gap: 5px; font-family: 'Geist',sans-serif;
    transition: background 0.15s;
  }
  .transcript-dl-btn:hover { background: rgba(126,192,196,0.22); color: #7ec0c4; }

  /* ── ABOUT BUTTON ── */
  .about-info-btn {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 8px;
    background: transparent;
    border: 1px solid rgba(120,110,95,0.3);
    color: #a09a8f; font-size: 10px; font-weight: 700; padding: 3px 9px;
    border-radius: 4px; letter-spacing: 0.05em; cursor: pointer;
    font-family: 'Geist', sans-serif;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .about-info-btn:hover { background: rgba(120,110,95,0.1); color: #6b6358; border-color: rgba(120,110,95,0.5); }

  /* ── ABOUT MODAL ── */
  .about-overlay {
    position: fixed; inset: 0; z-index: 2100;
    background: rgba(30,28,24,0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
  }
  .about-modal {
    background: #fff; border-radius: 14px;
    padding: 30px 28px 24px;
    max-width: 480px; width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    position: relative;
  }
  .about-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; font-size: 16px; color: #b0a898;
    cursor: pointer; line-height: 1; padding: 4px;
    transition: color 0.15s;
  }
  .about-close:hover { color: #5a5248; }
  .about-title {
    font-family: 'Outfit', sans-serif; font-size: 17px; font-weight: 700;
    color: #2a2520; margin-bottom: 14px;
  }
  .about-body p {
    font-size: 13.5px; line-height: 1.65; color: #4a453f;
    margin-bottom: 10px;
  }
  .about-body p:last-child { margin-bottom: 0; }
  .about-logos {
    display: flex; align-items: center; justify-content: center;
    gap: 24px; margin-top: 22px; padding-top: 18px;
    border-top: 1px solid #ede9e3;
    flex-wrap: wrap;
  }
  .about-logo { max-height: 52px; width: auto; object-fit: contain; }
  .about-logo-nansen { max-height: 56px; }
  .about-logo-cas { max-height: 44px; }
  .about-logo-divider {
    width: 1px; height: 36px; background: #ddd9d2; flex-shrink: 0;
  }

  /* ── AUDIT MODE PRE-SELECTOR ── */
  #auditModeRow { padding: 12px 0 0 20px; border-left: 2px solid #cce9ea; margin-left: 8px; }
  .audit-mode-row-label { font-size: 12px; font-weight: 600; color: #8ecbce; margin-bottom: 8px; display: block; }
  .audit-mode-btn { display: flex; align-items: flex-start; gap: 8px; width: 100%; background: #fff; border: 1.5px solid #c5e8ea; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; font-family: 'Geist',sans-serif; font-size: 13px; color: #0c2428; text-align: left; transition: border-color 0.15s, background 0.15s; }
  .audit-mode-btn:last-of-type { margin-bottom: 0; }
  .audit-mode-btn:hover { border-color: #3d9ea3; background: #e4f4f5; }
  .audit-mode-btn.active { border-color: #3d9ea3; background: #e4f4f5; }
  .audit-mode-btn-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
  .audit-mode-btn strong { font-size: 13px; }
  .audit-mode-btn span[id] { font-size: 11px; color: #8ecbce; }

  /* ── AUDIT MODE CARD (solo mid-session) ── */
  .audit-mode-card-wrap { padding-left: 44px; margin: 8px 0 4px; animation: fadeUp 0.3s ease forwards; opacity: 0; }
  .audit-mode-card { background: #eff8f9; border: 1px solid #c5e8ea; border-radius: 12px; padding: 16px; }
  .audit-mode-card-title { font-size: 14px; font-weight: 600; color: #0c2428; margin: 0 0 12px; }
  .audit-mode-options { display: flex; flex-direction: column; gap: 6px; }
  .audit-mode-options .concern-btn { margin-bottom: 0; }
  .audit-mode-opt-desc { font-size: 12px; color: #8ecbce; }
  .audit-mode-card-note { font-size: 12px; color: #8ecbce; margin: 10px 0 0; font-style: italic; line-height: 1.5; }

  /* ── REFERRAL REPORT CARD ── */
  .referral-report-wrap { padding-left: 44px; margin: 8px 0 4px; }
  .referral-report-card { background: #fff8e6; border: 1.5px solid #e6a817; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
  .referral-report-msg { font-size: 13px; color: #6b4c0a; line-height: 1.5; margin: 0; }
  .referral-download-btn { align-self: flex-start; background: #e6a817; border: none; border-radius: 8px; color: #fff; font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 700; padding: 8px 16px; cursor: pointer; transition: background 0.15s; }
  .referral-download-btn:hover { background: #c98e10; }

  /* ── EVIDENCE CAPTURE PROMPT ── */
  .evidence-capture-wrap { padding-left: 44px; margin: 8px 0 4px; animation: fadeUp 0.3s ease forwards; opacity: 0; }
  .evidence-capture-card { background: #eff8f9; border: 1px solid #c5e8ea; border-radius: 12px; padding: 14px 16px; }
  .evidence-capture-title { font-size: 13px; font-weight: 600; color: #0c2428; margin: 0 0 6px; }
  .evidence-capture-desc { font-size: 13px; color: #8ecbce; margin: 0 0 12px; line-height: 1.5; }
  .evidence-capture-btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .evidence-capture-btn-primary { background: #3d9ea3; color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
  .evidence-capture-btn-primary:hover { background: #236f75; }
  .evidence-capture-btn-skip { background: none; color: #8ecbce; border: 1px solid #c5e8ea; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: border-color 0.15s; }
  .evidence-capture-btn-skip:hover { border-color: #3d9ea3; color: #0c2428; }

  /* ── EVIDENCE PANEL MODAL ── */
  .evidence-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9100; align-items: center; justify-content: center; }
  .evidence-modal-overlay.open { display: flex; }
  .evidence-modal-card { background: #fff; border-radius: 12px; padding: 20px; max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
  .evidence-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
  .evidence-modal-header strong { font-size: 15px; color: #0c2428; }
  .evidence-modal-header button { background: none; border: none; font-size: 22px; cursor: pointer; color: #8ecbce; line-height: 1; padding: 0 2px; }
  .evidence-modal-header button:hover { color: #0c2428; }
  .evidence-list { display: flex; flex-direction: column; }
  .evidence-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #d8eeef; }
  .evidence-item:last-child { border-bottom: none; }
  .evidence-item img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid #c5e8ea; flex-shrink: 0; transition: opacity 0.15s; }
  .evidence-item img:hover { opacity: 0.85; }
  .evidence-item-meta { font-size: 12px; color: #8ecbce; line-height: 1.6; }
  .evidence-item-meta strong { color: #0c2428; font-size: 13px; display: block; }
  .evidence-timestamp { color: #a8d9db; font-size: 11px; }
  .evidence-note { font-size: 12px; color: #8ecbce; margin-top: 14px; padding-top: 12px; border-top: 1px solid #d8eeef; font-style: italic; line-height: 1.5; }

  /* ═══════════════════════════════════════════════════════════════════
     DUAL-PANE LIVE TRANSLATION
  ═══════════════════════════════════════════════════════════════════ */
  .pane-container { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .pane-left { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .pane-right { display: none; }

  @media (min-width: 1023px) {
    .widget-wrapper.dual-pane { max-width: 2560px; }
    .widget-wrapper.dual-pane .pane-container { flex-direction: row; }
    .widget-wrapper.dual-pane .pane-left { flex: 1; min-width: 0; border-right: 2px solid #c5e8ea; }
    .widget-wrapper.dual-pane .pane-right { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #f4fbfc; }
  }

  .pane-right-hdr { background: #e4f4f5; border-bottom: 1px solid #c5e8ea; padding: 9px 20px; font-size: 12px; color: #8ecbce; display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-weight: 600; }
  .pane-right-badge { background: rgba(126,192,196,0.12); border: 1px solid rgba(126,192,196,0.3); border-radius: 4px; padding: 2px 8px; font-size: 10px; color: #7ec0c4; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; flex-shrink: 0; }
  #paneRightLabel { font-weight: 400; color: #9acfd2; font-size: 11.5px; }

  .chat-area-mirror { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px 10px; display: flex; flex-direction: column; gap: 14px; background: #f4fbfc; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #c5e8ea transparent; }
  .chat-area-mirror::-webkit-scrollbar { width: 3px; }
  .chat-area-mirror::-webkit-scrollbar-thumb { background: #bde5e7; border-radius: 3px; }

  .mirror-pending { display: flex; gap: 10px; align-items: flex-end; opacity: 0.55; }
  .mirror-pending-dots { background: #e4f4f5; border: 1px dashed #b5e0e2; border-radius: 14px; border-bottom-left-radius: 3px; padding: 10px 16px; font-size: 12px; color: #a8d9db; font-style: italic; }
  .mirror-translated-note { display: block; font-size: 10px; color: #b8e0e2; text-align: right; margin-top: 4px; font-style: italic; letter-spacing: 0.02em; }

  /* ── STEPPER vertical stack — narrower than ~760px ─────────────── */
  @media (max-width: 760px) {
    .progress-stepper {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }
    .ps-connector { display: none; }
  }

  /* ═══════════════════════════════════════════════════════════════════
     MOBILE — ≤520px
  ═══════════════════════════════════════════════════════════════════ */
  @media (max-width: 520px) {
    html { min-height: -webkit-fill-available; overflow-y: auto; }
    body { padding: 0; min-height: -webkit-fill-available; overflow-x: hidden; }

    #langPage { width: 100%; height: 100%; min-height: 0; padding: 0; }
    .lang-card { width: 100%; max-width: none; border-radius: 0; box-shadow: none; min-height: -webkit-fill-available; min-height: 100dvh; max-height: none; display: flex; flex-direction: column; overflow: visible; }
    .lang-hdr { padding: 20px 16px 0; }
    .lang-hdr img { height: 22px; }
    .lang-heading { font-size: 22px; }
    .lang-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 8px; }
    .lang-footer { flex-shrink: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); background: #f5f3ef; }

    .widget-wrapper { border-radius: 0; height: -webkit-fill-available; height: 100dvh; min-height: 0; }

    /* ── Compact single-row header with just logo + quick exit ── */
    .widget-header { padding: max(env(safe-area-inset-top), 8px) 12px 8px; gap: 8px; height: auto; min-height: 0; align-items: center; flex-wrap: nowrap; justify-content: flex-start; }
    .widget-header > a:first-child { flex: 1; flex-basis: auto; justify-content: flex-start; margin-right: 0; }
    #acornLogo { display: block !important; height: 26px; width: auto; filter: brightness(0) invert(1); }
    #transcriptDlBtn, #psSaveBtn, #aboutBtn { display: none !important; }
    .logo-text { font-size: 14px; }
    .confidential-badge { display: none; }
    /* Hide the byline bar entirely on mobile */
    .byline-bar { display: none; }

    /* ── Compact horizontal stepper — numbers only, no labels ── */
    .progress-stepper { flex-direction: row; align-items: center; justify-content: center; gap: 0; padding: 4px 10px; }
    .ps-connector { display: flex; flex: 1; min-width: 6px; }
    .ps-label { display: none; }
    .ps-num { width: 22px; height: 22px; font-size: 11px; }

    .bubble { font-size: 13.5px; }
    .chat-area { padding: 14px 12px 8px; gap: 12px; }
    .quick-replies { padding-left: 0; }

    .input-area { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .input-main-row { flex-wrap: nowrap; gap: 6px; align-items: stretch; }
    .textarea-wrap { flex: 1; min-width: 0; width: auto; padding: 9px 12px; min-height: 44px; border-radius: 22px; }
    textarea { font-size: 14px; }
    .send-btn { width: 32px; height: 32px; }
    .camera-cta-btn, .mic-btn { flex: 0 0 44px; width: 44px; height: auto; border-radius: 10px; }

    /* Hide footer notes — use that space for chat */
    .footer-note, .footer-disclaimer { display: none; }
  }

  /* ── KEYBOARD UP: collapse chrome when virtual keyboard is open ── */
  @media (max-width: 520px) {
    html.keyboard-up .widget-header { display: none; }
    html.keyboard-up .progress-stepper.visible { display: none !important; }
  }

  /* 521–640px: small tablets */
  @media (min-width: 521px) and (max-width: 640px) {
    .input-main-row { flex-wrap: nowrap; gap: 8px; align-items: stretch; }
    .textarea-wrap { flex: 1; min-width: 0; width: auto; min-height: 44px; }
    .mic-btn, .camera-cta-btn { flex: 0 0 44px; width: 44px; height: auto; border-radius: 10px; justify-content: center; }
    .widget-header { flex-wrap: wrap; justify-content: center; gap: 10px; padding-bottom: 12px; }
    .widget-header > a:first-child { flex-basis: 100%; justify-content: center; margin-right: 0; }
  }

  /* ≤860px: camera panel */
  @media (max-width: 860px) {
    .camera-content { flex-direction: column; gap: 16px; }
    .camera-live-pane, .camera-preview-pane { min-height: 220px; }
    .camera-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .cam-privacy { border-top: none; padding-top: 0; margin-top: 0; }
    .camera-topbar, .zoom-bar { flex-wrap: wrap; }
    .zoom-bar { justify-content: space-between; }
    .camera-preview-pane .preview-actions { flex-direction: row; gap: 7px; }
  }

  @media (max-width: 480px) {
    .camera-live-pane { min-height: 180px; }
    .camera-preview-pane { min-height: 180px; }
    .phone-guide-frame { width: 92px; height: 150px; }
    .camera-panel.open { max-height: 340px; }
    .camera-content { height: 220px; }
    .input-main-row { flex-wrap: nowrap; gap: 6px; }
    .textarea-wrap { width: auto; flex-shrink: 1; min-height: 44px; }
    .mic-btn, .camera-cta-btn { flex: 0 0 44px; min-height: 0; justify-content: center; }
  }

  @media(max-width:480px){
    .lang-body { padding: 14px 12px 8px; }
    .lang-hdr { padding: 16px 14px 0; }
    .lang-footer { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
    .ack-btn { font-size: 14px; padding: 13px; }
  }

/* ════════ SESSION RESUME CODE ════════ */



/* Subtle 'Resume with code' button in landing page header */
.hdr-resume-code-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.72);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.hdr-resume-code-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Compact code-entry modal */
.code-entry-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.code-entry-overlay.open { display: flex; }
.code-entry-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 22px 20px;
  max-width: 320px;
  width: calc(100% - 32px);
  position: relative;
  box-shadow: 0 6px 32px rgba(0,0,0,0.16);
}
.code-entry-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
}
.code-entry-hint {
  font-size: 12.5px;
  color: #666;
  margin: 0 0 14px;
  line-height: 1.45;
}
.code-resume-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.code-resume-input {
  flex: 1;
  max-width: 160px;
  border: 2px solid #7ec0c4;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  font-family: 'Courier New', monospace;
  text-align: center;
}
.code-resume-input:focus { border-color: #3d9ea3; box-shadow: 0 0 0 3px rgba(126,192,196,0.12); }
.code-resume-input::placeholder { color: #aaa; letter-spacing: 0.1em; font-weight: 400; font-size: 15px; }
.code-resume-submit-btn {
  background: #3d9ea3;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.code-resume-submit-btn:hover { background: #3d9ea3; }
.code-resume-submit-btn:disabled { opacity: 0.6; cursor: default; }
.code-resume-error {
  margin: 8px 0 0;
  color: #c0392b;
  font-size: 13px;
}

/* Code display modal */
.code-display-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.code-display-overlay.open {
  display: flex;
}
.code-display-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 360px;
  width: calc(100% - 32px);
  position: relative;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.code-display-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
}
.code-display-close:hover { color: #333; }
.code-display-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}
.code-display-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0 0 20px;
}
.code-display-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #3d9ea3;
  font-family: 'Courier New', monospace;
  background: #f2f8f9;
  border-radius: 10px;
  padding: 14px 20px;
  margin: 0 0 16px;
  -webkit-user-select: all;
  user-select: all;
}
.code-display-copy {
  display: block;
  width: 100%;
  background: #3d9ea3;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background 0.15s;
}
.code-display-copy:hover { background: #3d9ea3; }
.code-display-note {
  font-size: 12px;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

/* ── DEVICE OWNERSHIP CARD ────────────────────────────────────────────── */
.device-own-btn {
  background: #f8f7f4; border: 1.5px solid #ddd; border-radius: 10px;
  padding: 11px 14px; text-align: left; cursor: pointer; width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.device-own-btn strong { display: block; font-size: 13.5px; color: #1a3030; margin-bottom: 2px; }
.device-own-btn span { font-size: 12px; color: #777; }
.device-own-btn:hover { border-color: #3d9ea3; background: #e8f5f6; }

/* ── CASEWORKER SAFETY CHECKLIST ──────────────────────────────────────── */
.cw-checklist-title {
  font-size: 13px; font-weight: 700; color: #3d9ea3; margin: 0 0 10px;
}
.cw-checklist { display: flex; flex-direction: column; gap: 8px; }
.cw-checklist-item {
  display: flex; align-items: flex-start; gap: 9px;
  cursor: pointer; font-size: 13.5px; line-height: 1.4;
}
.cw-checklist-item input[type=checkbox] {
  margin-top: 3px; flex-shrink: 0; accent-color: #3d9ea3;
  width: 15px; height: 15px; cursor: pointer;
}
.cw-checklist-item span { color: #333; }
.cw-checklist-item:has(input:checked) span { text-decoration: line-through; color: #aaa; }
.cw-checklist-status { font-size: 12px; margin: 10px 0 0; }

/* Mic diagnostic modal */
.mic-diag-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mic-diag-panel {
  background: #fff;
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  padding: 24px 24px 20px;
  position: relative;
  font-family: inherit;
  color: #222;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.mic-diag-panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #236f75;
}
.mic-diag-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #888;
}
.mic-diag-close:hover { color: #222; }
.mic-diag-help, .mic-diag-tip {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 12px;
  color: #444;
}
.mic-diag-tip {
  background: #f7f2e6;
  border-left: 3px solid #c07a10;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 14px;
  margin-bottom: 0;
}
.mic-diag-panel label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 6px;
  color: #333;
}
.mic-diag-panel select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 12px;
}
.mic-diag-meter {
  width: 100%;
  height: 14px;
  background: #eee;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mic-diag-meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7ec0c4 0%, #c07a10 70%, #b03020 100%);
  transition: width 60ms linear;
}
.mic-diag-status {
  font-size: 12px;
  color: #666;
  margin: 0 0 4px;
}

/* ─── SESSION EXPIRY MODAL & COUNTDOWN ─── */
.resume-expiry {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #c07a10;
  letter-spacing: .03em;
  min-height: 15px;
}
.se-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.se-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 26px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
}
.se-icon { font-size: 34px; margin-bottom: 12px; }
.se-title { font-size: 17px; font-weight: 700; color: #1a2e2c; margin-bottom: 10px; }
.se-body {
  font-size: 15px;
  color: #3e7e83;
  line-height: 1.6;
  margin-bottom: 6px;
}
.se-body strong {
  display: block;
  font-size: 34px;
  font-family: 'Courier New', monospace;
  color: #c45a1b;
  letter-spacing: .04em;
  margin-top: 8px;
}
.se-sub { font-size: 12.5px; color: #7a9e99; line-height: 1.55; margin-bottom: 22px; }
.se-actions { display: flex; flex-direction: column; gap: 10px; }
.se-resume-btn {
  background: #7ec0c4;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.se-resume-btn:hover { background: #3d9ea3; }
.se-dismiss-btn {
  background: none;
  color: #9acfd2;
  border: 1px solid #c5e8ea;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
}
.se-dismiss-btn:hover { background: #f0faf8; }
