/* Comfortable reading and touch targets on phones and small tablets. */
.chart-mobile { display: none; }

@media (max-width: 760px) {
  :root { --muted: #596780; --green: #14715c; }
  body { font-size: 16px; line-height: 1.55; }
  .page-title { font-size: 28px; line-height: 1.2; }
  .page-description { font-size: 15px; color: #52607a; line-height: 1.65; }
  .eyebrow { font-size: 11px; color: #596780; letter-spacing: .09em; }
  .main { padding-top: 24px; }
  .heading-actions { flex-wrap: wrap; gap: 8px; }
  .button, .button.small, .heading-actions .button, .inline-actions .button,
  .card-header .button, .call-actions .button, .interview-footer .button,
  .action-card .button, .insight-card .button, .study-footer .button {
    font-size: 14px; font-weight: 600; min-height: 44px; padding: 11px 14px;
  }
  .button.secondary { color: #42516c; }
  .button.ghost, .text-link, .back-link { color: #6439a4; }
  .text-link, .back-link { font-size: 14px; line-height: 1.6; }
  .icon-button, .close-button, .top-actions .icon-button,
  .sidebar-user .icon-button, .question-actions .icon-button {
    width: 44px; height: 44px; flex-shrink: 0; color: #52607a;
  }
  .icon-button .icon, .button .icon { width: 18px; height: 18px; }

  /* Navigation: reserve the header for the current page and its actions. */
  .topbar { padding: 0 14px; height: 68px; gap: 8px; }
  .breadcrumb { font-size: 14px; gap: 6px; min-width: 0; }
  .breadcrumb > span { display: none; }
  .breadcrumb strong { color: #35435d; font-weight: 600; line-height: 1.3; }
  .top-actions { gap: 6px; flex-shrink: 0; }
  .top-actions .demo-pill { display: none; }
  .sidebar { width: min(300px, calc(100vw - 48px)); }
  .nav-item { font-size: 15px; min-height: 48px; color: #c4cde0; }
  .nav-label { font-size: 11px; color: #a6b3ce; }
  .nav-badge { font-size: 12px; }
  .workspace strong { font-size: 14px; color: #f1f4fc; }
  .workspace small, .sidebar-user .user-info span, .roadmap-promo span {
    font-size: 12px; color: #b6c1d8;
  }
  .sidebar-user .user-info strong { font-size: 13px; color: #f1f4fc; }
  .sidebar-user .icon-button { color: #c4cde0; }
  .roadmap-promo strong { font-size: 13px; color: #dfd0fb; }

  /* Dashboard and tabular data. */
  .welcome-note { padding: 16px; }
  .welcome-note strong { font-size: 14px; color: #59417b; }
  .welcome-note > div > span:not(.live-dot), .welcome-note > div > span:last-child {
    font-size: 13px; color: #645179; line-height: 1.6;
  }
  .welcome-note > a { font-size: 14px; color: #603b92; padding: 8px 0; }
  .date-filter { padding: 10px 10px; min-height: 44px; }
  .date-filter select { font-size: 16px; color: #35435d; }
  .stat-card { padding: 16px 14px; }
  .stat-top { font-size: 13px; line-height: 1.45; color: #465570; align-items: flex-start; }
  .stat-icon { width: 24px; height: 24px; }
  .stat-value { font-size: 32px; margin: 14px 0 10px; }
  .stat-value small, .stat-foot { font-size: 12px; color: #596780; line-height: 1.6; }
  .card-header { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .card-header > div { flex: 1 1 180px; min-width: 0; }
  .card-title { font-size: 17px; line-height: 1.45; color: #283851; }
  .card-subtitle { font-size: 13px; line-height: 1.6; color: #596780; }
  .legend, .card-header .legend span { font-size: 12px; color: #52607a; }
  .chart-desktop { display: none; }
  .chart .chart-mobile { display: block; max-height: none; }
  .chart-labels { font-size: 12px; color: #596780; }
  .donut-center span, .donut-center small { font-size: 12px; color: #596780; }
  .channel-row, .channel-row strong { font-size: 14px; color: #465570; }
  .channel-row small, .channel-row strong small { font-size: 12px; color: #596780; }
  .table-wrap table, .table-wrap td, .cell-title { font-size: 14px; color: #35435d; }
  .table-wrap th { font-size: 11px; color: #52607a; }
  .cell-subtitle, .table-wrap td.cell-subtitle { font-size: 12px; color: #596780; }
  .table-progress, .table-progress strong { font-size: 13px; color: #465570; }
  .table-progress small { font-size: 12px; color: #596780; }
  .badge { font-size: 11px; font-weight: 600; }
  .badge.gray { color: #52607a; }
  .badge.purple { color: #664291; }
  .badge.green { color: #216951; }
  .badge.orange { color: #805215; }
  .badge.blue { color: #355e9d; }
  .activity-item strong { font-size: 14px; color: #35435d; font-weight: 600; }
  .activity-item small { font-size: 13px; color: #596780; }
  .app-footer { font-size: 12px; line-height: 1.6; color: #596780; flex-wrap: wrap; }
  .app-footer > span:first-child { max-width: none; }
  .app-footer i { color: #596780; }

  /* Forms, filters and questionnaire editing. */
  .field, .field label, label.field-label, .login-form .field,
  .report-toolbar .field, .switch-row label { font-size: 14px; font-weight: 600; color: #465570; }
  .field > label > span { color: #596780; }
  .field input, .field select, .field textarea, input[type=text], input[type=email],
  input[type=password], input[type=number], input[type=date], select, textarea,
  .login-form .field input, .login-form select, .search-field input,
  .compact-select select, .report-toolbar select, .preview-question textarea {
    font-size: 16px; color: #283851; min-height: 48px; border-color: #bbc5d5;
  }
  input::placeholder, textarea::placeholder { color: #64708a; opacity: 1; }
  .form-help, .form-error, .demo-login-help { font-size: 12px; line-height: 1.65; }
  .form-help, .demo-login-help { color: #596780; }
  .form-error { color: #a13546; }
  .checkbox-label, .permission-list label, .switch-row p { font-size: 14px; color: #52607a; }
  .filter-tab, .section-tab { font-size: 14px; min-height: 44px; color: #52607a; }
  .filter-tab > span, .filter-tab.active > span { font-size: 12px; color: #664291; }
  .filter-tabs { justify-content: flex-start; }
  .section-tabs { gap: 22px; }
  .toolbox-button { font-size: 14px; min-height: 48px; color: #465570; }
  .question-title, .preview-question legend { font-size: 16px; color: #35435d; font-weight: 600; }
  .question-option, .answer-option, .preview-question .answer-option {
    font-size: 15px; color: #465570; line-height: 1.6; min-height: 48px;
  }
  .question-top .question-type, .question-type, .question-top > .required,
  .question-top > .muted, .builder-heading > span > .muted { font-size: 12px; color: #645179; }
  .question-number, .scale-preview > span, .scale-inputs .answer-option { font-size: 14px; }
  .question-top { gap: 10px; }
  .question-actions { margin-left: auto; }
  .scale-preview { grid-template-columns: repeat(6, minmax(0, 1fr)); flex-wrap: wrap; }
  .scale-preview > span { flex: 1 0 13%; min-height: 38px; color: #52607a; }
  .builder-toolbox p, .builder-tip p { font-size: 13px; color: #596780; }
  .builder-tip strong, .builder-toolbox h3 { font-size: 14px; color: #465570; }
  .modal-header h2 { font-size: 22px; }
  .modal-body > p { font-size: 15px; color: #52607a; }
  .toast { font-size: 14px; }

  /* Research, reports and operation screens. */
  .study-card h3, .contact-card .card-body > h3, .interview-idle h3 { font-size: 18px; color: #35435d; }
  .study-card > p, .template-card p, .template-intro > p, .detail-banner p,
  .action-card p, .module-list > li, .vision-note p, .client-metric ~ p,
  .interview-idle p, .interview-complete p, .interview-card .script-block p {
    font-size: 15px; color: #52607a; line-height: 1.7;
  }
  .study-meta, .study-footer, .template-card .study-footer > span,
  .review-context p, .contact-card .card-body > .muted, .contact-card .call-status,
  .journey-step > small, .journey-step > span { font-size: 12px; color: #596780; }
  .study-meta, .study-footer { flex-wrap: wrap; }
  .journey-step > strong, .compact-list > div, .compact-list strong { font-size: 14px; color: #465570; }
  .quota-item, .quota-heading strong { font-size: 14px; color: #465570; }
  .quota-item small { font-size: 12px; color: #596780; }
  .report-study-select { width: 100%; max-width: none; margin-bottom: 16px; }
  .report-toolbar .field { min-width: 0; }
  .report-toolbar-note { font-size: 12px; color: #596780; line-height: 1.6; }
  .report-bar { font-size: 15px; color: #465570; }
  .report-bar > div:first-child { gap: 16px; align-items: flex-start; }
  .report-bar > div:first-child > span { flex: 1; min-width: 0; }
  .report-bar strong { flex-shrink: 0; color: #283851; }
  .report-bar small { font-size: 12px; color: #596780; }
  .report-summary { font-size: 15px; color: #645179; }
  .insight-label { font-size: 11px; color: #645179; }
  .insight-card h2, .vision-note h2 { color: #59417b; }
  .insight-card p { font-size: 15px; color: #645179; line-height: 1.75; }
  .insight-card .badge { font-size: 11px; white-space: normal; }
  .insight-card .button { color: #643b8f; max-width: 100%; }
  .quotes-grid blockquote { font-size: 15px; color: #465570; line-height: 1.75; }
  .quotes-grid cite { font-size: 12px; color: #596780; }
  .interview-card .script-block h2, .interview-question { color: #59417b; }
  .contact-card .phone-display, .interview-complete h2, .survey-preview > h2,
  .action-card h2, .roadmap-card h2, .template-card h2 { color: #35435d; }
  .client-metric strong { color: #664291; }
  .client-metric span { font-size: 13px; color: #645179; }
  .info-banner, .info-banner > div > span { font-size: 14px; color: #645179; }

  /* Login: readable labels and a clear, generous primary action. */
  .login-story { padding: 24px 24px 30px; }
  .login-story > .prototype-label { font-size: 11px; color: #c5b4e0; letter-spacing: .08em; }
  .login-story h1 { font-size: 36px; line-height: 1.15; }
  .login-story > p { font-size: 15px; color: #c4cde0; line-height: 1.65; }
  .login-panel { padding: 28px 24px 82px; }
  .login-form > h2 { font-size: 30px; font-weight: 600; color: #283851; }
  .login-form > p { font-size: 16px; color: #52607a; line-height: 1.65; }
  .login-form > .badge { font-size: 11px; color: #664291; letter-spacing: .025em; }
  .workspace-preview { padding: 14px; }
  .workspace-preview strong { font-size: 15px; color: #35435d; font-weight: 600; }
  .workspace-preview small { font-size: 12px; color: #596780; }
  .demo-login-credentials { gap: 6px; }
  .demo-login-credentials input { letter-spacing: 0; }
  .login-form .login-submit { font-size: 16px; min-height: 52px; }
  .login-form .feature-list { font-size: 14px; color: #52607a; gap: 12px; }
  .login-form .feature-list .icon { color: #6c4e9b; width: 16px; height: 16px; }
  .login-form > .login-demo-note { font-size: 12px; line-height: 1.7; color: #645179; }
  .login-site-link { font-size: 14px; color: #643b8f; min-height: 44px; bottom: 20px; }
}

@media (max-width: 350px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-story h1 { font-size: 32px; }
  .login-form > h2 { font-size: 27px; }
  .login-story, .login-panel { padding-left: 20px; padding-right: 20px; }
}

/* Each local interview stays readable without horizontal scrolling. */
@media (max-width: 760px) {
  #cati-history .table-wrap table { white-space: normal; }
  #cati-history thead { display: none; }
  #cati-history tbody { display: block; }
  #cati-history tbody tr { display: grid; grid-template-columns: 1fr 1fr; padding: 16px; gap: 14px; border-top: 1px solid var(--line); }
  #cati-history tbody td, #cati-history tbody td.cell-subtitle { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  #cati-history td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #596780; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
  #cati-history td:last-child, #cati-history td[colspan] { grid-column: 1 / -1; }
  #cati-history td:last-child .button { width: 100%; }
}
