@media (max-width: 1280px) {
  .col-3 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-5, .col-7 { grid-column: span 12; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .official-masthead { min-height: 242px; }
  .official-side { height: 170px; }
  .p6h-side { padding: 10px 24px 16px; gap: 15px; }
  .p6h-logo { width: 150px; height: 138px; }
  .p6h-name-ar { font-size: 31px; }
  .p6h-name-en { font-size: 16px; }
  .p6h-center-name { font-size: 22px; }
  .etec-logo { width: min(480px, 92%); height: 146px; }
  .platform-plaque { width: min(650px, 64vw); bottom: 0; }
  .platform-plaque h1 { font-size: 34px; }
}

@media (max-width: 1040px) {
  .nav-inner { align-items: stretch; flex-direction: column; padding: 10px 0 14px; }
  .nav-links { width: 100%; }
  .nav-session-tools { justify-content: space-between; width: 100%; }
  .session-identity { margin-inline-start: auto; }

  .evaluator-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-institutional-card { grid-template-columns: 1fr; }
  .login-introduction { min-height: 300px; }
}

@media (max-width: 900px) {
  .official-masthead { min-height: 356px; background: #fff; }
  .official-side { width: 100%; height: 140px; }
  .p6h-side {
    top: 0;
    left: 0;
    right: 0;
    justify-content: center;
    padding: 13px 24px 18px;
  }
  .p6h-logo { width: 118px; height: 112px; }
  .p6h-name-ar { font-size: 30px; }
  .p6h-name-en { font-size: 15px; }
  .p6h-center-name { margin-top: 8px; font-size: 21px; }
  .etec-side { top: 140px; left: 0; height: 130px; padding: 8px 20px 24px; }
  .etec-logo { width: min(450px, 90%); height: 108px; }
  .platform-plaque { width: min(700px, 88vw); bottom: 0; }
  .app-nav { padding-top: 8px; }

  .page-heading, .section-heading, .workbench-banner,
  .evaluator-hero, .evaluator-detail-hero,
  .criterion-hero, .data-standard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .col-6, .col-8, .col-4, .col-3 { grid-column: span 12; }
  .preview-gateway, .leadership-focus, .viewer-layout { grid-template-columns: 1fr; }
  .gateway-stamp { display: none; }
  .viewer-navigation, .viewer-stage { min-height: auto; }
  .evaluator-detail-layout { grid-template-columns: 1fr; }
  .evaluator-context-panel, .evaluator-viewer-layout .viewer-navigation { position: static; max-height: none; }
  .sibling-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner, .nav-inner, .page-shell, .footer-inner {
    width: min(var(--wtc-page-width), calc(100% - 24px));
  }

  .official-masthead { min-height: 332px; }
  .official-side { height: 124px; }
  .p6h-side { gap: 9px; padding-inline: 12px; }
  .p6h-logo { width: 88px; height: 90px; }
  .p6h-name-ar { font-size: 22px; }
  .p6h-name-en { margin-top: 5px; font-size: 10px; }
  .p6h-center-name { margin-top: 6px; font-size: 16px; white-space: normal; }
  .etec-side { top: 124px; height: 118px; }
  .etec-logo { height: 90px; }
  .platform-plaque {
    bottom: 0;
    width: 93vw;
    min-height: 84px;
    padding: 10px 16px 13px;
    border-radius: 0 0 28px 28px;
  }
  .platform-plaque h1 { font-size: 25px; }

  .app-nav { padding-top: 8px; }
  .nav-session-tools { align-items: stretch; flex-direction: column; }
  .session-identity { width: 100%; margin: 0; padding: 0 0 8px; border: 0; }
  .nav-home-link, .btn-header { width: 100%; justify-content: center; text-align: center; }

  .page-shell { padding-top: 24px; }
  .hero-card { padding: 22px; }
  .dashboard-summary, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 25px 0 23px; }
  .footer-context { justify-items: start; text-align: start; }

  .evaluator-entry-grid, .sibling-navigation, .category-link-grid { grid-template-columns: 1fr; }
  .evaluator-entry-card { min-height: auto; }
  .page-action-bar, .context-pager, .criterion-card-header, .criterion-title-row, .pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .page-action-bar .btn, .context-pager .btn, .pagination .btn, .pagination-status { width: 100%; }
  .evaluator-viewer-layout .viewer-stage { min-height: 540px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; }

  .login-main { width: 100%; padding: 68px 12px 24px; }
  .login-institutional-card { border-radius: 18px; }
  .login-introduction, .login-form-panel { padding: 30px 22px; }
  .login-introduction { min-height: 250px; }
  .login-form-panel h2 { font-size: 30px; }
  .test-account-grid { grid-template-columns: 1fr; }
}

@media print {
  .official-masthead { min-height: 150px; box-shadow: none; }
  .official-side { height: 122px; }
  .p6h-logo { width: 82px; height: 88px; }
  .p6h-name-ar { font-size: 24px; }
  .p6h-center-name { font-size: 16px; }
  .etec-logo { height: 88px; }
  .platform-plaque { bottom: -35px; box-shadow: none; }
  .app-nav, .button, .hero-actions, .btn { display: none !important; }
  .page-shell { width: 100%; margin-top: 42px; }
  .app-footer { display: none; }
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }
}

@media (max-width: 980px) {
  .review-layout,
  .review-workspace { grid-template-columns: 1fr; grid-template-areas: "queue" "detail"; }
  .review-queue-panel { position: static; max-height: none; overflow: visible; }
  .review-queue-list { max-height: 520px; }
  .review-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .review-stage-tabs { grid-template-columns: 1fr; }
  .document-file-item { align-items: stretch; flex-direction: column; }
  .document-file-item .button-row { width: 100%; }
  .document-file-item .btn { flex: 1; }
  .compact-search { align-items: stretch; flex-direction: column; min-width: 100%; }
  .compact-search input { min-width: 0; width: 100%; }
  .review-meta-grid { grid-template-columns: 1fr; }
  .viewer-canvas.has-document,
  .document-frame { min-height: 540px; }
  .office-preview { min-height: 500px; padding: 22px 16px; }
}

/* Phase 5 R4 — criterion evidence responsiveness */
@media (max-width: 1180px) {
  .published-evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .criterion-evidence-workspace { padding: 14px; border-radius: 18px; }
  .evidence-workspace-heading { align-items: stretch; }
  .evidence-add-button { width: 100%; min-width: 0; }
  .published-evidence-grid { grid-template-columns: 1fr; }
  .published-evidence-card { min-height: 0; }
  .evidence-total-badge { width: 100%; }
}
