:root {
  --page: #f1f6f4;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --paper: #fbfaf5;
  --teal: #0c695d;
  --teal-dark: #075147;
  --teal-soft: #e4f0ed;
  --teal-pale: #f0f7f4;
  --ink: #20312d;
  --muted: #72817d;
  --line: #dce7e3;
  --line-strong: #c6d6d1;
  --cream: #faf8ef;
  --gold: #a68135;
  --danger: #a34c56;
  --radius-lg: 18px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --shadow-card: 0 8px 28px rgba(20, 56, 48, .045);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }

.app-shell { max-width: 1680px; margin: 0 auto; padding: 0 28px 56px; }
.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-strong);
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: min(210px, 42vw);
  height: 72px;
  object-fit: contain;
  object-position: center;
}
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-caption { color: var(--muted); font-size: 12px; }
.mobile-menu-button, .sidebar-close { display: none; }

.app-layout {
  display: grid;
  grid-template-columns: clamp(400px, 30vw, 480px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.sidebar {
  min-width: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.sidebar-title-row, .sidebar-section-heading, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title { display: flex; align-items: center; gap: 9px; }
.section-title h1 { margin: 0; color: var(--teal-dark); font-size: 17px; font-weight: 700; }
.title-icon, .heading-icon {
  display: inline-grid;
  place-items: center;
  color: var(--teal);
}
.title-icon svg { width: 23px; height: 23px; }
.heading-icon svg { width: 17px; height: 17px; }
.sidebar-section-heading { margin-bottom: 10px; }
.sidebar-section-heading h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
}
.sidebar-section-heading h2 small { color: var(--muted); font-weight: 400; }
.heading-note { color: var(--muted); font-size: 11.5px; }

.scraper-callout {
  margin-top: 17px;
  padding: 13px 13px 12px;
  background: var(--cream);
  border: 1px dashed #b9c8c2;
  border-radius: var(--radius-md);
  text-align: center;
}
.callout-heading { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--teal-dark); font-size: 13px; }
.callout-icon { display: inline-grid; place-items: center; color: var(--teal); }
.callout-icon svg { width: 15px; height: 15px; }
.scraper-callout p { margin: 7px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.bookmarklet-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.bookmarklet-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.bookmarklet-button span { font-size: 14px; opacity: .75; }
.scraper-callout small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.scraper-copy-button { width: 100%; margin-top: 7px; }
.bookmarklet-code { display: block; width: 100%; min-height: 72px; margin-top: 7px; padding: 7px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; color: var(--muted); direction: ltr; font-family: Consolas, monospace; font-size: 9px; line-height: 1.35; }
.bookmarklet-code:focus { border-color: #8dbab0; box-shadow: 0 0 0 3px rgba(12, 105, 93, .08); }
.scraper-callout .bookmarklet-button { margin-top: 0; background: transparent; border: 1px solid var(--line-strong); color: var(--teal-dark); }
.scraper-callout .bookmarklet-button:hover { background: var(--teal-pale); }
.scraper-callout .extension-install { margin-top: 8px; background: var(--teal); border-color: var(--teal); color: #fff; text-decoration: none; }
.scraper-callout .extension-install:hover { background: var(--teal-dark); color: #fff; }
.usage-guide { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e8e4d7; text-align: right; }
.usage-guide summary { color: var(--teal-dark); cursor: pointer; font-size: 11.5px; font-weight: 700; }
.usage-guide ol { margin: 7px 0 0; padding-inline-start: 19px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.usage-guide li + li { margin-top: 2px; }
.scraper-status { min-height: 18px; margin-top: 9px; color: var(--teal-dark); font-size: 12px; font-weight: 600; }
.scraper-status.loading { color: var(--gold); }
.scraper-status.error { color: var(--danger); }
.scraper-progress { min-height: 16px; color: var(--muted); font-size: 10px; }
.scraper-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.scraper-stats span { padding: 4px 5px; border-radius: 5px; background: rgba(255,255,255,.58); }
.scraper-stats b { color: var(--teal-dark); }
.course-preview { margin-top: 8px; text-align: right; }
.preview-heading { margin-bottom: 4px; color: var(--teal-dark); font-size: 10px; font-weight: 700; }
.preview-list { display: grid; gap: 3px; max-height: 145px; overflow: auto; }
.preview-row { display: grid; gap: 1px; padding: 4px 5px; border-radius: 5px; background: rgba(255,255,255,.58); color: var(--ink); font-size: 10px; }
.preview-row small { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-section { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.sidebar-section > summary { cursor: pointer; list-style: none; }
.sidebar-section > summary::-webkit-details-marker { display: none; }
.sidebar-section > summary::after { content: '⌄'; flex: 0 0 auto; color: var(--muted); font-size: 15px; line-height: 1; transition: transform .18s ease; }
.sidebar-section:not([open]) > summary::after { transform: rotate(90deg); }
.clipboard-section { padding-top: 12px; padding-bottom: 0; }
.clipboard-section .button { width: 100%; margin: 0; }
.data-overview { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--teal-dark); font-size: 12px; font-weight: 600; }
.data-file { max-width: 220px; overflow: hidden; color: var(--muted); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  cursor: pointer;
}
.button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.button-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.button-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button-secondary:hover { background: var(--teal-pale); border-color: var(--line-strong); color: var(--teal-dark); }
.button-quiet { grid-column: 1 / -1; min-height: 30px; background: transparent; color: var(--muted); border-color: transparent; }
.button-quiet:hover { background: #fff8f8; color: var(--danger); }
.button:disabled { opacity: .44; transform: none; }
.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  margin-top: 9px;
  padding: 7px;
  border: 1px dashed #aabdb6;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.drop-zone svg { width: 15px; height: 15px; }
.drop-zone.is-dragging { border-color: var(--teal); background: var(--teal-pale); color: var(--teal-dark); }
.data-status { min-height: 18px; margin-top: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.6; white-space: pre-line; }
.json-paste-field { display: block; width: 100%; min-height: 74px; margin-top: 9px; padding: 7px 8px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; color: var(--ink); direction: ltr; font-family: Consolas, monospace; font-size: 10px; line-height: 1.4; }
.json-paste-field:focus { border-color: #8dbab0; box-shadow: 0 0 0 3px rgba(12, 105, 93, .08); }
.json-paste-button { width: 100%; margin-top: 7px; }
.data-status.success { color: var(--teal-dark); }
.data-status.error { color: var(--danger); }
.data-status.loading { color: var(--gold); }

.fixed-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fixed-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 12px;
}
.fixed-item .fixed-icon { display: inline-grid; color: var(--muted); }
.fixed-item .fixed-credit-hours { margin-right: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.fixed-item small { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; direction: ltr; }
.course-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 7px; }
.course-list .list-label { grid-column: 1 / -1; }
.closed-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.closed-help { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.closed-course-group { display: grid; align-self: start; gap: 6px; }
.closed-course-group > summary { cursor: pointer; list-style: none; }
.closed-course-group > summary::-webkit-details-marker { display: none; }
.closed-course-heading { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.closed-course-heading::after { content: '⌄'; flex: 0 0 auto; color: var(--muted); font-size: 14px; line-height: 1; transition: transform .18s ease; }
.closed-course-group:not([open]) .closed-course-heading::after { transform: rotate(90deg); }
.closed-course-color { width: 6px; height: 29px; flex: 0 0 auto; border-radius: 4px; background: var(--course-color); }
.closed-course-copy { min-width: 0; display: grid; gap: 2px; }
.closed-course-name { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.closed-course-meta { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.closed-course-count { margin-right: auto; flex: 0 0 auto; color: #9a6a1f; font-size: 10px; font-weight: 700; }
.closed-course-sections { display: grid; gap: 6px; margin-right: 12px; padding-right: 9px; border-right: 2px solid #ead9c3; }
.closed-item { display: grid; gap: 8px; padding: 8px; border: 1px solid #ead9c3; border-radius: var(--radius-sm); background: #fffaf1; }
.closed-item.is-added { border-color: #c7ddd6; background: #f1faf7; }
.closed-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.closed-copy { min-width: 0; display: grid; gap: 2px; }
.closed-section-name { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.closed-meta { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.closed-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 99px; background: #fff0d6; color: #9a6a1f; font-size: 10px; font-weight: 700; }
.closed-item.is-added .closed-badge { background: var(--teal-pale); color: var(--teal-dark); }
.closed-add-button { width: 100%; min-height: 34px; padding: 5px 8px; color: #8a5b17; border-color: #e5cda8; background: transparent; font-size: 12px; }
.closed-add-button:hover { color: #704911; border-color: #d7b77f; background: #fff1d9; }
.list-label { display: flex; align-items: center; gap: 6px; margin: 13px 2px 5px; color: var(--muted); font-size: 11px; }
.list-label span { min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--teal-pale); color: var(--teal); font-size: 9px; text-align: center; }
.course-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 62px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.course-row:hover { background: var(--surface-soft); border-color: var(--line); }
.course-row.is-selected { background: var(--teal-pale); border-color: #d1e5df; }
.course-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.course-check, .suggestion-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #fff;
  background: var(--surface);
}
.course-row.is-selected .course-check, .suggestion-check { background: var(--teal); border-color: var(--teal); }
.course-color { width: 7px; height: 30px; flex: 0 0 auto; margin-top: 1px; border-radius: 4px; background: var(--course-color); }
.course-copy { min-width: 0; display: grid; align-content: center; gap: 2px; padding-top: 1px; }
.course-name { overflow: visible; color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.course-meta { overflow: visible; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.sidebar-empty { display: grid; grid-column: 1 / -1; justify-items: center; gap: 7px; padding: 21px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.sidebar-empty.compact { padding: 5px; font-size: 10px; }
.sidebar-empty svg { color: var(--teal); }
.manual-section { padding-bottom: 2px; }
.field { width: 100%; min-width: 0; height: 37px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; color: var(--ink); font-size: 12px; }
.field:focus { border-color: #8dbab0; box-shadow: 0 0 0 3px rgba(12, 105, 93, .08); }
.field + .field { margin-top: 0; }
.manual-course-details { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.slot-fields { display: grid; gap: 6px; margin-top: 6px; }
.slot-input-row { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 5px; }
.manual-form-actions { display: grid; gap: 6px; margin-top: 8px; }
.add-course-button { width: 100%; margin-top: 0; }
.cancel-edit-button { width: 100%; }
.cancel-edit-button[hidden] { display: none !important; }
.custom-list { display: grid; gap: 5px; margin-top: 8px; }
.custom-course { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--teal-pale); color: var(--teal-dark); font-size: 11px; }
.custom-course-actions { display: flex; align-items: center; gap: 5px; margin-inline-start: auto; }
.custom-course button { display: inline-grid; padding: 2px; border: 0; background: none; }
.custom-course-edit { color: var(--teal); font-size: 10px; }
.custom-course-edit:hover { color: var(--teal-dark); text-decoration: underline; }
.custom-course-remove { color: var(--danger); }

.main-content { min-width: 0; display: grid; gap: 20px; }
.site-footer {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff 0%, var(--teal-pale) 100%);
  box-shadow: var(--shadow-card);
  color: var(--muted);
}
.site-footer-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 24px; }
.site-footer-brand { display: grid; justify-items: end; gap: 2px; min-width: 155px; text-align: right; }
.site-footer-logo { display: block; width: 145px; height: 53px; object-fit: contain; object-position: right center; }
.site-footer-brand > span { display: block; width: 100%; color: var(--muted); font-size: 11px; font-weight: 500; text-align: right; direction: rtl; }
.site-footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.site-footer-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid rgba(198, 214, 209, .8); border-radius: 12px; background: rgba(255, 255, 255, .72); color: var(--teal-dark); text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.site-footer-link:hover { border-color: #9fc3ba; background: #fff; transform: translateY(-1px); }
.site-footer-link-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; background: var(--teal-soft); color: var(--teal); }
.site-footer-link-icon svg { width: 16px; height: 16px; }
.site-footer-link-copy { display: grid; min-width: 0; gap: 1px; text-align: right; }
.site-footer-link-copy small { color: var(--muted); font-size: 10px; }
.site-footer-link-copy b { overflow: hidden; color: var(--teal-dark); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.result-summary, .section-card, .timetable-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.result-summary { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px; direction: rtl; }
.summary-copy { min-width: 0; flex: 1; text-align: right; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--teal); font-size: 11px; font-weight: 600; letter-spacing: .1px; }
.summary-copy h2, .summary-empty h2 { margin: 0; color: var(--teal-dark); font-size: 17px; font-weight: 600; }
.summary-copy h2 strong { font-size: 24px; font-weight: 700; }
.summary-copy p, .summary-empty p { margin: 5px 0 12px; color: var(--muted); font-size: 11.5px; }
.summary-copy p b { color: var(--teal-dark); font-weight: 600; }
.summary-credit-hours { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin: 8px 0 12px; color: var(--muted); font-size: 11px; }
.summary-credit-hours strong { color: var(--teal-dark); font-size: 14px; }
.summary-credit-hours small { color: var(--gold); font-size: 10px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
.filter-button { min-width: 66px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 11px; transition: all .16s ease; }
.filter-button:hover { border-color: #9bbcb3; color: var(--teal-dark); }
.filter-button.is-active { border-color: var(--teal); background: var(--teal); color: #fff; }
.off-stat { display: grid; place-items: center; align-content: center; width: 88px; height: 88px; flex: 0 0 auto; border: 4px solid #d7e6e1; border-top-color: var(--teal); border-left-color: var(--teal); border-radius: 50%; color: var(--teal-dark); transform: rotate(-13deg); }
.off-stat-number, .off-stat-label { transform: rotate(13deg); }
.off-stat-number { font-size: 25px; font-weight: 700; line-height: 1; }
.off-stat-label { margin-top: 3px; color: var(--muted); font-size: 10px; }
.summary-empty { display: flex; align-items: center; gap: 13px; width: 100%; }
.summary-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border-radius: 12px; background: var(--teal-pale); color: var(--teal); }
.summary-empty.is-warning .summary-icon { background: #fbf5e7; color: var(--gold); }

.section-card { padding: 20px; }
.section-heading { margin: 0 2px 13px; }
.section-heading h2 { margin: 0; color: var(--teal-dark); font-size: 15px; }
.selection-count { padding: 4px 8px; border-radius: 99px; background: var(--teal-pale); color: var(--teal); font-size: 10.5px; }
.timetable-card { padding: 20px; border: 0; box-shadow: none; }
.timetable-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.timetable-heading { min-width: 0; }
.timetable-toolbar h2 { margin: 0; color: var(--teal-dark); font-size: 14px; }
.timetable-toolbar h2 b { font-weight: 600; }
.timetable-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: 58px; align-items: center; flex: 1; gap: 24px; direction: ltr; }
.configuration-summary { display: flex; grid-column: 1; grid-row: 1; align-items: center; justify-self: start; gap: 8px; direction: rtl; }
.configuration-ring { position: relative; display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--teal) var(--ring-progress, 0%), #d7e6e1 0); color: var(--teal-dark); font-size: 21px; font-weight: 700; isolation: isolate; }
.configuration-ring::before { content: ''; position: absolute; inset: 3px; z-index: 0; border-radius: 50%; background: var(--surface); }
.configuration-ring > span { position: relative; z-index: 1; }
.configuration-label { max-width: 70px; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
.registered-hours-summary { display: grid; gap: 2px; min-width: 86px; direction: rtl; color: var(--muted); font-size: 11px; text-align: right; }
.registered-hours-summary strong { color: var(--teal-dark); font-size: 14px; }
.schedule-navigation { display: flex; grid-column: 2; grid-row: 1; align-items: center; justify-self: center; gap: 7px; direction: rtl; }
.schedule-navigation select { width: 320px; max-width: 35vw; height: 37px; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; color: var(--ink); font-size: 11px; direction: rtl; }
.schedule-navigation select:focus { border-color: #8dbab0; }
.icon-button { display: inline-grid; place-items: center; width: 35px; height: 35px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--teal); color: #fff; transition: background .16s ease; }
.icon-button:hover { background: var(--teal-dark); }
.icon-button:disabled { background: #dce6e3; border-color: #dce6e3; color: #91a29d; }
.week-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 3px; }
.week-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)) 64px; grid-template-rows: 44px 630px; gap: 8px; min-width: 900px; direction: ltr; }
.day-header { grid-row: 1; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700; direction: rtl; }
.day-header.is-off { background: #eef1ef; color: var(--muted); }
.day-header span { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: 9px; font-weight: 500; }
.day-column { grid-row: 2; position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background-color: #fff; background-image: linear-gradient(to bottom, transparent 69px, rgba(220, 231, 227, .48) 70px); background-size: 100% 70px; }
.day-column.is-off { background-color: #fbfcfb; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.75) 0, rgba(255,255,255,.75) 9px, rgba(226, 238, 234, .58) 9px, rgba(226, 238, 234, .58) 10px); }
.break-label { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0 3px; color: var(--muted); direction: ltr; unicode-bidi: isolate; font-size: 9px; font-weight: 600; line-height: 1.1; text-align: center; white-space: nowrap; pointer-events: none; }
.time-axis { grid-column: 6; grid-row: 2; position: relative; color: var(--muted); font-family: Consolas, "IBM Plex Sans Arabic", monospace; font-size: 11px; direction: rtl; text-align: right; }
.time-axis span { position: absolute; right: 0; width: 100%; transform: translateY(-50%); text-align: right; }
.time-axis span:last-child { transform: translateY(-100%); }
.course-block { position: absolute; right: 4px; left: 4px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 7px; border-radius: 7px; background: var(--course-color); color: #fff; box-shadow: 0 3px 7px rgba(28, 55, 48, .16); direction: rtl; text-align: center; }
.course-block strong { overflow: hidden; max-width: 100%; padding-inline: 17px; font-size: 11.5px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.course-block span, .course-block small { overflow: hidden; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; opacity: .94; }
.course-block .course-time { position: absolute; z-index: 2; overflow: visible; padding: 0; font-size: 9px; line-height: 1; direction: ltr; text-overflow: clip; }
.course-block .course-time-start { top: 4px; right: 6px; }
.course-block .course-time-end { bottom: 4px; left: 6px; }
.course-block .credit-hours { font-family: inherit; font-weight: 600; }
.course-block small { font-family: inherit; }
.course-block small.credit-hours { font-family: inherit; }
.course-block small.closed-section-label { color: #ffe4ac; font-family: inherit; font-size: 10px; font-weight: 700; }
.course-block.is-compact { gap: 1px; padding: 4px 5px; }
.course-block.is-compact strong { font-size: 10.5px; line-height: 1.15; }
.course-block.is-compact span, .course-block.is-compact small { font-size: 9.5px; line-height: 1.15; }
.course-block.is-compact .course-time { font-size: 8px; }
.off-label { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 5px; color: var(--muted); }
.off-label strong { font-size: 12px; font-weight: 600; }
.schedule-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px; margin-top: 13px; color: var(--muted); font-size: 11px; }
.schedule-legend span { display: inline-flex; align-items: center; gap: 5px; }
.schedule-legend i { width: 9px; height: 9px; border-radius: 3px; }
.timetable-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.timetable-footer .schedule-legend { margin-top: 0; }
.image-export-actions { display: flex; flex-wrap: wrap; gap: 7px; direction: rtl; }
.image-export-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--teal-dark); font-size: 11px; font-weight: 600; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.image-export-button:hover { border-color: #9bbcb3; background: var(--teal-pale); }
.timetable-empty { display: grid; justify-items: center; gap: 5px; padding: 65px 20px 70px; color: var(--muted); text-align: center; }
.timetable-empty svg { color: var(--teal); }
.timetable-empty h3 { margin: 5px 0 0; color: var(--teal-dark); font-size: 14px; }
.timetable-empty p { margin: 0; font-size: 11.5px; }
.suggestions-card { padding-bottom: 16px; }
.suggestion-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.suggestion-item { min-width: 0; display: flex; align-items: center; gap: 7px; min-height: 52px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.suggestion-course-copy { min-width: 0; display: grid; gap: 1px; }
.suggestion-name { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-item small { margin-right: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.suggestion-item .course-color { width: 6px; height: 25px; border-radius: 3px; }
.suggestion-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.suggestion-total strong { color: var(--teal-dark); font-size: 13px; }
.suggestions-empty { padding: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 30; display: flex; align-items: center; gap: 8px; max-width: min(360px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid #c9e1da; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(25, 65, 55, .16); color: var(--teal-dark); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #ead0d2; color: var(--danger); }
.sidebar-backdrop { display: none; }

@media (min-width: 901px) {
  body { font-size: 15px; }
  .topbar-caption { font-size: 13px; }
  .sidebar-section-heading h2 { font-size: 15px; }
  .heading-note { font-size: 12.5px; }
  .scraper-callout p { font-size: 13px; }
  .scraper-callout small { font-size: 11px; }
  .usage-guide summary { font-size: 12.5px; }
  .usage-guide ol { font-size: 12px; }
  .scraper-status { font-size: 13px; }
  .button, .drop-zone, .field { font-size: 13px; }
  .data-overview { font-size: 13px; }
  .data-status { font-size: 11.5px; }
  .course-name { font-size: 13.5px; }
  .course-meta { font-size: 12px; }
  .list-label { font-size: 12px; }
  .section-heading h2 { font-size: 16px; }
  .timetable-toolbar h2 { font-size: 15px; }
  .schedule-navigation select { font-size: 12px; }
  .day-header { font-size: 13.5px; }
  .day-header span { font-size: 10px; }
  .time-axis { font-size: 12px; }
  .course-block strong { font-size: 12px; }
  .course-block span, .course-block small { font-size: 11px; }
  .course-block .course-time { font-size: 10px; }
  .course-block.is-compact strong { font-size: 11.5px; }
  .course-block.is-compact span, .course-block.is-compact small { font-size: 10.5px; }
  .course-block.is-compact .course-time { font-size: 9px; }
  .break-label { font-size: 10px; }
  .schedule-legend, .image-export-button { font-size: 12px; }
  .site-footer-brand > span { font-size: 12px; }
  .site-footer-link-copy small { font-size: 11px; }
  .site-footer-link-copy b { font-size: 12px; }
}

@media (max-width: 1180px) {
  .app-shell { padding-inline: 17px; }
  .app-layout { grid-template-columns: clamp(380px, 40vw, 460px) minmax(0, 1fr); gap: 18px; }
  .suggestion-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { padding-inline: 13px; }
  .topbar { min-height: 74px; }
  .brand-logo { width: min(185px, 44vw); height: 58px; }
  .topbar-caption { display: none; }
  .mobile-menu-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--teal-dark); }
  .mobile-menu-button svg { width: 20px; height: 20px; }
  .app-layout { display: block; margin-top: 14px; }
  .sidebar { position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(360px, calc(100vw - 18px)); max-height: none; border-radius: 0; transform: translateX(105%); transition: transform .25s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 25px; line-height: 1; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; display: block; background: rgba(10, 35, 30, .27); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
  .main-content { width: 100%; }
  .course-list, .closed-list, .fixed-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .app-shell { padding-bottom: 25px; }
  .site-footer { margin-top: 20px; padding: 14px; }
  .site-footer-main { grid-template-columns: 1fr; gap: 14px; }
  .site-footer-brand { justify-items: end; min-width: 0; text-align: right; }
  .site-footer-logo { width: 135px; height: 48px; object-position: right center; }
  .site-footer-links { grid-template-columns: 1fr; }
  .brand-logo { width: min(160px, 48vw); height: 49px; }
  .result-summary { min-height: 128px; padding: 16px; gap: 12px; }
  .summary-copy h2, .summary-empty h2 { font-size: 14px; }
  .summary-copy h2 strong { font-size: 20px; }
  .summary-copy p, .summary-empty p { font-size: 10.5px; }
  .off-stat { width: 72px; height: 72px; border-width: 3px; }
  .off-stat-number { font-size: 21px; }
  .section-card, .timetable-card { padding: 14px; }
  .timetable-toolbar { display: grid; gap: 10px; }
  .timetable-tools { width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 10px; }
  .configuration-summary { grid-column: 1; grid-row: 1; }
  .schedule-navigation { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .schedule-navigation select { width: 100%; max-width: none; }
  .timetable-footer { display: grid; gap: 10px; }
  .image-export-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .image-export-button { width: 100%; }
  .suggestion-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suggestion-item { min-height: 47px; padding-inline: 6px; }
  .suggestion-item small { display: none; }
  .toast { right: 16px; bottom: 16px; }
}

@media (max-width: 390px) {
  .result-summary { align-items: flex-start; }
  .summary-empty { align-items: flex-start; }
  .summary-icon { width: 36px; height: 36px; }
  .off-stat { width: 62px; height: 62px; }
  .off-stat-number { font-size: 18px; }
  .filter-button { min-width: 56px; padding-inline: 7px; }
  .suggestion-list { grid-template-columns: 1fr; }
}

@media print {
  @page { size: landscape; margin: 8mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .app-shell { max-width: none; padding: 0; }
  .topbar, .sidebar, .timetable-toolbar, .image-export-actions { display: none !important; }
  .app-layout { display: block; margin: 0; }
  .main-content { display: block; width: 100%; }
  .timetable-card { padding: 0; border: 0; box-shadow: none; }
  .week-scroll { overflow: visible; }
  .week-grid { min-width: 0; grid-template-rows: 50px 720px; }
  .timetable-footer { margin-top: 14px; }
}
