:root {
  --ink: #17233c;
  --ink-soft: #2c3953;
  --canvas: #f4f6f2;
  --paper: #ffffff;
  --paper-warm: #fbfaf5;
  --active-blue: #315be8;
  --active-blue-dark: #2347bf;
  --active-blue-soft: #edf1ff;
  --success: #087f6a;
  --success-soft: #e7f4f0;
  --signal: #f2b84b;
  --signal-soft: #fff3d8;
  --muted: #586176;
  --quiet: #6d7586;
  --line: #d8dcd5;
  --line-strong: #b7beb6;
  --danger: #a72b2b;
  --danger-soft: #fff0ee;
  --display-font: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
  --body-font: "IBM Plex Sans Arabic", "Tajawal", Arial, sans-serif;
  --content-wide: 1220px;
  --content-reading: 760px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow: 0 18px 48px rgb(23 35 60 / 10%);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgb(23 35 60 / 3%) calc(100% - 1px)) 0 0 / 96px 96px, var(--canvas); font-family: var(--body-font); font-size: 17px; line-height: 1.65; text-rendering: optimizeLegibility; }
body.is-modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--active-blue); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [role="option"]:focus-visible { outline: 3px solid rgb(49 91 232 / 30%); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-header { position: sticky; top: 0; z-index: 30; background: rgb(244 246 242 / 94%); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-container { width: min(var(--content-wide), calc(100% - 48px)); min-height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 36px; }
.brand-lockup { min-height: 58px; display: inline-flex; align-items: center; gap: 13px; padding: 4px 0; border: 0; background: transparent; text-align: start; cursor: pointer; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--signal); color: var(--ink); font-family: var(--display-font); font-size: 25px; font-weight: 800; line-height: 1; transform: rotate(-2deg); }
.brand-copy { display: grid; line-height: 1.16; }
.brand-copy strong { font-family: var(--display-font); font-size: 29px; font-weight: 800; letter-spacing: -.025em; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 14px; font-weight: 500; }
.desktop-nav { display: flex; align-items: stretch; gap: 30px; align-self: stretch; }
.nav-btn, .bottom-nav-item { border: 0; background: transparent; cursor: pointer; }
.nav-btn { position: relative; min-height: 48px; padding: 0 2px; color: var(--muted); font-size: 16px; font-weight: 600; }
.nav-btn::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--active-blue); content: ""; transform: scaleX(0); transition: transform .18s ease; }
.nav-btn:hover, .nav-btn.is-active { color: var(--active-blue); }
.nav-btn.is-active::after { transform: scaleX(1); }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-inline-start: 5px; padding: 0 6px; border-radius: 50%; color: var(--paper); background: var(--ink); font-size: 14px; font-weight: 700; }
.active-dot { display: inline-block; width: 9px; height: 9px; margin-inline-start: 7px; border: 2px solid var(--canvas); border-radius: 50%; background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.main-content { width: min(var(--content-wide), calc(100% - 48px)); min-height: calc(100vh - 230px); margin: 0 auto; padding: 56px 0 104px; }
.view-section { display: none; }
.view-section.is-active { display: block; }

.hero-layout { position: relative; min-height: 620px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .8fr); align-items: center; gap: clamp(48px, 7vw, 96px); padding: 38px 0 48px; }
.hero-layout::before { position: absolute; z-index: -1; top: 18px; right: -34px; width: 146px; height: 146px; border-top: 10px solid var(--signal); border-right: 10px solid var(--signal); content: ""; }
.hero-copy { align-self: center; }
.hero-eyebrow, .section-kicker, .form-step, .modal-kicker { margin: 0 0 14px; color: var(--active-blue); font-size: 15px; font-weight: 700; letter-spacing: .015em; }
.hero-copy h1 { max-width: 760px; margin: 0; font-family: var(--display-font); font-size: clamp(48px, 5.3vw, 68px); font-weight: 800; line-height: 1.12; letter-spacing: -.045em; }
.hero-subtitle { max-width: 660px; margin: 24px 0 0; color: var(--muted); font-size: clamp(18px, 1.55vw, 21px); line-height: 1.75; }
.journey-steps { position: relative; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; }
.journey-steps::before { position: absolute; top: 18px; right: 18px; left: 18px; height: 2px; background: var(--line-strong); content: ""; }
.journey-steps li { position: relative; display: grid; gap: 2px; padding-inline-end: 18px; }
.journey-steps li > span { z-index: 1; width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 12px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--display-font); font-weight: 800; }
.journey-steps li:first-child > span { background: var(--signal); }
.journey-steps strong { font-family: var(--display-font); font-size: 17px; }
.journey-steps small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.form-card { position: relative; z-index: 10; width: 100%; padding: 36px; border: 1px solid var(--line-strong); border-top: 5px solid var(--ink); border-radius: var(--radius-sm); background: var(--paper); box-shadow: 16px 16px 0 var(--signal-soft); }
.form-card::after { position: absolute; top: 20px; left: 22px; width: 36px; height: 5px; background: var(--signal); content: ""; }
.form-group + .form-group { margin-top: 18px; }
.form-label { display: block; margin-bottom: 5px; font-family: var(--display-font); font-size: 20px; font-weight: 700; }
.form-hint { margin: 0 0 17px; color: var(--muted); font-size: 15px; }
.major-picker { position: relative; }
.major-trigger, .text-input, .search-field, .filter-field select, .form-field input, .form-field select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); }
.major-trigger { min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 15px; text-align: start; cursor: pointer; }
.field-symbol { color: var(--active-blue); font-size: 23px; font-weight: 700; }
.major-trigger[aria-expanded="true"] { border-color: var(--active-blue); box-shadow: 0 0 0 3px rgb(49 91 232 / 12%); }
.major-trigger .placeholder { color: var(--quiet); }
.major-trigger .selected { color: var(--ink); font-weight: 600; }
.select-arrow { color: var(--ink); font-size: 18px; }
.major-menu { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; left: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--line); font-family: var(--display-font); font-weight: 700; }
.icon-button, .modal-close, .modal-back { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); cursor: pointer; }
.major-search-label { display: block; padding: 11px 14px 0; color: var(--muted); font-size: 14px; }
.search-field { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.search-field.compact { width: auto; margin: 7px 14px 10px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.major-options { max-height: 340px; overflow-y: auto; padding: 0 8px 10px; }
.major-group-title { padding: 8px 10px; background: var(--canvas); color: var(--muted); font-size: 14px; font-weight: 700; }
.major-option { width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-inline-start: 3px solid transparent; background: transparent; font-size: 16px; text-align: start; cursor: pointer; }
.major-option:hover, .major-option[aria-selected="true"] { border-inline-start-color: var(--active-blue); color: var(--active-blue); background: var(--active-blue-soft); }
.inline-empty { margin: 10px 14px 14px; color: var(--muted); font-size: 15px; }
.text-input { min-height: 52px; padding: 10px 14px; font-size: 16px; }
.form-error { margin: 14px 0 0; padding: 11px 13px; border: 1px solid #efc0ba; border-inline-start: 4px solid var(--danger); border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-soft); font-size: 15px; }
.btn-primary, .btn-secondary, .btn-quiet, .btn-card-view, .btn-card-save { min-height: 46px; border-radius: var(--radius-sm); cursor: pointer; font-size: 16px; font-weight: 700; transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease; }
.btn-primary { padding: 10px 20px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); box-shadow: 4px 4px 0 var(--signal); }
.btn-primary:hover { background: #0d172c; transform: translate(-1px, -1px); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--signal); }
.btn-primary:disabled { opacity: .56; cursor: not-allowed; box-shadow: none; }
.btn-hero { width: 100%; margin-top: 22px; min-height: 56px; }
.btn-secondary, .btn-quiet { padding: 8px 15px; border: 1px solid var(--line-strong); background: var(--paper); }
.btn-secondary:hover, .btn-quiet:hover { border-color: var(--active-blue); color: var(--active-blue); }
.form-proof { margin: 18px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

.loading-card { width: min(560px, 100%); margin: 90px auto; padding: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); text-align: center; }
.loader-mark { width: 76px; height: 76px; margin: 0 auto 20px; display: grid; place-items: center; border: 8px solid var(--line); border-top-color: var(--active-blue); border-radius: 50%; animation: spin 1s linear infinite; }
.loader-mark span { font-size: 28px; animation: counter-spin 1s linear infinite; }
.loading-card h2 { margin: 0; font-family: var(--display-font); font-size: 28px; }
.loading-card p { margin: 10px 0 0; color: var(--muted); }
.progress-track { height: 10px; margin-top: 20px; overflow: hidden; background: #dfe3dd; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--active-blue); transition: width .25s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes counter-spin { to { transform: rotate(-360deg); } }

.results-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.results-header h2 { margin: 0; font-family: var(--display-font); font-size: clamp(31px, 4vw, 44px); line-height: 1.25; }
.results-header p:not(.section-kicker) { margin: 7px 0 0; color: var(--muted); font-size: 17px; }
.filters-panel { display: grid; grid-template-columns: minmax(280px, 1.8fr) repeat(2, minmax(155px, .8fr)) auto auto; align-items: end; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line-strong); }
.filter-field { color: var(--muted); font-size: 14px; font-weight: 700; }
.filter-field select { min-height: 52px; margin-top: 5px; padding: 7px 11px; color: var(--ink); font-size: 16px; }
.check-filter { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 15px; }
.check-filter input, .task-item input, .consent-field input { width: 20px; height: 20px; accent-color: var(--active-blue); }
.results-status { margin: 18px 0; color: var(--muted); font-size: 15px; }
.batch-message { padding: 13px; border: 1px solid #e5c77c; background: var(--signal-soft); color: var(--ink); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: start;
  column-gap: 24px;
  row-gap: 28px;
}
/* Cards must grow with their own content; fixed row/card heights create overlap with long Arabic copy. */
.project-card {
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  transition: background .16s ease;
}
.project-card:hover { background: var(--paper-warm); }
.project-card-main, .project-card-footer { min-width: 0; }
.project-card-main { display: grid; gap: 14px; }
.card-context { display: flex; flex-wrap: wrap; gap: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.card-context > span + span::before { margin: 0 9px; color: var(--line-strong); content: "—"; }
.card-market { color: var(--success); }
.card-title { margin: 2px 0 0; font-family: var(--display-font); font-size: clamp(24px, 2.3vw, 30px); line-height: 1.35; overflow-wrap: anywhere; }
.card-english { margin: -8px 0 0; color: var(--quiet); font-size: 14px; direction: ltr; text-align: right; }
.card-problem { margin-top: 5px; padding-top: 15px; border-top: 1px solid var(--line); }
.card-problem > span { color: var(--muted); font-size: 14px; font-weight: 700; }
.card-problem p { margin: 5px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.project-card-footer { min-width: 0; display: grid; gap: 18px; margin-top: auto; }
.card-meta { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.card-score { color: var(--ink); font-weight: 700; }
.card-actions { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.btn-card-view { padding: 9px 18px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); text-align: center; }
.btn-card-view:hover { background: #0d172c; }
.btn-card-save { min-width: 112px; padding: 8px 13px; border: 1px solid var(--line-strong); background: var(--paper); }
.btn-card-save:hover, .btn-card-save.is-saved { border-color: var(--active-blue); color: var(--active-blue); background: var(--active-blue-soft); }
.badge { display: inline-block; margin: 0 0 8px 7px; color: var(--muted); font-size: 14px; font-weight: 700; }
.badge.green { color: var(--success); }
.badge.amber { color: var(--ink); }
.empty-state { grid-column: 1 / -1; max-width: 700px; margin: 42px auto; padding: 48px 28px; border-block: 1px solid var(--line-strong); background: var(--canvas); text-align: center; }
.empty-state > span { display: block; margin-bottom: 10px; color: var(--active-blue); font-size: 34px; }
.empty-state h3 { margin: 0; font-family: var(--display-font); font-size: 28px; }
.empty-state p { max-width: 540px; margin: 10px auto 22px; color: var(--muted); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; align-items: start; justify-items: center; overflow-y: auto; padding: 42px 20px; background: rgb(10 18 34 / 72%); }
.modal-card { position: relative; width: min(900px, 100%); max-height: calc(100dvh - 84px); overflow-y: auto; overscroll-behavior: contain; padding: 42px; border-top: 6px solid var(--ink); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow); }
.modal-card-compact { width: min(610px, 100%); text-align: center; }
.student-modal { width: min(760px, 100%); }
.modal-close { position: sticky; z-index: 2; top: 0; float: left; }
.modal-back { display: none; }
.modal-title { margin: 20px 0 5px; font-family: var(--display-font); font-size: clamp(30px, 4vw, 42px); line-height: 1.25; }
.modal-english { margin: 0 0 24px; color: var(--quiet); direction: ltr; text-align: right; }
.modal-lead { color: var(--muted); font-size: 18px; }
.modal-actions, .share-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.modal-start { width: 100%; margin-top: 16px; }
.decision-actions { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--ink); }
.decision-actions .share-actions { margin-top: 16px; }
.decision-actions .share-actions > .btn-secondary { min-width: 180px; }
.help-illustration { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto; border: 2px solid var(--ink); background: var(--signal); font-size: 32px; }
.help-modal { border-top-color: var(--signal); }
.detail-block { padding: 24px 0; border-top: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 8px; font-family: var(--display-font); font-size: 22px; }
.detail-block p, .detail-block li { color: var(--ink-soft); }
.detail-block ul { margin: 8px 0 0; padding-inline-start: 22px; }
.tech-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-chip { padding: 5px 10px; border: 1px solid var(--line-strong); font-size: 14px; }
.scores-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.score-card { padding: 18px 12px; text-align: center; }
.score-card + .score-card { border-inline-start: 1px solid var(--line); }
.score-card span { display: block; color: var(--muted); font-size: 14px; }
.score-card strong { font-family: var(--display-font); font-size: 22px; }
.project-summary { padding: 13px 0; border-block: 1px solid var(--line); font-weight: 700; }
.student-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 25px; }
.form-field { display: grid; gap: 7px; font-size: 15px; font-weight: 700; }
.form-field small { color: var(--muted); font-size: 14px; font-weight: 500; }
.form-field input, .form-field select { min-height: 52px; padding: 9px 12px; font-size: 16px; }
.form-field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px rgb(167 43 43 / 12%); }
.field-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.consent-field, .privacy-note, .student-form .form-error, .form-submit { grid-column: 1 / -1; }
.consent-field { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.privacy-note { margin: 0; color: var(--muted); font-size: 14px; }

.active-header { display: grid; gap: 28px; margin-bottom: 46px; padding: 32px; border: 1px solid var(--line-strong); border-top: 5px solid var(--ink); background: var(--paper); }
.active-heading { display: flex; align-items: start; justify-content: space-between; gap: 28px; }
.active-heading h2 { margin: 7px 0 0; font-family: var(--display-font); font-size: clamp(30px, 4vw, 44px); }
.active-actions { display: grid; justify-items: end; gap: 12px; }
.active-stage { padding: 8px 12px; border-inline-start: 4px solid var(--active-blue); background: var(--active-blue-soft); font-weight: 700; }
.progress-header { display: flex; justify-content: space-between; gap: 20px; font-weight: 700; }
.roadmap-next-task { margin-top: 22px; padding: 18px 20px; border: 1px solid var(--line-strong); border-inline-start: 5px solid var(--signal); background: var(--paper-warm); }
.roadmap-next-task span { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.roadmap-next-task strong { display: block; margin-top: 4px; font-family: var(--display-font); font-size: 20px; }
.roadmap { max-width: 980px; margin: 0 auto; }
.roadmap > h3 { margin: 0; font-family: var(--display-font); font-size: 34px; }
.roadmap > p { margin: 5px 0 30px; color: var(--muted); }
.stage-card { position: relative; margin-inline-start: 26px; padding: 0 42px 42px 0; border-inline-start: 2px solid var(--line-strong); }
.stage-card:last-child { border-inline-start-color: transparent; }
.stage-header { display: flex; align-items: start; gap: 18px; margin-inline-start: -22px; }
.stage-number { z-index: 1; flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); font-family: var(--display-font); font-weight: 800; }
.stage-card.is-complete .stage-number { color: var(--paper); background: var(--success); border-color: var(--success); }
.stage-card.is-current .stage-number { background: var(--signal); }
.stage-card.is-current .stage-header h4::after { margin-inline-start: 10px; color: var(--active-blue); content: "المرحلة الحالية"; font-family: var(--body-font); font-size: 14px; font-weight: 700; }
.stage-header h4 { margin: 0; font-family: var(--display-font); font-size: 24px; }
.stage-header p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tasks-list { margin: 18px 38px 0 0; border-top: 1px solid var(--line); }
.task-item { min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.task-item:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
.fatal-error { max-width: 700px; margin: 60px auto; padding: 34px; border: 1px solid #efc0ba; border-top: 5px solid var(--danger); background: var(--paper); text-align: center; }
.toast { position: fixed; z-index: 200; right: 50%; bottom: 28px; padding: 12px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); box-shadow: var(--shadow); transform: translateX(50%); }
.clipboard-fallback { position: fixed; left: -9999px; }
.mobile-bottom-nav { display: none; }
.app-footer { width: min(var(--content-wide), calc(100% - 48px)); margin: 0 auto; padding: 42px 0 52px; display: grid; grid-template-columns: minmax(300px, 1.35fr) minmax(170px, .55fr) minmax(280px, 1fr); align-items: start; gap: 38px; border-top: 3px solid var(--ink); }
.footer-brand { display: flex; align-items: start; gap: 15px; }
.footer-brand strong { display: block; font-family: var(--display-font); font-size: 30px; line-height: 1.15; }
.footer-brand p { max-width: 430px; margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.footer-owner { display: grid; padding-top: 4px; }
.footer-owner span { color: var(--muted); font-size: 14px; }
.footer-owner strong { font-family: var(--display-font); font-size: 20px; }
.social-links { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 24px; justify-content: start; }
.social-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--active-blue); font-size: 15px; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (max-width: 980px) {
  .hero-layout { grid-template-columns: 1fr; min-height: auto; gap: 48px; }
  .hero-copy { max-width: 800px; }
  .form-card { max-width: 680px; }
  .filters-panel { grid-template-columns: 1fr 1fr; }
  .filters-panel .search-field { grid-column: 1 / -1; }
  .cards-grid { grid-template-columns: 1fr; }
  .app-footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; padding-bottom: 72px; }
  .app-header { position: relative; }
  .header-container, .main-content, .app-footer { width: min(100% - 32px, var(--content-wide)); }
  .header-container { min-height: 76px; }
  .brand-mark { width: 38px; height: 38px; font-size: 22px; }
  .brand-copy strong { font-size: 26px; }
  .brand-copy small { font-size: 14px; }
  .desktop-nav { display: none; }
  .main-content { min-height: calc(100vh - 190px); padding: 24px 0 64px; }
  .hero-layout { padding: 22px 0 30px; gap: 38px; }
  .hero-layout::before { top: -4px; right: -16px; width: 64px; height: 64px; border-width: 6px; }
  .hero-copy h1 { font-size: clamp(36px, 10.5vw, 43px); line-height: 1.17; }
  .hero-subtitle { margin-top: 18px; font-size: 17px; line-height: 1.7; }
  .journey-steps { margin-top: 32px; grid-template-columns: 1fr; gap: 0; }
  .journey-steps::before { top: 18px; right: 18px; bottom: 18px; left: auto; width: 2px; height: auto; }
  .journey-steps li { min-height: 74px; grid-template-columns: 38px 1fr; column-gap: 13px; padding: 0; }
  .journey-steps li > span { grid-row: 1 / 3; margin: 0; }
  .journey-steps small { grid-column: 2; }
  .form-card { padding: 26px 20px; box-shadow: 8px 8px 0 var(--signal-soft); }
  .form-card::after { display: none; }
  .form-label { font-size: 19px; }
  .major-menu { position: fixed; z-index: 90; inset: auto 0 0; max-height: 84dvh; overflow-y: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .major-options { max-height: 55dvh; }
  .results-header { align-items: stretch; flex-direction: column; gap: 18px; }
  .results-header h2 { font-size: 32px; }
  .filters-panel { grid-template-columns: 1fr; }
  .filters-panel .search-field { grid-column: auto; }
  .project-card { padding: 24px 0; }
  .card-title { font-size: 26px; }
  .card-actions { grid-template-columns: 1fr; }
  .btn-card-save { min-width: 0; }
  .modal-backdrop { padding: 0; }
  .modal-card { width: 100%; min-height: 100dvh; max-height: 100dvh; padding: 24px 18px 108px; border: 0; border-radius: 0; }
  .modal-close { display: grid; }
  #project-modal .modal-close { display: none; }
  .modal-back { position: sticky; z-index: 4; top: 0; display: inline-grid; float: right; margin-bottom: 12px; }
  .scores-grid { grid-template-columns: repeat(2, 1fr); }
  .score-card:nth-child(3) { border-inline-start: 0; }
  .score-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .modal-actions, .share-actions { display: grid; }
  .student-form { grid-template-columns: 1fr; }
  .consent-field, .privacy-note, .student-form .form-error, .form-submit { grid-column: auto; }
  .active-header { padding: 24px 18px; }
  .active-heading { flex-direction: column; }
  .active-actions { width: 100%; justify-items: stretch; }
  .stage-card { margin-inline-start: 20px; padding: 0 28px 34px 0; }
  .stage-header { margin-inline-start: -20px; }
  .tasks-list { margin-inline-start: 20px; margin-inline-end: 20px; }
  .empty-state { margin: 20px auto; padding: 36px 14px; }
  .mobile-bottom-nav { position: fixed; z-index: 60; right: 0; bottom: 0; left: 0; min-height: 68px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); background: rgb(255 255 255 / 97%); }
  .bottom-nav-item { position: relative; display: grid; place-items: center; align-content: center; gap: 1px; color: var(--muted); font-size: 14px; }
  .bottom-nav-item > span:first-child { display: none; }
  .bottom-nav-item.is-active { color: var(--active-blue); font-weight: 700; }
  .bottom-nav-item.is-active::before { position: absolute; top: 0; right: 22%; left: 22%; height: 3px; background: var(--active-blue); content: ""; }
  .app-footer { padding-bottom: 28px; }
  .app-footer { grid-template-columns: 1fr; gap: 26px; }
  .footer-brand { grid-column: auto; }
  .social-links { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
