/* Client Intelligence — mobile responsiveness (max-width 768px) */

@media (max-width: 768px) {
  /* Cadence mobile palette — Client Intelligence */
  html.mead-notes-quick-capture,
  html.mead-notes-quick-capture body,
  body.quick-capture-active,
  body.notes-full-view {
    --cadence-red: #8B1A2B;
    --cadence-red-glow: rgba(139, 26, 43, 0.25);
    --cadence-bg: #F8F7F5;
    --cadence-surface: #FFFFFF;
    --cadence-border: #E8E4DF;
    --cadence-text: #1A1614;
    --cadence-text-secondary: #6B6460;
    --cadence-text-tertiary: #9B9390;
    --cadence-press: #F0EDEA;
    --cadence-shadow: 0 2px 12px rgba(26, 22, 20, 0.08);
  }

  html.mead-notes-quick-capture body,
  body.quick-capture-active:not(.notes-full-view),
  body.notes-full-view {
    background: var(--cadence-bg);
    color: var(--cadence-text);
  }

  html.mead-notes-quick-capture,
  html.mead-notes-quick-capture body,
  body.quick-capture-active:not(.notes-full-view) {
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.quick-capture-active:not(.notes-full-view)::-webkit-scrollbar,
  body.quick-capture-active:not(.notes-full-view) *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  html.mead-notes-quick-capture::-webkit-scrollbar,
  html.mead-notes-quick-capture body::-webkit-scrollbar,
  html.mead-notes-quick-capture *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Boot + Quick Capture — hide desktop chrome before JS finishes (only when QC shell exists) */
  html.mead-notes-quick-capture:has(#quickCaptureApp) body .upload-section > :not(#customerHistorySection),
  html.mead-notes-quick-capture:has(#quickCaptureApp) body main.notes-page > .page-title,
  html.mead-notes-quick-capture:has(#quickCaptureApp) body #commHubNav,
  html.mead-notes-quick-capture:has(#quickCaptureApp) body #meadPageBackBtn,
  html.mead-notes-quick-capture:has(#quickCaptureApp) body .notes-results-grid,
  html.mead-notes-quick-capture:has(#quickCaptureApp) body #site-footer,
  html.mead-notes-quick-capture:has(#quickCaptureApp) body .header > .header-brand {
    display: none !important;
  }

  html.mead-notes-quick-capture #customerHistorySection,
  html.mead-notes-quick-capture #customerHistorySection[hidden] {
    display: block !important;
    visibility: visible !important;
  }

  html.mead-notes-quick-capture #quickCaptureApp,
  html.mead-notes-quick-capture #quickCaptureApp[hidden],
  body.quick-capture-active #quickCaptureApp,
  body.quick-capture-active #quickCaptureApp[hidden] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto;
  }

  html.mead-notes-quick-capture #qcPhaseCapture:not([hidden]),
  body.quick-capture-active:not(.notes-full-view) #qcPhaseCapture:not([hidden]) {
    display: flex !important;
    visibility: visible !important;
  }

  html.mead-notes-quick-capture .qc-record-wrap:not([hidden]),
  body.quick-capture-active:not(.notes-full-view) .qc-record-wrap:not([hidden]) {
    display: flex !important;
    visibility: visible !important;
  }

  html.mead-notes-quick-capture #qcRecordBtn,
  body.quick-capture-active:not(.notes-full-view) #qcRecordBtn {
    display: flex !important;
    visibility: visible !important;
  }

  html.mead-notes-quick-capture .header-row,
  body.quick-capture-active:not(.notes-full-view) .header-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 12px;
    background: #000;
  }

  html.mead-notes-quick-capture .header-row .header-brand,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-brand {
    display: none !important;
  }

  html.mead-notes-quick-capture .header-row .header-advisor,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-advisor {
    order: 1;
    flex: 0 0 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
  }

  html.mead-notes-quick-capture .header-advisor-avatar,
  body.quick-capture-active:not(.notes-full-view) .header-advisor-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 14px;
    flex-shrink: 0;
  }

  html.mead-notes-quick-capture .header-advisor-meta,
  html.mead-notes-quick-capture .header-row .header-advisor-name,
  html.mead-notes-quick-capture .header-row .header-advisor-greeting,
  html.mead-notes-quick-capture .header-row .header-advisor-role,
  html.mead-notes-quick-capture .header-row .header-session-date,
  html.mead-notes-quick-capture .header-weather,
  body.quick-capture-active:not(.notes-full-view) .header-advisor-meta,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-advisor-name,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-advisor-greeting,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-advisor-role,
  body.quick-capture-active:not(.notes-full-view) .header-weather {
    display: none !important;
  }

  html.mead-notes-quick-capture .header-row .header-brand,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-brand {
    display: flex !important;
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  html.mead-notes-quick-capture .header-row .header-brand .brand-name,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-brand .brand-name {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html.mead-notes-quick-capture .header-qc-center-brand,
  body.quick-capture-active:not(.notes-full-view) .header-qc-center-brand {
    display: none !important;
  }

  html.mead-notes-quick-capture .header-nav-toggle-slot,
  body.quick-capture-active:not(.notes-full-view) .header-nav-toggle-slot {
    order: 3;
    flex: 0 0 auto;
  }

  html.mead-notes-quick-capture .header-row .header-session,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-session {
    order: 4;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    padding: 0;
  }

  html.mead-notes-quick-capture .header-row .header-signout,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-signout {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.55);
    border: none;
    background: none;
    text-decoration: none;
    opacity: 1;
    padding: 0;
    min-height: auto;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  html.mead-notes-quick-capture .header-row .header-signout:hover,
  body.quick-capture-active:not(.notes-full-view) .header-row .header-signout:hover {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
  }

  html.mead-notes-quick-capture .header {
    padding: 0;
    background: #000;
  }

  html.mead-notes-quick-capture main.notes-page {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    margin-top: 0 !important;
    overflow-x: hidden;
  }

  .comm-hub-nav {
    text-align: center;
    margin: 0 0 1rem;
    padding: 0 0.5rem;
  }

  .comm-hub-nav-link,
  .comm-hub-nav-current {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .notes-page.main,
  .comm-profile-page.main {
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
  }

  /* Customer + date fields — stack full width */
  .main-agent-wide.notes-page .notes-top-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-agent-wide.notes-page .notes-top-fields .notes-customer-field,
  .main-agent-wide.notes-page .notes-top-fields .notes-meeting-date-field {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .upload-section select,
  .upload-section input[type="date"],
  .upload-section textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .upload-section textarea {
    width: 100%;
    min-height: 120px;
    resize: none;
    -webkit-overflow-scrolling: touch;
  }

  /* Upload buttons — 2×2 grid */
  .upload-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .upload-buttons .btn,
  .upload-buttons label.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    box-sizing: border-box;
    flex: none;
  }

  .upload-buttons .cadence-voice-capture-btn {
    flex: none;
    width: 100%;
    justify-content: center;
  }

  .cadence-voice-capture-btn--active {
    animation: cadence-voice-capture-pulse-mobile 1s ease-in-out infinite;
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.35);
  }

  @keyframes cadence-voice-capture-pulse-mobile {
    0%,
    100% {
      box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.45);
    }
    50% {
      box-shadow: 0 0 0 8px rgba(178, 34, 34, 0.15);
    }
  }

  /* Save Record / Summarize / Generate Email */
  .notes-hub-actions,
  .notes-generate-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .notes-hub-actions #generateEmailBtn {
    order: 1;
  }

  .notes-hub-actions #summarizeNotesBtn {
    order: 2;
  }

  .notes-hub-actions #saveRecordBtn {
    order: 3;
  }

  .notes-hub-actions .btn,
  .notes-generate-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }

  .notes-hub-actions .btn.is-loading,
  .notes-generate-actions .btn.is-loading {
    min-height: 48px;
  }

  .notes-generate-save-status {
    max-width: none;
    font-size: 0.9rem;
  }

  /* Meeting History — card layout */
  .customer-history {
    padding: 0.85rem 1rem;
  }

  .customer-history-search {
    max-width: none;
  }

  .customer-history-search-input {
    font-size: 16px;
    min-height: 48px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .customer-history-search-clear {
    width: 44px;
    height: 44px;
    right: 0;
  }

  .customer-history-table-wrap {
    max-height: none;
    overflow-x: hidden;
    border: none;
    background: transparent;
  }

  .customer-history-table {
    display: block;
    font-size: 0.92rem;
  }

  .customer-history-table thead {
    display: none !important;
  }

  .customer-history-table thead tr {
    display: none;
  }

  .customer-history-table thead th {
    display: none;
  }

  .customer-history-col-topics,
  .customer-history-col-actions {
    display: none;
  }

  .customer-history-col-date {
    display: none;
  }

  .customer-history-sort-btn {
    min-height: 44px;
    padding: 0.35rem 0;
    font-size: 0.82rem;
  }

  .customer-history-table tbody {
    display: block;
  }

  .customer-history-row {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--ev-white);
    border: 1px solid var(--ev-border-subtle);
    border-radius: 8px;
    cursor: default;
  }

  .customer-history-row:nth-child(even) {
    background: var(--ev-white);
  }

  .customer-history-row:hover,
  .customer-history-row:focus-visible {
    background: var(--ev-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .customer-history-row td {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0;
    border: none;
    overflow: visible;
    text-align: left;
  }

  .customer-history-date-cell {
    margin-bottom: 0.35rem;
    white-space: normal;
    font-size: 0.88rem;
  }

  .customer-history-col-topics,
  .customer-history-topics-cell {
    padding-left: 0;
  }

  .customer-history-topics-cell {
    margin-bottom: 0.65rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.45;
    max-width: none;
  }

  .customer-history-actions-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-width: none;
    text-align: left;
    white-space: normal;
    overflow: visible;
    padding: 0;
  }

  .customer-history-actions-primary {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
  }

  .customer-history-actions-primary .btn-sm {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  .customer-history-actions-cell .customer-history-delete-btn,
  .customer-history-actions-cell .customer-history-delete-btn.btn-outline {
    align-self: center;
    width: auto;
    min-height: auto;
    margin: 0.25rem 0 0;
    padding: 0.15rem 0;
    font-size: 0.75rem;
    font-weight: 400;
    background: none !important;
    border: none !important;
    color: rgba(166, 61, 74, 0.75);
    text-decoration: underline;
    text-underline-offset: 0.12em;
    box-shadow: none;
  }

  .customer-history-actions-cell .customer-history-delete-btn:active {
    color: #8b1a2f;
  }

  .customer-history-actions-cell .btn-sm:not(.customer-history-delete-btn) {
    width: auto;
  }

  .customer-history-actions-cell--confirm {
    gap: 0.5rem;
  }

  .customer-history-delete-confirm-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .customer-history-delete-confirm-yes,
  .customer-history-delete-confirm-cancel {
    flex: 1 1 auto;
    width: auto;
    min-height: 36px;
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
  }

  /* Mobile full view — Meeting History from Quick Capture */
  body.notes-full-view .main.notes-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.notes-full-view .page-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--ev-charcoal);
  }

  body.notes-full-view .notes-page > .page-title {
    display: block !important;
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
  }

  body.notes-full-view #commHubNav {
    display: block !important;
    margin-bottom: 0.75rem;
  }

  body.notes-full-view .upload-section {
    display: block !important;
  }

  body.notes-full-view .notes-top-fields {
    display: flex !important;
  }

  body.notes-full-view #customerHistorySection {
    display: block !important;
  }

  body.notes-full-view .upload-buttons,
  body.notes-full-view .notes-hub-actions,
  body.notes-full-view .notes-generate-actions,
  body.notes-full-view .cadence-voice-capture-retry-btn,
  body.notes-full-view .notes-field-grid > .field.field-span-full,
  body.notes-full-view .notes-generate-save-status,
  body.notes-full-view .progress,
  body.notes-full-view .upload-status {
    display: none !important;
  }

  body.notes-full-view .notes-top-fields {
    margin-bottom: 0.75rem;
  }

  body.notes-full-view .customer-history {
    padding: 0;
    margin-top: 0;
  }

  body.notes-full-view .customer-history > h3 {
    font-size: 1.05rem;
    margin: 0 0 0.65rem;
  }

  body.notes-full-view .customer-history-intro {
    display: none;
  }

  body.notes-full-view .notes-results-grid {
    display: none !important;
  }

  /* Communication Profile — trim duplicate chrome on mobile */
  .comm-profile-page > .page-title:first-of-type {
    display: none;
  }

  .comm-profile-page .page-title {
    font-size: 1.2rem;
    margin-top: 0;
  }

  .comm-profile-page .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }

  /* Meeting Notes modal — mobile bottom sheet */
  #noteSourceModal.note-source-modal--mobile.note-source-modal-overlay {
    padding: 0;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.5);
    animation: none;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal {
    width: 100vw;
    max-width: 100vw;
    height: 92dvh;
    max-height: 92dvh;
    margin: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    animation: slideUpSheet 250ms ease-out;
  }

  @keyframes slideUpSheet {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #e8e4df;
    border-radius: 2px;
    margin: 8px auto -4px;
    flex-shrink: 0;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-top {
    display: block;
    flex: 0 0 auto;
    padding: 0;
    border-bottom: none;
    background: #ffffff;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 16px;
    border-bottom: 1px solid #e8e4df;
    background: #ffffff;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
    color: #1a1614;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-header-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-header-end .panel-header-actions {
    gap: 8px;
  }

  #noteSourceModal.note-source-modal--mobile .meeting-notes-create-email-btn,
  #noteSourceModal.note-source-modal--mobile #createEmailFromNoteBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    border: 1.5px solid #8b1a2b;
    border-radius: 6px;
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #8b1a2b;
    white-space: nowrap;
  }

  #noteSourceModal.note-source-modal--mobile .meeting-notes-create-email-btn:disabled,
  #noteSourceModal.note-source-modal--mobile #createEmailFromNoteBtn:disabled {
    opacity: 0.55;
  }

  @media (max-width: 359px) {
    #noteSourceModal.note-source-modal--mobile .note-source-modal-header-end .panel-header-actions {
      flex-direction: column;
      align-items: flex-end;
    }
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-save,
  #noteSourceModal.note-source-modal--mobile #saveMeetingNotesModal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    border: 1.5px solid #e8e4df;
    border-radius: 6px;
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #4a4a4a;
    white-space: nowrap;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-save:disabled,
  #noteSourceModal.note-source-modal--mobile #saveMeetingNotesModal:disabled {
    opacity: 0.55;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a4a4a;
    font-size: 20px;
    line-height: 1;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-subheader {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid #e8e4df;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #6b6460;
    background: #ffffff;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-body--empty {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-empty {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    color: #9b9390;
    text-align: center;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-label {
    margin: 20px 0 8px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a1614;
    line-height: 1.3;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-label:first-of-type {
    margin-top: 0;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-editable {
    margin: 0;
    padding: 12px;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px !important;
    line-height: 1.6;
    color: #1a1614;
    min-height: 60px;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-editable:focus {
    border-color: #8b1a2b;
    box-shadow: 0 0 0 2px rgba(139, 26, 43, 0.12);
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-list {
    margin: 0;
    padding: 14px 16px 14px 32px;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1a1614;
    list-style: disc;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-list li {
    margin: 0 0 8px;
    padding-left: 0;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-list li::before {
    content: none;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-summary-list li:last-child {
    margin-bottom: 0;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-pre {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    background: #f8f7f5;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.7;
    color: #4a4a4a;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: hidden;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-actions {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1a1614;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-actions li {
    margin: 0 0 6px;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-actions li::marker {
    color: #8b1a2b;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e8e4df;
    background: #ffffff;
  }

  #noteSourceModal.note-source-modal--mobile .note-source-modal-footer .btn,
  #noteSourceModal.note-source-modal--mobile .note-source-modal-close-btn {
    width: 100%;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1.5px solid #e8e4df;
    border-radius: 8px;
    background: #ffffff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #4a4a4a;
  }

  /* Meeting History — follow-up email edit modal */
  #meetingEmailModal.meeting-email-modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  #meetingEmailModal .meeting-email-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  #meetingEmailModal .note-source-modal-header-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.85rem 1rem;
    background: var(--ev-white);
    border-bottom: 1px solid var(--ev-border-subtle);
  }

  #meetingEmailModal .note-source-modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.75rem;
  }

  #meetingEmailModal .meeting-email-modal-body {
    padding: 0.85rem 1rem;
  }

  #meetingEmailModal .meeting-email-modal-body .email-edit-hint {
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
  }

  #meetingEmailModal .meeting-email-modal-preview .email-body,
  #meetingEmailModal .meeting-email-modal-preview .ev-signature[contenteditable='true'],
  #meetingEmailModal .meeting-email-modal-preview .ev-footer[contenteditable='true'] {
    font-size: 16px;
    scroll-margin-bottom: 40vh;
  }

  #meetingEmailModal .meeting-email-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }

  .note-source-summary-editable {
    font-size: 16px;
    min-height: 4rem;
  }

  /* Email output panel */
  .notes-page .notes-results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .notes-page .email-template,
  .notes-page .summary-view {
    width: 100%;
    max-width: 100%;
  }

  .email-header {
    flex-direction: column;
    align-items: stretch;
  }

  .email-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .email-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.9rem;
  }

  .notes-page .email-preview {
    padding: 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .notes-page .email-preview * {
    max-width: 100%;
  }

  .notes-page .email-body,
  .notes-page .ev-signature[contenteditable='true'] {
    font-size: 16px;
    scroll-margin-bottom: 40vh;
  }

  .notes-page .email-body p,
  #meetingEmailModal .meeting-email-modal-preview .email-body p {
    margin: 0 0 1em;
  }

  .notes-page .email-body p:last-child,
  #meetingEmailModal .meeting-email-modal-preview .email-body p:last-child {
    margin-bottom: 0;
  }

  .notes-save-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-save-bar .btn-primary {
    width: 100%;
    min-height: 48px;
  }

  /* Communication Profile */
  .comm-profile-page .field input,
  .comm-profile-page .field select,
  .comm-profile-page .field textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .comm-profile-page .field textarea {
    min-height: 6rem;
  }

  .comm-profile-radio-group {
    gap: 0.65rem;
  }

  .comm-profile-radio {
    min-height: 44px;
    align-items: center;
    font-size: 1rem;
  }

  .comm-profile-radio input {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }

  .comm-profile-headshot-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .comm-profile-headshot-row .btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .comm-profile-save-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 1rem;
    padding-bottom: 1.5rem;
  }

  .comm-profile-save-row .btn-primary {
    width: 100%;
    min-height: 52px;
    font-size: 1rem;
  }

  .comm-profile-signature-preview-wrap .email-preview {
    padding: 1rem;
    overflow-x: hidden;
  }

  /* Quick Capture — mobile primary experience */
  body.quick-capture-active:not(.notes-full-view) #meadPageBackBtn,
  body.quick-capture-active:not(.notes-full-view) .qc-full-view-link,
  body.quick-capture-active:not(.notes-full-view) #site-footer {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) .header {
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: #1A1614;
  }

  body.quick-capture-active:not(.notes-full-view) .notes-page > .page-title,
  body.quick-capture-active:not(.notes-full-view) #commHubNav,
  body.quick-capture-active:not(.notes-full-view) .notes-results-grid,
  body.quick-capture-active:not(.notes-full-view) .notes-page > .error,
  body.quick-capture-active:not(.notes-full-view):has(#quickCaptureApp) .upload-section > :not(#customerHistorySection) {
    display: none !important;
  }

  /* Fallback: mobile without Quick Capture shell — keep desktop Record + uploads visible */
  body:not(.quick-capture-active):not(.notes-full-view) .upload-buttons,
  html:not(.mead-notes-quick-capture) body .upload-buttons {
    display: grid !important;
  }

  body:not(.quick-capture-active):not(.notes-full-view) #cadenceVoiceCaptureToggle,
  html:not(.mead-notes-quick-capture) body #cadenceVoiceCaptureToggle {
    display: flex !important;
    visibility: visible !important;
  }

  body.quick-capture-active:not(.notes-full-view) .upload-section {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem 32px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection,
  body.quick-capture-active:not(.notes-full-view) #customerHistorySection[hidden] {
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    margin-top: 16px;
    padding-top: 0;
    border-top: none;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection > h3 {
    order: 1;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    margin: 0 0 8px;
    color: #9b9390;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection .qc-meeting-history-search-wrap {
    order: 2;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection .customer-history-content {
    order: 3;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection .customer-history-delete-status,
  body.quick-capture-active:not(.notes-full-view) #customerHistorySection .customer-history-live-status {
    order: 4;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection #qcCommHubNav {
    order: 10;
  }

  body.quick-capture-active:not(.notes-full-view) .customer-history-content {
    padding: 0;
  }

  body.quick-capture-active:not(.notes-full-view) .notes-meeting-date-field,
  body.quick-capture-active:not(.notes-full-view) #meetingDate,
  body.quick-capture-active:not(.notes-full-view) .customer-history-intro {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-pre-capture-picker {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) #quickCaptureApp > #qcCommHubNav {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-mobile-client-select {
    display: block !important;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    box-sizing: border-box;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-mobile-client-select-wrap {
    position: relative;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-mobile-client-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9B9390;
    pointer-events: none;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-mobile-client-select #customerSelect {
    display: block;
    width: 100%;
    height: 52px;
    min-height: 52px;
    margin: 0;
    padding: 0 40px 0 16px;
    border: 1.5px solid #e8e4df;
    border-radius: 8px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.3;
    color: #1a1614;
    background: #ffffff;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection #qcCommHubNav {
    display: block !important;
    width: 100%;
    margin: 16px 0 0;
    padding: 0;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection #qcCommHubNav .comm-hub-nav {
    margin: 0;
    padding: 0;
    text-align: center;
  }

  body.quick-capture-active:not(.notes-full-view) #customerHistorySection #qcCommHubNav .comm-hub-nav-link {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: #9b9390;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  body.quick-capture-active:not(.notes-full-view) .main.notes-page {
    padding-bottom: 0.75rem;
    padding-top: 0;
    max-width: 100%;
    margin-top: 0 !important;
    overflow-x: hidden;
  }

  body.quick-capture-active:not(.notes-full-view) #qcCommHubNav .comm-hub-nav {
    margin: 0;
    padding: 0;
  }

  body.notes-full-view #qcCommHubNav {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) .quick-capture-app {
    padding: 12px 1rem 0;
  }

  .quick-capture-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem 0;
    min-height: auto;
    box-sizing: border-box;
  }

  .quick-capture-app[hidden] {
    display: none !important;
  }

  body.quick-capture-active #quickCaptureApp[hidden],
  html.mead-notes-quick-capture #quickCaptureApp[hidden] {
    display: flex !important;
  }

  .qc-page-title {
    margin: 0 0 16px;
    padding: 0;
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--cadence-text);
    text-align: center;
    width: 100%;
  }

  .qc-divider {
    display: none !important;
  }

  .qc-recording-for {
    display: none !important;
    margin: 0;
    padding: 0;
  }

  .qc-recording-for[hidden] {
    display: none !important;
  }

  .qc-record-prompt {
    margin: -0.35rem 0 1rem;
    padding: 0 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(139, 26, 47, 0.85);
    text-align: center;
    width: 100%;
  }

  .qc-record-prompt[hidden] {
    display: none !important;
  }

  .qc-recording-debug {
    width: 100%;
    max-width: 22rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    background: #ececec;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    text-align: left;
  }

  .qc-recording-debug[hidden] {
    display: none !important;
  }

  .qc-recording-debug-title {
    margin: 0 0 0.4rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(0, 0, 0, 0.55);
  }

  .qc-recording-debug-line {
    margin: 0.2rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    line-height: 1.45;
    color: rgba(0, 0, 0, 0.72);
    word-break: break-word;
  }

  .qc-recording-debug-line span {
    font-weight: 500;
  }

  .qc-pre-capture-picker {
    width: 100%;
    margin: 0 0 0.625rem;
    padding: 0;
  }

  .qc-pre-capture-picker[hidden] {
    display: none !important;
  }

  .qc-brand-line {
    display: none !important;
  }

  .qc-phase-capture {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .qc-pre-capture-picker {
    order: 1;
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0;
  }

  #qcPhaseCapture > .client-briefing-card {
    order: 8;
    width: 100%;
    margin: 12px 0 0;
  }

  .qc-recording-for {
    order: 2;
  }

  .qc-record-wrap {
    order: 3;
    margin-top: 0;
    margin-bottom: 0;
  }

  .qc-record-hint {
    order: 4;
    margin-bottom: 0;
  }

  .qc-transcribing {
    order: 5;
  }

  .qc-mobile-upload {
    order: 6;
  }

  .qc-session-panel {
    order: 7;
  }

  .qc-save-status {
    order: 9;
  }

  .qc-auto-detect-fallback {
    order: 10;
    width: 100%;
    margin-top: 0.5rem;
  }

  .qc-client-field-label {
    display: block;
    margin: 0 0 0.4rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.52);
  }

  .qc-client-search-field {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .qc-client-field-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.38);
    pointer-events: none;
  }

  .qc-client-field-icon-chevron {
    display: none;
  }

  .qc-pre-capture-picker--collapsed .qc-client-field-icon-search {
    display: none;
  }

  .qc-pre-capture-picker--collapsed .qc-client-field-icon-chevron {
    display: block;
  }

  .qc-picker-panel--nudge .qc-client-search {
    border-color: #8b1a2f;
    box-shadow: 0 0 0 2px rgba(139, 26, 47, 0.18);
  }

  .qc-record-btn--disabled,
  .qc-record-btn:disabled:not(.qc-record-btn--stop):not(.qc-record-btn--active) {
    background: rgba(139, 26, 47, 0.35);
    box-shadow: none;
    cursor: not-allowed;
  }

  .qc-save-status {
    width: 100%;
    margin: 0.375rem 0 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.95rem;
    text-align: center;
  }

  .qc-save-status--ok {
    color: #1a7a42;
    font-weight: 500;
  }

  .qc-save-status--error {
    color: #8b1a2f;
  }

  .qc-save-status--fade {
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  /* QC Meeting History search */
  body.quick-capture-active:not(.notes-full-view) #customerHistorySearchWrap {
    display: none !important;
  }

  .qc-meeting-history-search-wrap {
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    box-sizing: border-box;
  }

  .qc-meeting-history-search-wrap[hidden] {
    display: none !important;
  }

  .qc-meeting-history-search {
    position: relative;
    display: block;
    width: 100%;
  }

  .qc-meeting-history-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.38);
    pointer-events: none;
  }

  .qc-meeting-history-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
    padding: 0 2.5rem;
    border: 1.5px solid var(--cadence-border);
    border-radius: 8px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 44px;
    color: var(--cadence-text);
    background: var(--cadence-surface);
    -webkit-appearance: none;
    appearance: none;
  }

  .qc-meeting-history-search-input::placeholder {
    color: var(--cadence-text-tertiary);
  }

  .qc-meeting-history-search-input:focus {
    outline: none;
    border-color: #8B1A2B;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.25);
  }

  .qc-meeting-history-search-input::-webkit-search-cancel-button,
  .qc-meeting-history-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
  }

  .qc-meeting-history-search-clear {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.35rem;
    line-height: 1;
    color: rgba(0, 0, 0, 0.38);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .qc-meeting-history-search-clear[hidden] {
    display: none !important;
  }

  /* QC Meeting History — scannable list rows */
  .qc-meeting-history-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .qc-meeting-history-cards[hidden] {
    display: none !important;
  }

  .qc-history-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    width: 100%;
    min-height: 64px;
    margin: 0;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--cadence-border);
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: background 80ms ease, transform 80ms ease;
  }

  .qc-history-row:last-child {
    border-bottom: none;
  }

  .qc-history-row:active {
    background: var(--cadence-press);
    transform: scale(0.995);
  }

  .qc-history-row-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    line-height: 1.45;
  }

  .qc-history-card-date {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--cadence-text);
    letter-spacing: 0.01em;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .qc-history-card-preview {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: var(--cadence-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .qc-history-chevron {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 18px;
    color: var(--cadence-text-tertiary);
    line-height: 1;
  }

  /* Bottom sheet */
  body.qc-sheet-open {
    overflow: hidden;
  }

  .qc-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: block;
    pointer-events: auto;
    animation: qc-overlay-fade-in 0.3s ease;
  }

  .qc-sheet-overlay[hidden] {
    display: none !important;
  }

  .qc-sheet-overlay--closing {
    animation: qc-overlay-fade-out 0.3s ease forwards;
  }

  .qc-sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  .qc-bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    background: var(--ev-white);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    animation: qc-sheet-slide-up 0.3s ease;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .qc-bottom-sheet--closing {
    animation: qc-sheet-slide-down 0.3s ease forwards;
  }

  .qc-bottom-sheet--dragging {
    animation: none;
    transition: none;
  }

  @keyframes qc-sheet-slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  @keyframes qc-sheet-slide-down {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(100%);
    }
  }

  @keyframes qc-overlay-fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes qc-overlay-fade-out {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }

  .qc-sheet-handle {
    width: 40px;
    height: 4px;
    margin: 0.65rem auto 0.35rem;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.22);
    background-clip: content-box;
    border-radius: 2px;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
    box-sizing: content-box;
  }

  .qc-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 1rem 0.65rem;
    border-bottom: 1px solid var(--ev-border-subtle);
    flex-shrink: 0;
  }

  .qc-sheet-close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: -0.35rem -0.35rem 0 0;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.65rem;
    line-height: 1;
    color: rgba(0, 0, 0, 0.38);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .qc-sheet-close:active {
    color: rgba(0, 0, 0, 0.55);
  }

  .qc-sheet-title {
    margin: 0;
    flex: 1 1 auto;
    padding-top: 0.15rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ev-charcoal);
  }

  .qc-sheet-content {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
    min-height: 0;
  }

  .qc-sheet-notes-editable {
    min-height: 8rem;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ev-charcoal);
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
  }

  .qc-sheet-summary-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ev-charcoal);
  }

  .qc-sheet-summary-list li {
    margin-bottom: 0.45rem;
  }

  .qc-sheet-empty {
    margin: 0;
    color: var(--ev-gray);
    font-size: 0.95rem;
  }

  .qc-sheet-actions,
  .qc-sheet-secondary {
    flex-shrink: 0;
    padding: 0.65rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .qc-sheet-secondary[hidden] {
    display: none !important;
  }

  .qc-sheet-delete {
    flex-shrink: 0;
    margin: 0.65rem 1rem 1rem;
    padding: 0.35rem;
    border: none;
    background: none;
    font-size: 0.82rem;
    color: rgba(166, 61, 74, 0.85);
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
    min-height: 44px;
  }

  /* Full-screen email (QC communicate) */
  .qc-email-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 6500;
    background: var(--ev-white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .qc-email-fullscreen[hidden] {
    display: none !important;
  }

  .qc-email-fullscreen-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ev-border-subtle);
  }

  .qc-email-back {
    border: none;
    background: none;
    padding: 0.35rem 0;
    font-size: 0.95rem;
    color: var(--ev-charcoal);
    min-height: 44px;
    cursor: pointer;
  }

  .qc-email-fullscreen-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
  }

  .qc-email-fullscreen-preview {
    margin: 0;
  }

  .qc-email-fullscreen-actions {
    flex-shrink: 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-top: 1px solid var(--ev-border-subtle);
  }

  .qc-capture-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .qc-capture-primary[hidden] {
    display: none !important;
  }

  .qc-post-capture {
    width: 100%;
  }

  .qc-post-capture[hidden] {
    display: none !important;
  }

  .qc-screen-capture {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    padding-top: 0.25rem;
  }

  .qc-client-banner {
    display: none !important;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-record-wrap {
    margin: 0;
  }

  .qc-record-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
    position: relative;
  }

  .qc-record-hint {
    width: 100%;
    margin: 8px 0 0;
    padding: 0 0.5rem;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--cadence-text-tertiary);
    text-align: center;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture:has(.qc-record-btn--active) .qc-record-hint,
  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture:has(#qcTranscribing:not([hidden])) .qc-record-hint,
  body.quick-capture-active:not(.notes-full-view) .qc-record-wrap[hidden] ~ .qc-record-hint {
    display: none;
  }

  .qc-record-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #8B1A2B;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(139, 26, 43, 0.32);
    transition: transform 80ms ease, background 80ms ease, box-shadow 80ms ease, opacity 80ms ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
  }

  .qc-record-btn:active {
    transform: scale(0.97);
  }

  .qc-record-btn:disabled:not(.qc-record-btn--stop):not(.qc-record-btn--active) {
    cursor: not-allowed;
  }

  .qc-record-btn--active,
  .qc-record-btn--stop {
    background: #c41e3a;
    color: #fff;
    box-shadow: 0 8px 28px rgba(196, 30, 58, 0.45);
    animation: none;
  }

  .qc-record-btn--active::before,
  .qc-record-btn--stop::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid rgba(196, 30, 58, 0.45);
    animation: qc-record-ring-pulse 1.4s ease-in-out infinite;
    pointer-events: none;
  }

  @keyframes qc-record-ring-pulse {
    0%,
    100% {
      transform: scale(1);
      opacity: 1;
    }
    50% {
      transform: scale(1.06);
      opacity: 0.55;
    }
  }

  .qc-record-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
  }

  .qc-record-action-label {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ev-charcoal);
  }

  .qc-record-btn--active ~ .qc-record-action-label,
  .qc-record-btn--stop ~ .qc-record-action-label {
    font-size: 0;
    line-height: 0;
  }

  .qc-record-btn--active ~ .qc-record-action-label::after,
  .qc-record-btn--stop ~ .qc-record-action-label::after {
    content: 'Recording…';
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 0.18em;
  }

  .qc-record-timer {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #c41e3a;
    letter-spacing: 0.02em;
    line-height: 1.3;
  }

  .qc-record-timer[hidden] {
    display: none !important;
  }

  .qc-transcribing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 12px 0 8px;
    font-size: 0.95rem;
    color: var(--ev-gray);
  }

  .qc-transcribing[hidden] {
    display: none !important;
  }

  .qc-transcribing-visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .qc-record-btn--transcribing-visual {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    background: rgba(139, 26, 43, 0.45);
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    opacity: 0.72;
  }

  .qc-transcribing-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ev-charcoal);
  }

  .qc-transcribing-label .qc-spinner {
    border-top-color: #8b1a2f;
  }

  /* Multi-segment meeting session */
  .qc-session-panel {
    width: 100%;
    margin: 0.75rem 0 0;
    padding: 0;
    box-sizing: border-box;
  }

  .qc-session-panel[hidden] {
    display: none !important;
  }

  .qc-session-segment-count {
    margin: 0 0 0.4rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.48);
    text-align: left;
  }

  .qc-session-segment-count[hidden] {
    display: none !important;
  }

  .qc-session-transcript {
    width: 100%;
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    background: var(--cadence-surface);
    border: 1px solid var(--cadence-border);
    box-shadow: var(--cadence-shadow);
    box-sizing: border-box;
    text-align: left;
  }

  .qc-session-transcript-empty {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(0, 0, 0, 0.42);
    font-style: italic;
  }

  .qc-session-segment + .qc-session-segment {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .qc-session-segment-label {
    margin: 0 0 0.25rem;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cadence-text-tertiary);
  }

  .qc-session-segment-text {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ev-charcoal);
    white-space: pre-wrap;
    word-break: break-word;
  }

  .qc-session-save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin: 0.75rem 0 0;
    padding: 0 1.25rem;
    border: none;
    border-radius: 6px;
    background: #8B1A2B;
    color: #fff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: transform 80ms ease, background 80ms ease;
  }

  .qc-session-save-btn[hidden] {
    display: none !important;
  }

  .qc-session-save-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .qc-session-save-btn:active:not(:disabled) {
    transform: scale(0.97);
    background: #6E1522;
  }

  .qc-session-discard {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0.35rem 0 0;
    padding: 0.5rem;
    border: none;
    background: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.45);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
    text-align: center;
  }

  .qc-session-discard[hidden] {
    display: none !important;
  }

  /* Mobile capture — photo / audio / document upload row */
  .qc-mobile-upload {
    width: 100%;
    margin-top: 12px;
    margin-bottom: 0;
    box-sizing: border-box;
  }

  .qc-mobile-upload[hidden] {
    display: none !important;
  }

  body.notes-full-view .qc-mobile-upload {
    display: none !important;
  }

  .qc-mobile-upload-label {
    margin: 0 0 8px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9b9390;
    text-align: center;
  }

  .qc-mobile-upload-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .qc-mobile-upload-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    margin: 0;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1.5px solid #e8e4df;
    border-radius: 8px;
    background: #ffffff;
    color: #6b6460;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .qc-mobile-upload-btn:active:not(:disabled):not(.qc-mobile-upload-btn--disabled) {
    background: #f8f7f5;
    border-color: #8b1a2b;
  }

  .qc-mobile-upload-btn:disabled,
  .qc-mobile-upload-btn--disabled {
    opacity: 0.5;
    pointer-events: none;
  }

  .qc-mobile-upload-icon {
    display: block;
    font-size: 22px;
    line-height: 1;
    color: #8b1a2b;
  }

  .qc-mobile-upload-text {
    display: block;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    color: #6b6460;
  }

  .qc-mobile-upload-status {
    margin: 10px 0 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #6b6460;
    text-align: center;
  }

  .qc-mobile-upload-status[hidden] {
    display: none !important;
  }

  .qc-mobile-upload-status--processing::after {
    display: inline-block;
    width: 1.25em;
    text-align: left;
    vertical-align: bottom;
    overflow: hidden;
    animation: qc-mobile-upload-ellipsis 1.2s steps(4, end) infinite;
    content: '…';
  }

  @keyframes qc-mobile-upload-ellipsis {
    0% {
      width: 0;
    }
    100% {
      width: 1.25em;
    }
  }

  .qc-mobile-upload-status--success {
    color: #2d7a4f;
  }

  .qc-mobile-upload-status--error {
    color: #8b1a2b;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture.qc-phase--recording .qc-record-action-label,
  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture.qc-phase--between .qc-record-action-label {
    font-size: 11px;
    line-height: 1.4;
  }

  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture.qc-phase--recording .qc-record-action-label::after,
  body.quick-capture-active:not(.notes-full-view) .qc-phase-capture.qc-phase--between .qc-record-action-label::after {
    content: none;
  }

  .qc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--ev-border-subtle);
    border-top-color: var(--ev-charcoal);
    border-radius: 50%;
    animation: qc-spin 0.7s linear infinite;
  }

  @keyframes qc-spin {
    to {
      transform: rotate(360deg);
    }
  }

  .qc-link-btn {
    margin: 0.25rem 0 0;
    padding: 0.5rem;
    border: none;
    background: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ev-gray);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
    min-height: 44px;
  }

  .qc-panel {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0;
    box-sizing: border-box;
  }

  .qc-panel-title {
    margin: 0 0 0.65rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ev-charcoal);
    text-align: left;
  }

  .qc-transcript-text,
  .qc-email-body {
    padding: 1rem;
    background: var(--ev-light);
    border: 1px solid var(--ev-border-subtle);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ev-charcoal);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: min(40vh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
  }

  .qc-match-prompt {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--ev-charcoal);
    text-align: center;
  }

  .qc-match-address {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.5);
    text-align: center;
  }

  .qc-multi-match-prompt {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ev-charcoal);
    text-align: center;
  }

  .qc-multi-match-list {
    margin-top: 0;
  }

  .qc-match-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .qc-picker-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ev-charcoal);
  }

  .qc-pre-capture-picker--collapsed .qc-client-list {
    display: none !important;
  }

  .qc-pre-capture-picker--collapsed .qc-client-search-field {
    margin-bottom: 0;
  }

  .qc-pre-capture-picker--collapsed .qc-client-search {
    font-weight: 500;
    color: var(--ev-charcoal);
    background: var(--ev-light);
  }

  .qc-client-search {
    width: 100%;
    min-height: 52px;
    margin-bottom: 0;
    padding: 0.75rem 2.75rem 0.75rem 2.5rem;
    border: 1.5px solid var(--cadence-border);
    border-radius: 8px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    box-sizing: border-box;
    background: var(--cadence-surface);
    color: var(--cadence-text);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .qc-client-search:focus {
    outline: none;
    border-color: #8B1A2B;
    box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.25);
  }

  .qc-client-search::placeholder {
    color: var(--cadence-text-tertiary);
  }

  body.cadence-voice-capturing .qc-client-search,
  body.cadence-voice-capturing .customer-history-search-input,
  body.cadence-voice-capturing .qc-meeting-history-search-input {
    pointer-events: none;
    caret-color: transparent;
  }

  body.cadence-voice-capturing .qc-pre-capture-picker {
    pointer-events: none;
  }

  .qc-client-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(32vh, 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--ev-border-subtle);
    border-radius: 8px;
    background: var(--ev-white);
  }

  .qc-client-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 2.25rem 8px 1rem;
    border: none;
    border-bottom: 1px solid var(--ev-border-subtle);
    border-left: 3px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--ev-charcoal);
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
  }

  .qc-client-item--selected {
    border-left-color: #8b1a2f;
    background: rgba(139, 26, 47, 0.05);
  }

  .qc-client-item-check {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 600;
    color: #8b1a2f;
    line-height: 1;
  }

  .qc-client-item-name {
    display: block;
    font-weight: 500;
  }

  .qc-client-item-address {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: rgba(0, 0, 0, 0.5);
  }

  .qc-client-item:last-child {
    border-bottom: none;
  }

  .qc-client-item:active {
    background: var(--ev-light);
  }

  .qc-client-empty {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--ev-gray);
    font-style: italic;
    text-align: center;
  }

  .qc-confirmed-client {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    color: var(--ev-gray);
    text-align: center;
  }

  .qc-btn-full {
    width: 100%;
    min-height: 52px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }

  .qc-btn-full.is-loading {
    opacity: 0.85;
    cursor: wait;
  }

  .qc-history-link {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    text-align: center;
  }

  .qc-save-status {
    width: 100%;
    max-width: 22rem;
    margin: 0.5rem auto 0;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    line-height: 1.35;
    text-align: center;
    box-sizing: border-box;
    transition: opacity 0.35s ease;
  }

  .qc-save-status--ok {
    background: rgba(34, 120, 70, 0.12);
    color: #1a6b3f;
    border: 1px solid rgba(34, 120, 70, 0.25);
  }

  .qc-save-status--error {
    background: rgba(178, 34, 34, 0.1);
    color: var(--ev-burgundy, #8b0000);
    border: 1px solid rgba(178, 34, 34, 0.25);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .qc-save-status--fade {
    opacity: 0;
  }

  .qc-full-view-link {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    padding: 0.5rem 0.65rem;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--ev-gray);
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
  }

  .qc-full-view-link[hidden] {
    display: none !important;
  }
}

