#weekly-schedule-print .weekly-schedule-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
}

/* Import review: keep names readable and controls usable by touch. */
.schedule-import-panel { min-height: 0; }
.schedule-import-panel > header, .schedule-import-footer { flex-shrink: 0; }
.schedule-import-body { min-height: 0; overscroll-behavior: contain; }
.schedule-import-table textarea { min-width: 145px; resize: vertical; line-height: 1.4; }
.schedule-import-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.schedule-import-filters input, .schedule-import-filters select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; min-height: 44px; font-size: 14px; min-width: 0; }
.schedule-import-filters input { flex: 1 1 220px; }
.schedule-import-filters select { flex: 1 1 180px; background: white; }
.schedule-import-selection { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.schedule-import-selection span { font-size: 11px; font-weight: 700; }
.schedule-import-selection small { font-size: 11px; color: #92400e; max-width: 130px; }
.schedule-import-table tr:has(input[type="checkbox"]:not(:checked)) { border-left: 4px solid #f59e0b; }
[role="alertdialog"]:has(#confirm-dialog-message) { max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
[role="alertdialog"]:has(#confirm-dialog-message) > div:first-child { min-height: 0; overflow-y: auto; }
[role="alertdialog"]:has(#confirm-dialog-message) > div:last-child { flex-shrink: 0; }
#confirm-dialog-message { white-space: pre-line; overflow-wrap: anywhere; text-align: left; }

@media (max-width: 767px) {
  .dashboard-header > div { padding: 12px 12px 0; }
  .dashboard-header > div > div:first-child { gap: 8px; margin-bottom: 12px; }
  .dashboard-header > div > div:first-child > div:first-child { flex: 1; min-width: 0; flex-wrap: wrap; gap: 8px; }
  .dashboard-header img { width: 28px; height: 28px; }
  .dashboard-header h1 { font-size: 18px; }
  .dashboard-header > div > div:first-child > div:first-child > div { flex: 1; min-width: 0; }
  .dashboard-header > div > div:first-child p { font-size: 12px; width: 100%; }
  .dashboard-header > div > div:last-child { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; overflow: visible; }
  .dashboard-header > div > div:last-child button { padding: 8px 2px; min-width: 0; min-height: 44px; font-size: 11px; justify-content: center; gap: 4px; }
  .dashboard-header > div > div:last-child button svg { width: 14px; height: 14px; flex-shrink: 0; }
  .schedule-import-panel input, .schedule-import-panel select, .schedule-import-panel textarea { font-size: 16px; }
  .mobile-publishers-wrap { overflow: visible; padding: 8px; }
  .mobile-publishers-table, .mobile-publishers-table tbody { display: block; width: 100%; }
  .mobile-publishers-table thead { display: none; }
  .mobile-publishers-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); border: 1px solid #cbd5e1; border-radius: 12px; margin-bottom: 12px; padding: 8px; }
  .mobile-publishers-table td { display: block; width: auto !important; max-width: none !important; min-width: 0; padding: 8px !important; overflow-wrap: anywhere; text-align: left; }
  .mobile-publishers-table td::before { content: attr(data-label); display: block; color: #64748b; font-size: 11px; font-weight: 700; margin-bottom: 4px; }
  .mobile-publishers-table td:first-child, .mobile-publishers-table td:last-child { grid-column: 1 / -1; }
  .mobile-publishers-table td:first-child > div { font-size: 14px; }
  .mobile-publishers-table td:last-child button { width: 100%; min-height: 44px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; font-size: 14px; }
  .schedule-import-dialog { padding: 0 !important; align-items: stretch !important; }
  .schedule-import-panel {
    width: 100%; height: 100dvh; max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .schedule-import-panel > header { padding: 12px; gap: 8px; }
  .schedule-import-panel > header h2 { font-size: 15px; }
  .schedule-import-panel > header p { line-height: 1.5; }
  .schedule-import-body { padding: 12px !important; overflow-x: hidden; flex: 1; }
  .schedule-import-body > section { min-width: 0; }
  .schedule-import-body label, .schedule-import-body label > span { min-width: 0; }
  .schedule-import-table-wrap { overflow: visible !important; max-height: none !important; border: 0 !important; }
  .schedule-import-table { display: block; width: 100%; min-width: 0 !important; }
  .schedule-import-table thead { display: none; }
  .schedule-import-table tbody { display: grid; gap: 16px; width: 100%; }
  .schedule-import-table tr { display: grid; grid-template-columns: minmax(0,1fr); border: 1px solid #cbd5e1; border-radius: 12px; padding: 8px; box-shadow: 0 2px 4px #0f172a0a; }
  .schedule-import-table td { display: block; padding: 8px !important; min-width: 0; text-align: left; white-space: normal; }
  .schedule-import-table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; }
  .schedule-import-table input:not([type="checkbox"]), .schedule-import-table select, .schedule-import-table textarea {
    display: block; width: 100% !important; max-width: 100%; min-width: 0;
    min-height: 44px; font-size: 16px; padding: 10px; color: #0f172a;
  }
  .schedule-import-selection { align-items: flex-start; display: grid; grid-template-columns: 24px 1fr; gap: 8px 12px; padding: 8px 0; }
  .schedule-import-selection input { width: 24px; height: 24px; }
  .schedule-import-selection span { font-size: 14px; }
  .schedule-import-selection small { grid-column: 2; max-width: none; font-size: 12px; }
  .schedule-import-panel button { min-height: 44px; }
  .schedule-import-footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; }
  .schedule-import-footer button { padding: 12px; font-size: 13px; justify-content: center; }
  .schedule-import-footer button:last-child { flex: 1; }
  [role="alertdialog"]:has(#confirm-dialog-message) > div:first-child { padding: 16px; }
  [role="alertdialog"]:has(#confirm-dialog-message) > div:first-child > div { display: none; }
  [role="alertdialog"]:has(#confirm-dialog-message) > div:last-child { padding: 12px; }
  #weekly-schedule-print .weekly-schedule-table { width: 100%; min-width: 0 !important; table-layout: fixed; }
  #weekly-schedule-print .weekly-schedule-table th:first-child,
  #weekly-schedule-print .weekly-schedule-table td:first-child { width: 64px; }
  #weekly-schedule-print .weekly-schedule-day { min-width: 0 !important; width: auto !important; }
  #weekly-schedule-print button { min-height: 44px; min-width: 44px; }
  #weekly-schedule-print .weekly-assignment-name { display: block; overflow: visible; white-space: normal; overflow-wrap: anywhere; -webkit-line-clamp: unset; font-size: 13px; line-height: 1.4; }
}

@media (min-width: 768px) {
  #weekly-schedule-print .weekly-schedule-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }

  #weekly-schedule-print .weekly-schedule-table th:first-child,
  #weekly-schedule-print .weekly-schedule-table td:first-child {
    width: 82px;
  }

  #weekly-schedule-print .weekly-schedule-day {
    width: calc((100% - 82px) / 7);
    min-width: 0 !important;
    padding: 0.55rem 0.2rem;
  }

  #weekly-schedule-print .weekly-schedule-cell {
    width: calc((100% - 82px) / 7);
    padding: 0.35rem;
  }

  #weekly-schedule-print .weekly-assignment-card {
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.3rem;
  }

  #weekly-schedule-print .weekly-assignment-name {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.12;
    font-size: 9px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
}
