/* Mobile and tablet presentation. Load after styles.css. */
@media screen and (max-width: 900px) {
  :root { --muted: #687180; --sub: #4b5362; }

  .app-shell, .presentation-mode .app-shell { display: block; }
  .workspace { width: 100%; min-width: 0; }
  .sidebar {
    width: min(292px, calc(100vw - 48px));
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-100%);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform .2s;
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .mobile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: #171c354d;
  }
  .mobile-menu, .mobile-close {
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin: 0;
  }
  .mobile-brand { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; padding: 7px; flex-shrink: 0; }
  .mobile-brand .brand-icon { width: 26px; max-height: 30px; }
  .public-nav .brand-image { width: 132px; max-width: 100%; }
  .public-footer .brand-image { width: 112px; max-width: 100%; }
  .preview-sidebar .brand-image { width: 104px; max-width: 100%; }
  .mobile-close { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; }
  .sidebar > .brand-button { margin: 2px 42px 22px 10px; align-self: flex-start; }
  .sidebar-bottom { margin-top: 24px; }
  .nav-item { min-height: 46px; padding: 11px 12px; font-size: 14px; }
  .nav-label { font-size: 11px; }
  .workspace-switch { font-size: 13px; margin-bottom: 22px; }
  .workspace-switch small, .reviewer, .demo-card .flex { font-size: 12px; }
  .reviewer p, .demo-card p { font-size: 12px; line-height: 1.7; }
  .demo-card .link-btn { font-size: 13px; min-height: 44px; margin-top: 4px; }

  .topbar, .presentation-mode .topbar {
    min-height: calc(64px + env(safe-area-inset-top));
    height: auto;
    padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    gap: 8px;
  }
  .breadcrumb { flex: 1 1 auto; min-width: 0; gap: 4px; font-size: 12px; }
  .breadcrumb > span:not(.mono), .breadcrumb > svg:first-of-type { display: none; }
  .breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .breadcrumb > .mono { display: none; }
  .breadcrumb > svg { display: none; }
  .topbar-actions { flex: 0 0 auto; gap: 4px; }
  .topbar-actions .demo-label, .topbar-actions .desktop-search { display: none; }
  .topbar .btn { min-height: 44px; font-size: 12px; padding: 10px 12px; gap: 7px; }
  .topbar .icon-btn { width: 44px; height: 44px; }
  .topbar [data-action="presentation"] {
    width: 44px;
    min-width: 44px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }
  .topbar [data-action="presentation"] svg { width: 19px; height: 19px; }

  .app-content, .presentation-mode .app-content {
    padding: 24px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
    min-width: 0;
    min-height: calc(100dvh - 126px);
  }
  .app-content :where(.flex, .between) > *, .panel, .stack, .grow,
  .overview-grid > *, .mission-layout > *, .control-layout > *, .evidence-layout > *,
  .settings-grid > *, .agent-grid > *, .stat-grid > * { min-width: 0; }
  .btn { min-height: 44px; max-width: 100%; font-size: 14px; line-height: 1.4; padding: 10px 14px; }
  .icon-btn { width: 44px; height: 44px; min-width: 44px; }
  .icon, .icon.sm { width: 18px; height: 18px; }
  input, select, textarea, .search-field input, .filter-select,
  .form-section textarea, .review-panel textarea,
  .modal-field input, .modal-field select, .modal-field textarea {
    font-size: 16px;
    min-height: 46px;
  }
  textarea { line-height: 1.6; }
  .field-label { font-size: 14px; }
  .field-help { font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
  .small { font-size: 14px; }
  .tiny { font-size: 12px; }
  .eyebrow { font-size: 11px; }
  .badge { max-width: 100%; font-size: 12px !important; line-height: 1.5; white-space: normal !important; overflow-wrap: anywhere; }
  .panel-head { padding: 18px; flex-wrap: wrap; }
  .panel-head h2, .panel-head h3 { font-size: 15px; }
  .panel-body { padding: 18px; }
  .panel-foot { padding: 14px 18px; align-items: flex-start; flex-wrap: wrap; font-size: 12px; line-height: 1.75; }
  .panel-foot > span { min-width: 0; overflow-wrap: anywhere; }
  .page-head { display: flex; flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 24px; }
  .page-title-line { flex-wrap: wrap; gap: 8px; }
  .page-head h1 { font-size: 26px; line-height: 1.3; letter-spacing: -.9px; }
  .page-head p { max-width: none; font-size: 14px; line-height: 1.75; margin-top: 8px; }
  .page-head > .flex { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .page-head > .flex .btn { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 11px 12px; white-space: normal; }
  .page-head .optional-action { display: inline-flex; }
  .empty { padding: 36px 20px; }
  .empty h3 { font-size: 18px; }
  .empty p { font-size: 14px; }
  .info-callout { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
  .workspace-footer { padding: 0 16px calc(18px + env(safe-area-inset-bottom)); flex-wrap: wrap; font-size: 11px; line-height: 1.7; }
  .workspace-footer > .flex { max-width: none; }
  .workspace-footer button { min-height: 44px; font-size: 12px; }

  /* Asset cards and workspace summaries. */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat-label { gap: 8px; font-size: 12px; line-height: 1.6; align-items: flex-start; }
  .stat-label svg { width: 16px; height: 16px; margin-top: 2px; }
  .stat-value { font-size: 30px; margin-top: 10px; }
  .stat-footer { font-size: 12px; line-height: 1.6; }
  .overview-grid, .mission-layout, .control-layout, .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .control-layout > section { display: flex; flex-direction: column; }
  .control-layout > section > .orchestrator { order: 0; }
  .control-layout > section > .replan-banner { order: 1; }
  .control-layout > section > .control-connect { order: 2; flex-shrink: 0; }
  .control-layout > section > .agent-grid { order: 3; }
  .control-layout > section > .ready-result { order: 4; }
  .control-layout > section > .control-footer { order: 5; }
  .overview-right { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .asset-feature { padding: 22px 18px; min-height: 220px; }
  .asset-feature .eyebrow { font-size: 11px; }
  .asset-feature h2 { font-size: 23px; }
  .asset-feature .asset-reg { font-size: 12px; flex-wrap: wrap; }
  .asset-feature .asset-feature-content { max-width: 100%; }
  .aircraft-art { width: 230px; height: 200px; top: 20px; right: -70px; opacity: .4; }
  .asset-details { flex-wrap: wrap; column-gap: 22px; row-gap: 14px; margin-top: 26px; }
  .asset-details p { font-size: 11px; }
  .asset-details strong { font-size: 13px; }
  .asset-action-row { padding: 16px 18px; flex-wrap: wrap; }
  .asset-action-row .btn { font-size: 13px; }
  .asset-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .detail-block { padding: 14px; }
  .detail-block dt { font-size: 12px; }
  .detail-block dd { font-size: 14px; overflow-wrap: anywhere; }
  .mission-ready, .recent-activity { padding: 22px 18px; }
  .mission-ready h3, .recent-activity h3 { font-size: 16px; }
  .mission-ready > p { font-size: 14px; }
  .scope-small { font-size: 12px; line-height: 1.7; align-items: flex-start; }
  .activity-copy strong, .activity-copy p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
  .activity-copy time { font-size: 11px; }

  /* Tables become complete cards, rather than cropped desktop rows. */
  .aircraft-table, .record-table, .findings-table { min-width: 0; width: 100%; white-space: normal; }
  .aircraft-table, .aircraft-table tbody, .record-table, .record-table tbody,
  .findings-table, .findings-table tbody { display: block; }
  .aircraft-table thead, .findings-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .aircraft-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    position: relative;
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }
  .aircraft-table tr:last-child { border-bottom: 0; }
  .aircraft-table td { display: block; border: 0; padding: 0; font-size: 13px; overflow-wrap: anywhere; }
  .aircraft-table td:first-child { flex: 1 0 100%; padding-right: 40px; }
  .aircraft-table td:first-child > button { min-height: 44px; max-width: 100%; }
  .aircraft-table td:first-child > button > span:last-child { min-width: 0; }
  .aircraft-table .cell-primary { font-size: 15px; }
  .aircraft-table .cell-secondary { font-size: 12px; line-height: 1.7; }
  .aircraft-table td:last-child { position: absolute; top: 17px; right: 10px; }
  .aircraft-table td:last-child .icon-btn { width: 44px; height: 44px; }
  .aircraft-table tr.selected { background: #f8f8fe; }
  .aircraft-table tr.selected td, .aircraft-table tr:hover td { background: transparent; }

  .table-toolbar { padding: 16px; display: flex; flex-wrap: wrap; gap: 12px; }
  .table-toolbar .search-field { flex: 1 0 100%; max-width: none; width: 100%; min-width: 0; }
  .table-toolbar > .flex { width: 100%; flex-wrap: wrap; gap: 10px; }
  .table-toolbar select { flex: 1 1 125px; max-width: 100%; min-width: 0; }
  #record-count { font-size: 12px; }
  .selection-strip { padding: 12px 16px; gap: 8px; flex-wrap: wrap; font-size: 13px; }
  .selection-strip .btn { min-height: 44px; font-size: 12px; white-space: normal; }
  .checkbox-hit { width: 44px; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .check-input { width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; }
  .record-table thead { display: block; background: #fafbfe; border-bottom: 1px solid var(--line); }
  .record-table thead tr { display: flex; align-items: center; padding: 5px 12px; }
  .record-table th { border: 0; padding: 0; font-size: 12px; }
  .record-table th:first-child { width: 44px; padding: 0; }
  .record-table th:nth-child(2) { padding-left: 10px; }
  .record-table th:nth-child(n+3) { display: none; }
  .record-table tbody tr {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 5px 8px;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
  }
  .record-table tbody tr:last-child { border-bottom: 0; }
  .record-table td { display: block; min-width: 0; padding: 0 !important; border: 0; font-size: 12px; }
  .record-table td:first-child { grid-column: 1; grid-row: 1 / 3; width: 44px; }
  .record-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .record-table td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); }
  .record-table td:last-child { grid-column: 3; grid-row: 1 / 3; }
  .record-table .optional-column { display: none; }
  .record-table .doc-open { width: 100%; min-height: 44px; }
  .record-table .doc-cell { gap: 10px; min-width: 0; }
  .record-table .file-icon { display: none; }
  .record-table .doc-name { max-width: none; white-space: normal; overflow: visible; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
  .record-table .doc-name small { font-size: 11px; line-height: 1.7; }
  .findings-summary { padding: 18px; gap: 12px 18px; font-size: 13px; }
  .severity-mark { font-size: 12px; }
  .findings-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--line);
  }
  .findings-table tbody tr:last-child { border-bottom: 0; }
  .findings-table td { display: block; width: auto !important; min-width: 0; border: 0; padding: 0; font-size: 12px; }
  .findings-table td:first-child { grid-column: 1; grid-row: 1; }
  .findings-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .findings-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .findings-table td:nth-child(4) { grid-column: 1; grid-row: 3; align-self: center; }
  .findings-table td:last-child { grid-column: 2; grid-row: 3; justify-self: end; }
  .findings-table td:nth-child(2) button { width: 100%; min-height: 44px; }
  .finding-title { font-size: 16px; }
  .finding-summary { font-size: 13px; line-height: 1.8; max-width: none; overflow-wrap: anywhere; }

  /* Configuration and the live agent investigation. */
  .form-section { padding: 22px 18px; }
  .form-section h2 { font-size: 15px; line-height: 1.6; }
  .form-section .segmented { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .form-section .segmented button { flex: 1 1 130px; min-height: 44px; padding: 10px; font-size: 13px; line-height: 1.5; white-space: normal; }
  .form-section textarea { min-height: 160px; }
  .scope-option { min-height: 66px; gap: 12px; align-items: flex-start; padding: 17px 0; }
  .scope-option input { width: 22px; height: 22px; min-height: 22px; margin-top: 3px; }
  .scope-option strong { font-size: 14px; line-height: 1.6; }
  .scope-option p { font-size: 12px; line-height: 1.8; }
  .scope-option > svg { margin-top: 5px; width: 18px; height: 18px; }
  .summary-card { position: static; }
  .summary-card .panel-body { display: block; padding: 22px 18px; }
  .summary-card h3 { font-size: 18px; }
  .summary-row { font-size: 13px; line-height: 1.7; }
  .summary-row dd { overflow-wrap: anywhere; }
  .summary-note { font-size: 13px; }
  .guided-banner { align-items: stretch; flex-wrap: wrap; gap: 14px; padding: 16px; }
  .guided-banner > .flex { width: 100%; align-items: flex-start; }
  .guided-banner .guided-count { width: 32px; height: 32px; font-size: 12px; }
  .guided-banner h3 { font-size: 14px; line-height: 1.6; }
  .guided-banner p { font-size: 12px; line-height: 1.75; }
  .guided-banner > .btn { margin-left: 42px; min-height: 44px; font-size: 13px; }
  .orchestrator { padding: 20px 16px; gap: 12px; }
  .orchestrator .agent-symbol { width: 36px; height: 36px; }
  .orchestrator h2 { font-size: 15px !important; line-height: 1.6; }
  .orchestrator p { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
  .progress-ring { font-size: 11px; width: 42px; height: 42px; }
  .progress-ring svg { width: 42px; height: 42px; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .agent-card, .presentation-mode .agent-card { padding: 20px 18px; }
  .agent-card .between { flex-wrap: wrap; gap: 12px; align-items: center; }
  .agent-card .between > .flex { gap: 10px; }
  .agent-card h3, .presentation-mode .agent-card h3 { font-size: 15px; line-height: 1.5; }
  .agent-card .agent-symbol { width: 30px; height: 30px; }
  .agent-card .agent-symbol svg { width: 17px; height: 17px; }
  .agent-card > .agent-role, .presentation-mode .agent-role { min-height: 0; font-size: 13px; line-height: 1.8; }
  .agent-task { font-size: 12px; line-height: 1.7; }
  .replan-banner { padding: 18px 16px; gap: 10px; }
  .replan-banner h3 { font-size: 14px; line-height: 1.6; }
  .replan-banner p { font-size: 13px; line-height: 1.8; }
  .ready-result { padding: 18px 16px; gap: 12px; flex-wrap: wrap; }
  .ready-result h3 { font-size: 15px; line-height: 1.6; }
  .ready-result p { font-size: 13px; line-height: 1.8; }
  .ready-result .grow { flex-basis: calc(100% - 40px); }
  .ready-result .btn { min-height: 44px; margin-left: 30px; font-size: 13px; }
  .control-footer { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  .control-footer p { font-size: 12px; line-height: 1.7; }
  .paused-banner { padding: 13px; font-size: 13px; line-height: 1.7; }
  .timeline-list, .presentation-mode .timeline-list { max-height: min(55dvh, 520px); min-height: 0; padding: 20px 18px; overscroll-behavior: contain; }
  .timeline-copy strong, .presentation-mode .timeline-copy strong { font-size: 13px; line-height: 1.7; }
  .timeline-copy p, .presentation-mode .timeline-copy p { font-size: 12px; line-height: 1.8; }
  .timeline-copy time { font-size: 11px; }
  .control-timeline .panel-head h3 { font-size: 14px; }

  /* Evidence stays in its own scroll region, including zoomed pages. */
  .evidence-layout { display: flex; flex-direction: column; gap: 20px; }
  .evidence-mobile-summary { display: block; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
  .evidence-mobile-summary h2 { font-size: 23px; line-height: 1.4; }
  .evidence-mobile-summary p { font-size: 14px; line-height: 1.8; }
  .evidence-viewer { width: 100%; min-width: 0; order: 0; }
  .review-panel { width: 100%; order: 1; padding: 22px 18px; }
  .review-panel .finding-summary { font-size: 14px !important; line-height: 1.85; }
  .review-section { margin-top: 22px; padding-top: 20px; }
  .review-panel textarea { min-height: 118px; }
  .review-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .review-actions .btn, .review-actions .btn:first-child { min-height: 46px; font-size: 14px; grid-column: auto; white-space: normal; }
  .review-status { font-size: 13px; line-height: 1.8; padding: 14px; }
  .review-status strong { font-size: 13px; }
  .citation { min-height: 54px; padding: 12px; }
  .citation strong { max-width: none; white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; }
  .citation span { font-size: 12px; line-height: 1.7; }
  .citation > svg { width: 18px; height: 18px; }
  .investigation-details summary { min-height: 44px; flex-wrap: wrap; font-size: 14px; line-height: 1.7; }
  .investigation-row { font-size: 12px; line-height: 1.8; }
  .viewer-toolbar { padding: 14px 12px; flex-wrap: wrap; align-items: center; gap: 12px; }
  .viewer-toolbar h3 { font-size: 14px; }
  .viewer-toolbar p { font-size: 12px; line-height: 1.6; }
  .viewer-toolbar > .flex { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .viewer-toolbar .icon-btn, .page-nav .icon-btn { width: 44px; height: 44px; }
  .viewer-toolbar .btn { min-height: 44px; font-size: 12px; padding: 10px; }
  .viewer-toolbar .tiny { min-width: 38px; text-align: center; }
  .viewer-tabs { flex-wrap: wrap; }
  .viewer-tab { min-height: 46px; font-size: 12px; padding: 12px; min-width: 0; white-space: normal; line-height: 1.6; }
  .viewer-tab.active:not(button) { flex: 1 0 100%; }
  .source-context { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .source-context > span { flex: 1 0 100%; font-size: 12px; overflow-wrap: anywhere; line-height: 1.7; }
  .page-nav { font-size: 12px; gap: 4px; margin-left: auto; }
  .paper-grid, .paper-grid.single {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: min(68dvh, 720px);
    padding: 16px 12px;
    gap: 20px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .paper-grid > div { min-width: 0; }
  .paper-caption { align-items: flex-start; flex-wrap: wrap; font-size: 11px; line-height: 1.6; }
  .paper { min-height: 420px; padding: 24px 18px 58px; }
  .paper h3 { font-size: 18px; line-height: 1.5; }
  .paper .doc-meta, .paper .paper-copy { font-size: 11px; line-height: 1.8; }
  .paper-note { font-size: 11px; line-height: 1.8; }
  .paper-table { table-layout: fixed; width: 100%; }
  .paper-table th { font-size: 9px; line-height: 1.7; overflow-wrap: anywhere; padding: 8px 4px; }
  .paper-table td { font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; padding: 10px 4px; }
  .paper-header, .paper .watermark { font-size: 9px; line-height: 1.7; }
  .paper-foot { font-size: 8px; gap: 10px; line-height: 1.5; }
  .comparison-bar { padding: 14px 12px; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 1.7; }
  .comparison-bar strong { font-size: 14px; }
  .evidence-note { padding: 14px 12px; font-size: 11px; line-height: 1.8; align-items: flex-start; }
  .evidence-note svg { margin-top: 3px; }
  .mobile-review-jump { display: flex; justify-content: stretch; padding: 14px 12px; }
  .mobile-review-jump .btn { width: 100%; min-height: 46px; font-size: 14px; }
  #human-review { scroll-margin-top: 100px; }

  /* The report remains a readable document rather than a wide desktop sheet. */
  .report-layout { width: 100%; min-width: 0; }
  .report { padding: 24px 18px; }
  .report-header { flex-direction: column; gap: 18px; }
  .report-header .text-right { text-align: left; max-width: 100%; }
  .report-header .mono { overflow-wrap: anywhere; }
  .report-header p, .report-header .text-right p { font-size: 11px; line-height: 1.8; }
  .report h1 { font-size: 25px; line-height: 1.35; }
  .report-subtitle { font-size: 13px; line-height: 1.7; }
  .report .info-callout { font-size: 12px; }
  .report-section h2 { font-size: 14px; line-height: 1.7; }
  .report-section p, .report-finding p { font-size: 13px !important; line-height: 1.85; overflow-wrap: anywhere; }
  .report-asset { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .report-asset dt { font-size: 11px; line-height: 1.6; }
  .report-asset dd { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
  .report-finding .between { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .report-finding h3 { font-size: 14px; line-height: 1.7; }
  .report-event { flex-direction: column; gap: 3px; padding: 12px 0; font-size: 12px; }
  .report-event p { margin-top: 2px; }
  .report-inventory { max-height: 380px; overscroll-behavior: contain; }
  .report-inventory table { table-layout: fixed; white-space: normal; width: 100%; }
  .report-inventory th:first-child { width: 52%; }
  .report-inventory th:nth-child(2) { width: 29%; }
  .report-inventory th:last-child { width: 19%; }
  .report-inventory th { font-size: 10px; line-height: 1.7; padding: 10px 5px; overflow-wrap: anywhere; }
  .report-inventory td { font-size: 11px !important; line-height: 1.75; padding: 11px 5px !important; overflow-wrap: anywhere; }
  .report-foot { font-size: 10px; line-height: 1.9; overflow-wrap: anywhere; }

  .setting-row { padding: 22px 18px; gap: 14px; flex-wrap: wrap; }
  .setting-row > div { flex: 1 1 170px; }
  .setting-row h3 { font-size: 15px; line-height: 1.6; }
  .setting-row p { font-size: 13px; line-height: 1.8; }
  .setting-row > .btn { min-height: 44px; font-size: 13px; }
  .settings-note { font-size: 14px; line-height: 1.85; padding: 22px 18px; }
  .settings-note h3 { font-size: 16px; }
  .toggle { width: 48px; min-width: 48px; height: 44px; }
  .toggle span { inset: 10px 2px; }
  .toggle span:after { width: 18px; height: 18px; top: 3px; left: 3px; }
  .toggle input:checked + span:after { transform: translateX(20px); }

  /* Sheet-sized dialogs remain usable with the on-screen keyboard. */
  .modal-backdrop {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    align-items: center;
  }
  .modal, .modal.wide {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 620px;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .modal-header { flex: 0 0 auto; padding: 12px 14px 12px 20px; gap: 8px; }
  .modal-header h2 { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
  .modal-body { min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
  .modal-body > p { font-size: 14px; line-height: 1.85; }
  .modal-body .between { flex-wrap: wrap; }
  .modal-body .between .small { overflow-wrap: anywhere; }
  .modal-body > div[style*="background:#eef0f5"] { padding: 12px !important; overflow: auto; }
  .modal-field input, .modal-field select { width: 100%; max-width: 100%; }
  .modal-footer { flex: 0 0 auto; padding: 14px 20px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1 1 110px; font-size: 13px; min-height: 44px; white-space: normal; }
  .contact-status { font-size: 12px; line-height: 1.7; }
  .search-result { min-height: 52px; font-size: 13px; padding: 12px 8px; }
  .search-result > span { min-width: 0; overflow-wrap: anywhere; }
  .search-result small { font-size: 12px; line-height: 1.7; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 24px); font-size: 13px; padding: 13px 16px; }
}

@media screen and (max-width: 900px) {
  .public-nav { padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); }
  .public-nav .btn { min-height: 44px; font-size: 13px; }
  .hero { padding: 44px 18px; }
  .hero h1 { font-size: clamp(37px, 10.2vw, 56px); line-height: 1.15; letter-spacing: -1.9px; }
  .hero-kicker { font-size: 11px; line-height: 1.7; }
  .hero-desc { font-size: 16px; line-height: 1.8; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-actions .btn { flex: 1 1 145px; min-height: 48px; font-size: 14px; padding: 12px; white-space: normal; }
  .hero-note { font-size: 12px; line-height: 1.75; flex-wrap: wrap; }
  .hero-preview { margin-top: 32px; }
  .preview-sidebar { display: none; }
  .preview-body { display: block; min-height: 0; }
  .preview-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-finding { display: none; }
  .preview-top { height: auto; min-height: 42px; padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .preview-top > .mono { font-size: 10px; overflow-wrap: anywhere; }
  .preview-top > .badge { display: none !important; }
  .preview-main { padding: 22px 14px; }
  .preview-main h3 { font-size: 18px; line-height: 1.6; }
  .preview-main > .between { align-items: flex-start; }
  .preview-main .small { font-size: 12px !important; line-height: 1.8; }
  .preview-orch { gap: 10px; padding: 14px 12px; }
  .preview-orch h4 { font-size: 13px; line-height: 1.6; }
  .preview-orch p { font-size: 11px; line-height: 1.8; }
  .preview-orch > svg { display: none; }
  .mini-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 18px; }
  .mini-agents:before, .mini-agent:before { display: none; }
  .mini-agent { padding: 16px 10px; font-size: 12px; }
  .mini-agent p { font-size: 11px; line-height: 1.7; }
  .mini-activity { align-items: flex-start; font-size: 12px; line-height: 1.8; }
  .preview-bottom { height: auto; min-height: 40px; padding: 10px 12px; font-size: 10px; line-height: 1.7; }
  .product-caption { flex-wrap: wrap; font-size: 12px; gap: 8px; line-height: 1.8; }
  .product-caption button { min-height: 44px; font-size: 13px; }
  .public-section { padding: 48px 18px; }
  .principles, .trust-split { grid-template-columns: minmax(0, 1fr); }
  .public-section h2 { font-size: 29px; line-height: 1.4; }
  .public-section .section-desc, .principle p, .step p { font-size: 15px; line-height: 1.85; }
  .principle h3 { font-size: 17px; }
  .principle > span { font-size: 12px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .step { padding: 22px; }
  .step .step-no { font-size: 12px; }
  .step h3 { margin-top: 18px; font-size: 17px; }
  .trust-check { align-items: flex-start; font-size: 14px; line-height: 1.8; }
  .trust-check svg { margin-top: 4px; }
  .trust-split .tiny { font-size: 12px; line-height: 1.8; }
  .evidence-teaser { max-width: 100%; padding: 16px; }
  .evidence-teaser .paper { padding: 22px 16px 30px; min-height: 0; }
  .public-cta { padding: 48px 18px; }
  .public-cta p { font-size: 15px; line-height: 1.85; }
  .public-cta > .flex { flex-wrap: wrap; gap: 10px; }
  .public-cta .btn { flex: 1 1 140px; min-height: 48px; font-size: 14px; white-space: normal; }
  .public-cta p.tiny { font-size: 12px; }
  .public-footer { flex-wrap: wrap; gap: 18px; padding: 28px 18px; }
  .public-footer p { max-width: none; font-size: 12px; text-align: left; line-height: 1.85; }
}

@media screen and (max-width: 600px) {
  .agent-grid { grid-template-columns: minmax(0, 1fr); }
  .breadcrumb strong { display: none; }
}

@media screen and (max-width: 370px) {
  .topbar, .presentation-mode .topbar { padding-left: 8px; padding-right: 8px; gap: 4px; }
  .breadcrumb { gap: 0; }
  .breadcrumb strong { font-size: 11px; }
  .topbar-actions { gap: 0; }
  .topbar .btn:not([data-action="presentation"]) { font-size: 11px; padding: 10px; }
  .stat { padding: 14px 12px; }
  .stat-label, .stat-footer { font-size: 11px; }
  .stat-label svg { display: none; }
  .asset-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .dialog-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .report-asset { grid-template-columns: minmax(0, 1fr); }
  .record-table tbody tr { grid-template-columns: 40px minmax(0, 1fr) 40px; padding-left: 8px; padding-right: 8px; gap: 5px 4px; }
  .record-table td:first-child { width: 40px; }
  .record-table .doc-name { font-size: 12px; }
  .record-table .doc-name small { font-size: 11px; }
  .viewer-toolbar > .flex { width: 100%; justify-content: flex-start; }
  .viewer-toolbar > .flex .btn { margin-left: auto; }
  .paper { padding-left: 14px; padding-right: 14px; }
  .orchestrator { gap: 9px; padding-left: 14px; padding-right: 14px; }
  .orchestrator h2 { font-size: 14px !important; }
  .orchestrator p { font-size: 12px; }
  .orchestrator .agent-symbol { width: 30px; height: 30px; }
}