/* Client pattern briefing card — mobile + desktop Client Intelligence */
.client-briefing-card,
.notes-field-grid > .client-briefing-card {
  width: 100%;
  grid-column: 1 / -1;
  margin: 0 0 1rem;
  padding: 0;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e8e4df;
  border-left: 3px solid #8b1a2b;
  box-shadow: 0 2px 12px rgba(26, 22, 20, 0.08);
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
}

.client-briefing-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.client-briefing-icon {
  flex-shrink: 0;
  font-size: 16px;
  color: #8b1a2b;
  line-height: 1;
}

.client-briefing-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.client-briefing-title {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1614;
}

.client-briefing-subtitle {
  margin-top: 2px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #9b9390;
}

.client-briefing-chevron {
  flex-shrink: 0;
  font-size: 18px;
  color: #9b9390;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.client-briefing-card.is-collapsed .client-briefing-chevron {
  transform: rotate(0deg);
}

.client-briefing-body {
  padding: 0 14px 14px;
}

.client-briefing-card.is-collapsed .client-briefing-body {
  display: none;
}

.client-briefing-section + .client-briefing-section {
  margin-top: 14px;
}

.client-briefing-section-label {
  margin: 0 0 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6460;
}

.client-briefing-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-briefing-theme-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #e8e4df;
  border-radius: 999px;
  background: #f8f7f5;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 80ms ease, transform 80ms ease;
}

.client-briefing-theme-pill:active {
  transform: scale(0.97);
}

.client-briefing-theme-pill.is-expanded {
  border-radius: 10px;
  width: 100%;
}

.client-briefing-theme-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1a1614;
}

.client-briefing-theme-insight {
  display: block;
  margin-top: 6px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
  color: #6b6460;
}

.client-briefing-theme-insight[hidden] {
  display: none !important;
}

.client-briefing-signals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-briefing-signal-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-briefing-signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b1a2b;
  flex-shrink: 0;
}

.client-briefing-signal-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1614;
}

.client-briefing-signal-insight {
  margin: 4px 0 0 16px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #6b6460;
}

.client-briefing-coaching-tip {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fdf8f0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  color: #6b6460;
}

.client-briefing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e8e4df;
}

.client-briefing-updated {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: #9b9390;
}

.client-briefing-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  color: #6b6460;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.client-briefing-refresh:active {
  transform: scale(0.97);
  background: #f0edea;
}

.client-briefing-refresh.is-loading {
  opacity: 0.45;
  pointer-events: none;
  animation: client-briefing-spin 0.8s linear infinite;
}

@keyframes client-briefing-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes client-briefing-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes client-briefing-insight-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Client Briefing — mobile portrait overrides (after desktop base) */
@media (max-width: 768px) {
  #qcPhaseCapture > .client-briefing-card,
  body.quick-capture-active:not(.notes-full-view) .client-briefing-card,
  .main.notes-page .notes-field-grid > .client-briefing-card {
    order: 8;
    width: 100%;
    max-width: 100%;
    margin: 12px 0 0;
    padding: 16px;
    border-radius: 14px;
    border: none;
    border-left: 3px solid #8b1a2b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    box-sizing: border-box;
  }

  body.quick-capture-active:not(.notes-full-view) #qcPhaseCapture > .client-briefing-card.is-collapsed {
    padding: 0 14px;
  }

  .main.notes-page .notes-field-grid > .client-briefing-card {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 0;
  }

  body.quick-capture-active:not(.notes-full-view) #qcPhaseCapture > .client-briefing-card.is-collapsed .client-briefing-header {
    min-height: 44px;
    height: 44px;
    padding: 0;
  }

  .client-briefing-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    margin: 0;
    min-height: 44px;
    transition: transform 80ms ease;
  }

  .client-briefing-header:active {
    transform: scale(0.99);
  }

  .client-briefing-icon {
    flex-shrink: 0;
    font-size: 12px;
    color: #8b1a2b;
    line-height: 1;
    margin: 0 6px 0 0;
    align-self: flex-start;
    margin-top: 3px;
  }

  .client-briefing-title {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: #1a1614;
    line-height: 1.3;
  }

  .client-briefing-subtitle {
    font-size: 11px;
    color: #9b9390;
    margin-top: 2px;
    line-height: 1.35;
  }

  .client-briefing-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: -6px -10px -6px 0;
    font-size: 0;
    color: #9b9390;
    transform: none;
    transition: transform 80ms ease;
  }

  .client-briefing-chevron::before {
    content: '▾';
    font-size: 16px;
    line-height: 1;
  }

  .client-briefing-card.is-collapsed .client-briefing-chevron {
    transform: none;
  }

  .client-briefing-card.is-collapsed .client-briefing-chevron::before {
    content: '▸';
  }

  .client-briefing-body {
    display: block;
    max-height: 2400px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 1;
    transition: max-height 300ms ease-in-out, opacity 300ms ease-in-out, margin 300ms ease-in-out;
  }

  .client-briefing-card.is-collapsed .client-briefing-body {
    display: block;
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .client-briefing-card.is-loading:not(.is-collapsed) .client-briefing-body {
    max-height: 2400px;
    opacity: 1;
    pointer-events: none;
    position: relative;
  }

  .client-briefing-section + .client-briefing-section {
    margin-top: 0;
  }

  .client-briefing-section-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9b9390;
    margin: 0 0 8px;
  }

  .client-briefing-section:first-child .client-briefing-section-label {
    margin-top: 14px;
  }

  .client-briefing-section + .client-briefing-section .client-briefing-section-label {
    margin-top: 16px;
    margin-bottom: 10px;
  }

  .client-briefing-section:has(.client-briefing-coaching-tip) .client-briefing-section-label {
    margin-top: 16px;
    margin-bottom: 8px;
  }

  /* ── Progressive disclosure toggles ── */
  .client-briefing-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #8b1a2b;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 80ms ease, opacity 80ms ease;
  }

  .client-briefing-section-toggle:active {
    transform: scale(0.97);
  }

  .client-briefing-section-toggle[hidden] {
    display: none !important;
  }

  .client-briefing-toggle-chevron {
    display: inline-block;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 400;
    color: #9b9390;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 200ms ease;
  }

  .client-briefing-section.is-expanded .client-briefing-toggle-chevron {
    transform: rotate(180deg);
  }

  /* ── Recurring themes (preview → all) ── */
  .client-briefing-themes {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: max-height 250ms ease;
  }

  .client-briefing-section--themes-many:not(.is-expanded) .client-briefing-themes {
    max-height: 32px;
  }

  .client-briefing-section--themes-many.is-expanded .client-briefing-themes {
    max-height: 480px;
  }

  .client-briefing-section--themes-many .client-briefing-theme-pill:nth-child(n + 3) {
    display: none;
  }

  .client-briefing-section--themes-many.is-expanded .client-briefing-theme-pill:nth-child(n + 3) {
    display: inline-flex;
  }

  .client-briefing-theme-pill {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    max-width: 100%;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #e8e4df;
    border-radius: 20px;
    background: #f8f7f5;
    white-space: nowrap;
    pointer-events: none;
    transition: transform 80ms ease;
  }

  .client-briefing-theme-label {
    font-size: 12px;
    font-weight: 500;
    color: #1a1614;
    line-height: 1.3;
  }

  .client-briefing-theme-insight {
    display: none !important;
  }

  /* ── Signals (label rows → insight accordion) ── */
  .client-briefing-signals {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .client-briefing-signals > .client-briefing-signal:nth-child(n + 5) {
    display: none;
  }

  .client-briefing-signal {
    display: block;
    margin-bottom: 0;
  }

  .client-briefing-signal-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 80ms ease;
  }

  .client-briefing-signal-head:active {
    transform: scale(0.99);
  }

  .client-briefing-signal-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin: 0;
    border-radius: 50%;
    background: #8b1a2b;
  }

  .client-briefing-signal-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1614;
    line-height: 1.3;
  }

  .client-briefing-signal-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: #9b9390;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 200ms ease;
  }

  .client-briefing-signal-chevron::before {
    content: '▾';
  }

  .client-briefing-signal.is-expanded .client-briefing-signal-chevron {
    transform: rotate(180deg);
  }

  .client-briefing-signal-insight-wrap {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 200ms ease, opacity 200ms ease, margin 200ms ease;
  }

  .client-briefing-signal.is-expanded .client-briefing-signal-insight-wrap {
    max-height: 200px;
    opacity: 1;
    margin: 0 0 8px 16px;
  }

  .client-briefing-signal-insight {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #6b6460;
    line-height: 1.5;
  }

  /* ── Coaching tip (clamp → full) ── */
  .client-briefing-coaching-tip {
    margin: 0;
    padding: 12px 14px;
    background: #fdf8f0;
    border: 1px solid #f0e8d8;
    border-radius: 8px;
    font-size: 13px;
    font-style: italic;
    color: #4a3728;
    line-height: 1.6;
    max-height: 3.2em;
    overflow: hidden;
    transition: max-height 250ms ease;
  }

  .client-briefing-section--coaching.is-expanded .client-briefing-coaching-tip {
    max-height: 480px;
  }

  .client-briefing-section--coaching:not(.is-expanded) .client-briefing-coaching-tip {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .client-briefing-section--coaching.is-expanded .client-briefing-coaching-tip {
    display: block;
    -webkit-line-clamp: unset;
  }

  .client-briefing-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 0;
    border-top: none;
  }

  .client-briefing-updated {
    font-size: 11px;
    color: #9b9390;
    line-height: 1.35;
  }

  .client-briefing-refresh {
    min-width: 44px;
    min-height: 44px;
    margin: -6px -10px -6px 0;
    border-radius: 8px;
    font-size: 20px;
    color: #6b6460;
    transition: transform 80ms ease;
  }

  .client-briefing-refresh:active {
    transform: scale(0.97);
    background: transparent;
  }

  .client-briefing-refresh.is-loading {
    opacity: 1;
    pointer-events: none;
    animation: client-briefing-spin 600ms linear infinite;
  }

  .client-briefing-skeleton-pills {
    margin-top: 14px;
  }

  .client-briefing-skeleton-pills-inner {
    display: flex;
    gap: 6px;
    overflow: hidden;
  }

  .client-briefing-skeleton-pill {
    flex: 0 0 80px;
    width: 80px;
    height: 28px;
    border-radius: 20px;
    background: linear-gradient(90deg, #f0edea 25%, #e8e4df 50%, #f0edea 75%);
    background-size: 200% 100%;
    animation: client-briefing-shimmer 1.4s infinite;
  }

  .client-briefing-skeleton-signals {
    margin-top: 16px;
  }

  .client-briefing-skeleton-signal {
    height: 40px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0edea 25%, #e8e4df 50%, #f0edea 75%);
    background-size: 200% 100%;
    animation: client-briefing-shimmer 1.4s infinite;
  }

  .client-briefing-skeleton-tip {
    height: 60px;
    margin-top: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0edea 25%, #e8e4df 50%, #f0edea 75%);
    background-size: 200% 100%;
    animation: client-briefing-shimmer 1.4s infinite;
  }
}

/* Landscape phones — keep usable layout */
@media (max-width: 768px) and (orientation: landscape) {
  #noteSourceModal.note-source-modal--mobile .note-source-modal {
    height: 92dvh;
    max-height: 92dvh;
  }

  .upload-buttons {
    grid-template-columns: repeat(4, 1fr);
  }

  .upload-buttons .btn,
  .upload-buttons label.btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.35rem;
  }
}
