/* Pearl Compass: one product system, shared by every route. */
@import url("font-subsets.css");
:root {
  --paper:#F8F7F2; --white:#FFFFFF; --ink:#172033; --muted:#667085;
  --line:#E5E7EB; --accent:#24356B; --accent-hover:#18264F;
  --deep:#18264F; --secondary:#536AA6; --gold:#C6A15B; --control-line:#8692AD;
  --lime:var(--gold); --soft:#F2F4F9; --error:#a32d24;
  --radius:8px; --panel-radius:16px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:24px; --space-6:32px; --space-7:48px;
  font-family:Arial,"Noto Sans JP",sans-serif; font-size:16px;
  color:var(--ink); background:var(--paper); font-synthesis:none;
  -webkit-font-smoothing:antialiased;
}
html[lang="ja"] { font-family:"Noto Sans JP",sans-serif; }
* { box-sizing:border-box; }
body { margin:0; }
button,input,select,textarea { font:inherit; color:inherit; }
button,a { -webkit-tap-highlight-color:transparent; touch-action:manipulation; transition:color 140ms,background 140ms,border-color 140ms; }
button { cursor:pointer; }
a { color:inherit; text-decoration:none; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
button:active { filter:brightness(.95); }
button:disabled { cursor:not-allowed; opacity:.65; }
h1,h2,h3,p { margin:0; text-wrap:pretty; }
h1,h2,h3 { font-weight:700; }
.site-header,.home,.discovery,.page,footer { width:min(1120px,calc(100% - 64px)); margin-inline:auto; }
.site-header { height:80px; display:flex; align-items:center; justify-content:space-between; gap:24px; border-bottom:1px solid var(--line); }
.brand { border:0; padding:8px 0; background:none; flex-shrink:0; }
.brand-wordmark { font-family:Jakarta,"Noto Sans JP",sans-serif; font-size:21px; font-weight:800; letter-spacing:-.7px; color:var(--accent); }
.header-actions { display:flex; align-items:center; gap:24px; }
.text-button,.close-button,.footer-link,.back-button,.report-button,.secondary-button { border:0; background:none; padding:12px 0; font-size:13px; min-height:44px; }
.text-button:hover,.footer-link:hover,.back-button:hover,.report-button:hover { color:var(--accent); text-decoration:underline; text-underline-offset:4px; }
#header-review { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 16px; border:1px solid var(--accent); border-radius:var(--radius); background:var(--accent); color:white; }
body:has(.home) #header-review { background:transparent; color:var(--accent); }
#header-review:hover { text-decoration:none; background:var(--accent-hover); color:white; }
#header-review svg { display:block; width:16px; height:16px; }
.language-toggle { min-width:48px; }
main { min-height:calc(100svh - 160px); }
main:focus { outline:none; }

/* Original centered landing composition; discovery continues below. */
.home { display:flex; align-items:center; justify-content:center; min-height:clamp(560px,calc(100svh - 160px),760px); padding:48px 32px; margin-block:16px 40px; border-radius:28px; background:#f5f2e9; }
.search-intro { width:min(680px,100%); text-align:center; }
.home-eyebrow { display:inline-flex; align-items:center; gap:8px; padding:8px 15px; border:1px solid var(--line); border-radius:999px; font-size:11px; color:var(--muted); margin-bottom:26px; }
.scope-divider { margin-inline:8px; color:var(--muted); }
.hero-wordmark { font-family:"Noto Sans JP",sans-serif; font-weight:700; font-size:clamp(38px,4.5vw,60px); letter-spacing:-.045em; line-height:1.48; }
.hero-wordmark br { display:block; }
.hero-emphasis { color:var(--accent); padding-inline:.1em; text-decoration:underline; text-decoration-color:var(--lime); text-decoration-thickness:.18em; text-underline-offset:-.04em; text-decoration-skip-ink:none; }
html[lang="ja"] .hero-wordmark { font-family:"Noto Sans JP",sans-serif; font-weight:700; font-size:clamp(38px,4.5vw,60px); letter-spacing:-.045em; line-height:1.48; }
.home-description { font-size:14px; line-height:1.9; margin:25px 0 32px; color:var(--muted); }
.home-description span + span { margin-left:.25em; }
.search-form { display:flex; align-items:center; gap:8px; width:100%; background:white; border:1px solid var(--control-line); border-radius:var(--radius); padding:5px; }
.search-form:focus-within { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:2px; }
.search-icon { width:20px; height:20px; flex:0 0 20px; margin-left:12px; color:var(--muted); }
.search-box { min-width:0; flex:1; height:48px; border:0; outline:none; background:transparent; font-size:16px; padding:0 8px; }
.search-box:focus-visible { outline:none; }
.search-box::placeholder { color:var(--muted); }
.search-submit { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; gap:10px; height:48px; padding:0 20px; border:0; border-radius:var(--radius); background:var(--accent); color:white; font-size:14px; font-weight:700; }
.search-submit svg { width:16px; height:16px; }
.search-submit:hover,.primary-button:hover { background:var(--accent-hover); }
.search-examples { display:flex; align-items:center; flex-wrap:wrap; gap:4px 16px; margin-top:12px; font-size:12px; }
.search-examples > span { color:var(--muted); }
.search-examples a { padding-block:8px; text-decoration:underline; text-decoration-color:var(--control-line); text-underline-offset:4px; }
.search-examples a:hover { text-decoration-color:var(--accent); }
.browse-link { display:inline-flex; align-items:center; gap:12px; margin-top:8px; min-height:44px; font-size:13px; }
.browse-link:hover { text-decoration:underline; text-underline-offset:4px; }
.count-label { display:inline-flex; align-items:center; justify-content:center; min-width:24px; padding:3px 6px; border-radius:4px; font:12px Arial,sans-serif; background:var(--soft); color:var(--muted); }
.browse-arrow { font-size:18px; }
.home .search-examples { justify-content:center; margin-top:19px; }
.home .browse-link { margin-top:24px; }

/* Student Commons collection: equal edges, one dominant score. */
.discovery { margin-bottom:48px; }
.discovery-filter-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-block:1px solid var(--line); }
.discovery-filters { display:flex; flex-wrap:wrap; gap:8px; }
.discovery-filters button { min-height:44px; padding:10px 14px; border:1px solid transparent; border-radius:var(--radius); background:transparent; font-size:13px; }
.discovery-filters button:hover { background:var(--soft); }
.discovery-filters button[aria-pressed="true"] { background:var(--lime); color:var(--accent); }
.catalog-note { white-space:nowrap; font-size:12px; color:var(--muted); }
.discovery-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:40px; padding-top:24px; }
.discovery-main { min-width:0; }
.discovery-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.discovery-heading h2,.section-heading { font-size:21px; line-height:1.4; letter-spacing:-.02em; }
.discovery-heading p { font-size:13px; color:var(--muted); margin-top:4px; line-height:1.6; }
.discovery-sort { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; }
.discovery-sort select { min-height:44px; max-width:150px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius); background:white; font-size:13px; }
.faculty-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.faculty-card { display:grid; grid-template-columns:80px minmax(0,1fr); align-content:start; gap:12px 16px; padding:24px; border:1px solid var(--line); border-radius:var(--panel-radius); background:white; }
.faculty-identity { display:contents; }
.faculty-identity > div:not(.professor-rating) { grid-column:2; min-width:0; align-self:center; }
.faculty-identity h3 { font-size:20px; line-height:1.35; letter-spacing:-.02em; overflow-wrap:anywhere; }
.faculty-identity h3 a:hover { text-decoration:underline; text-underline-offset:4px; }
.faculty-identity p { font-size:12px; color:var(--muted); line-height:1.6; margin-top:8px; }
.professor-rating { grid-column:1; grid-row:1 / span 2; flex:0 0 80px; min-height:88px; align-self:start; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px 8px; border-radius:var(--radius); background:var(--accent); color:white; }
.professor-rating-value { font-family:Jakarta,"Noto Sans JP",sans-serif; font-size:40px; line-height:1; font-weight:800; letter-spacing:-.04em; font-variant-numeric:tabular-nums; }
.professor-rating-label { font-size:10px; text-align:center; line-height:1.5; }
.professor-rating.is-unrated { background:var(--soft); color:var(--accent); }
.faculty-scores { grid-column:2; display:flex; flex-wrap:wrap; gap:8px 16px; margin:0; }
.faculty-scores > div { display:flex; align-items:baseline; gap:6px; }
.faculty-scores dt { color:var(--muted); font-size:12px; line-height:1.5; }
.faculty-scores dd { margin:0; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.faculty-scores small { font-size:11px; font-weight:400; color:var(--muted); }
.faculty-courses { grid-column:1 / -1; font-size:13px; color:var(--muted); line-height:1.7; border-top:1px solid var(--line); padding-top:12px; }
.faculty-card-foot { grid-column:1 / -1; display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; }
.faculty-card-foot > span { font-size:12px; color:var(--muted); }
.faculty-card-foot a { display:inline-flex; align-items:center; gap:8px; min-height:44px; font-weight:700; color:var(--accent); }
.faculty-card-foot a:hover { text-decoration:underline; text-underline-offset:4px; }
.directory-link { display:inline-flex; align-items:center; gap:12px; min-height:44px; margin-top:12px; font-size:13px; color:var(--accent); }
.directory-link:hover { text-decoration:underline; text-underline-offset:4px; }
.recent-section { margin-top:32px; }
.feed-empty,.review-empty { padding:24px 0; border-top:1px solid var(--line); }
.feed-empty h3,.review-empty h3 { font-size:18px; line-height:1.5; }
.feed-empty p,.review-empty p { color:var(--muted); font-size:14px; line-height:1.8; max-width:540px; margin:8px 0 16px; }
.empty-symbol { display:none; }
.recent-card { padding:24px 0; border-top:1px solid var(--line); }
.recent-professor { display:flex; align-items:center; justify-content:space-between; font-size:14px; font-weight:700; margin-bottom:16px; }
.recent-card .review-entry { border:0; padding:0; }
.discovery-sidebar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:32px; border-top:1px solid var(--line); padding-top:24px; }
.sidebar-card { min-width:0; }
.sidebar-eyebrow { display:none; }
.sidebar-card h2 { font-size:17px; line-height:1.5; }
.sidebar-card > p:not(.sidebar-eyebrow) { margin-top:8px; font-size:13px; line-height:1.8; color:var(--muted); }
.sidebar-link,.sidebar-review-button { display:flex; align-items:center; justify-content:space-between; gap:12px; border:0; background:none; min-height:44px; padding:12px 0; text-align:left; font-size:13px; color:var(--accent); }
.sidebar-link:hover,.sidebar-review-button:hover { text-decoration:underline; text-underline-offset:4px; }
.subject-card > a { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); font-size:13px; min-height:44px; }
.subject-card > a:last-child { border:0; }
.subject-card > a:hover { color:var(--accent-hover); }

/* Directory and profiles share the same score and text hierarchy. */
.page { padding:32px 0 48px; }
.page-eyebrow { font-size:12px; color:var(--muted); letter-spacing:.04em; margin-bottom:12px; }
.results-page { max-width:880px; }
.results-page h1,.profile-header h1 { font-family:Jakarta,"Noto Sans JP",sans-serif; font-size:clamp(28px,3vw,36px); line-height:1.3; font-weight:800; letter-spacing:-.035em; overflow-wrap:anywhere; }
html[lang="ja"] .results-page h1,html[lang="ja"] .profile-header h1 { font-family:"Noto Sans JP",sans-serif; font-weight:700; line-height:1.5; }
.results-page h1 { margin-bottom:24px; }
.results-heading { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin:24px 0 8px; font-size:18px; }
.results-heading > span { font-size:13px; color:var(--muted); font-weight:400; }
.result-row { display:grid; grid-template-columns:80px minmax(0,1fr) auto 16px; align-items:center; gap:20px; padding:24px 0; border-top:1px solid var(--line); }
.result-row:last-child { border-bottom:1px solid var(--line); }
.result-row:hover .result-name { text-decoration:underline; text-underline-offset:4px; }
.result-row .professor-rating { grid-column:1; grid-row:1; }
.result-identity { min-width:0; }
.result-name { display:block; font-size:20px; font-weight:700; line-height:1.4; overflow-wrap:anywhere; }
.result-faculty,.result-courses { display:block; margin-top:8px; color:var(--muted); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.result-metrics { font-size:12px; color:var(--muted); max-width:110px; line-height:1.5; }
.result-metrics small { font-size:12px; }
.result-arrow { font-size:18px; }
.class-result { padding:24px 0; border-top:1px solid var(--line); }
.class-result-title { font-size:19px; font-weight:700; line-height:1.6; }
.class-result-native,.course-native { display:block; font-size:12px; color:var(--muted); line-height:1.7; margin-top:4px; }
.class-result-meta { margin-top:8px; font-size:13px; color:var(--muted); }
.class-professors { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.class-professors a { display:inline-flex; align-items:center; gap:12px; min-height:44px; border:1px solid var(--line); border-radius:var(--radius); padding:10px 12px; font-size:13px; }
.class-professors a:hover { background:var(--soft); }
.empty-state { font-size:14px; line-height:1.8; color:var(--muted); padding-block:24px; }
.back-button { display:inline-flex; margin-bottom:16px; color:var(--muted); }
.profile-header { display:flex; align-items:center; justify-content:space-between; gap:32px; padding-bottom:24px; }
.profile-header > div { min-width:0; }
.profile-header > button { flex-shrink:0; }
.name-romanized { margin-top:8px; font-size:14px; color:var(--muted); overflow-wrap:anywhere; }
.profile-meta { margin-top:12px; font-size:13px; line-height:1.8; color:var(--muted); }
.official-link { display:inline-block; padding-block:8px; min-height:36px; margin-top:4px; font-size:13px; text-decoration:underline; text-underline-offset:4px; }
.primary-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:12px 18px; border:0; border-radius:var(--radius); background:var(--accent); color:white; font-size:14px; font-weight:700; }
.rating-summary { display:grid; grid-template-columns:1.25fr repeat(3,1fr); gap:24px; margin:0; padding:24px 0; border-block:1px solid var(--line); }
.rating-summary > div { display:flex; flex-direction:column; gap:12px; justify-content:center; padding-left:24px; border-left:1px solid var(--line); }
.rating-summary > div:first-child { padding:20px 24px; border:0; background:var(--soft); border-radius:var(--panel-radius); }
.rating-summary dt { font-size:13px; line-height:1.5; color:var(--muted); }
.rating-summary dd { margin:0; font-size:26px; line-height:1.2; font-weight:700; font-variant-numeric:tabular-nums; }
.rating-summary > div:first-child dd { font-family:Jakarta,"Noto Sans JP",sans-serif; font-weight:800; font-size:52px; color:var(--accent); letter-spacing:-.04em; }
.rating-summary dd small { font-size:12px; font-weight:400; margin-left:6px; color:var(--muted); }
.profile-content { display:grid; grid-template-columns:minmax(240px,1fr) minmax(0,1.7fr); gap:48px; margin-top:32px; }
.section-heading { display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.course-list { list-style:none; padding:0; margin:0; }
.course-item { display:flex; justify-content:space-between; gap:12px; border-top:1px solid var(--line); padding:16px 0; font-size:14px; line-height:1.6; }
.course-item > :first-child { min-width:0; overflow-wrap:anywhere; }
.course-item > span:last-child { flex-shrink:0; font-size:12px; color:var(--muted); }
.review-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.review-heading > span { color:var(--muted); font-size:13px; }
.secondary-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid var(--line); border-radius:var(--radius); padding:10px 16px; color:var(--accent); font-size:13px; }
.secondary-button:hover { border-color:var(--accent); background:var(--soft); }
.review-entry { border-top:1px solid var(--line); padding:24px 0; }
.review-scores { display:flex; align-items:baseline; flex-wrap:wrap; gap:12px 24px; }
.review-score { font-family:Jakarta,"Noto Sans JP",sans-serif; font-weight:800; font-size:28px; color:var(--accent); }
.review-score small { font-family:Arial,sans-serif; font-size:12px; font-weight:400; color:var(--muted); }
.difficulty { font-size:13px; color:var(--muted); }
.review-course { margin-top:12px; font-size:17px; line-height:1.6; overflow-wrap:anywhere; }
.review-term,.review-again { color:var(--muted); font-size:13px; margin-top:8px; line-height:1.6; }
.review-comment { margin-top:16px; font-size:15px; line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
.review-foot { text-align:right; margin-top:8px; }
.report-button { color:var(--muted); font-size:12px; }
footer { min-height:80px; padding:16px 0; border-top:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:16px; font-size:12px; line-height:1.7; color:var(--muted); }
.footer-link { font-size:12px; }

/* Review form: familiar controls, no glass, deliberate focus. */
.modal { width:min(600px,calc(100% - 32px)); max-height:calc(100svh - 48px); margin:auto; padding:0; border:1px solid var(--line); border-radius:var(--panel-radius); background:white; color:var(--ink); box-shadow:0 16px 64px #18264F1A; scrollbar-width:thin; }
.modal::backdrop { background:#18264F80; }
.modal form { padding:32px; }
.modal-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); padding-bottom:16px; margin-bottom:24px; }
.modal-heading h2 { font-size:24px; letter-spacing:-.025em; }
.close-button { color:var(--muted); padding:10px 8px; }
.close-button:hover { background:var(--soft); border-radius:var(--radius); }
.modal label,.modal legend { font-size:14px; font-weight:700; }
.modal > form > label,.professor-field { display:block; margin-bottom:24px; }
.professor-field > label { display:block; }
.professor-picker { position:relative; margin-top:8px; }
.modal select,.modal textarea,.professor-picker input { display:block; width:100%; padding:12px; min-height:48px; font-size:16px; font-weight:400; border:1px solid var(--control-line); border-radius:var(--radius); background:white; }
.modal select,.modal textarea { margin-top:8px; }
.modal select:disabled { background:var(--soft); color:var(--muted); cursor:not-allowed; }
.modal textarea { min-height:136px; line-height:1.7; resize:vertical; }
.visually-hidden { display:none !important; }
.professor-suggestions { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:5; list-style:none; padding:4px; margin:0; max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:white; box-shadow:0 8px 24px #18264F14; }
.professor-suggestions[hidden] { display:none; }
.professor-suggestion { display:flex; flex-direction:column; gap:4px; width:100%; min-height:48px; padding:12px; text-align:left; border:0; border-radius:4px; background:white; font-size:14px; }
.professor-suggestion:hover,.professor-suggestion[aria-selected="true"] { background:var(--soft); }
.professor-suggestion small,.professor-no-results { font-size:12px; color:var(--muted); }
.professor-no-results { padding:12px; }
.field-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:24px; }
.field-grid > label { min-width:0; }
.modal fieldset { border:0; margin:0 0 24px; padding:0; min-width:0; }
.modal legend:has(.field-hint) { display:flex; align-items:baseline; gap:4px 12px; flex-wrap:wrap; }
.field-hint { font-size:12px; font-weight:400; color:var(--muted); }
.rating-row { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:12px; }
.rating-option { position:relative; flex:1; }
.rating-option input { position:absolute; width:1px; height:1px; opacity:0; }
.rating-option span { display:grid; place-items:center; height:48px; border:1px solid var(--control-line); border-radius:var(--radius); font-size:15px; font-weight:700; cursor:pointer; }
.rating-option:hover span { background:var(--soft); border-color:var(--accent); }
.rating-option input:checked + span { background:var(--accent); border-color:var(--accent); color:white; }
.rating-option input:focus-visible + span { outline:2px solid var(--accent); outline-offset:3px; }
.choice-row { display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; }
.choice { display:flex; align-items:center; gap:8px; padding:12px 16px; min-height:48px; min-width:88px; border:1px solid var(--control-line); border-radius:var(--radius); cursor:pointer; }
.choice:has(input:checked) { background:var(--soft); border-color:var(--accent); }
.choice:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:3px; }
.choice input { accent-color:var(--accent); margin:0; }
.comment-help,.review-storage-note { font-size:12px; font-weight:400; color:var(--muted); line-height:1.7; }
.comment-help { display:block; margin-top:8px; }
.review-storage-note { margin-bottom:16px; }
.form-error { margin-bottom:12px; color:var(--error); font-size:14px; line-height:1.6; }
.form-error:empty { display:none; }
.modal .primary-button { width:100%; }
.compact-modal p { font-size:15px; line-height:1.8; margin-bottom:24px; color:var(--muted); }
.toast { display:none; position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:calc(100% - 32px); width:max-content; background:var(--ink); color:white; padding:12px 20px; border-radius:var(--radius); font-size:14px; line-height:1.6; z-index:10; }
.toast.visible { display:block; }
body:has(dialog[open]) { overflow:hidden; }
/* Rounded language for action controls; content panels stay softly shaped. */
.search-form { border-radius:var(--radius); padding:6px; }
#header-review,.primary-button,.secondary-button,.discovery-filters button,
.class-professors a,.choice { border-radius:var(--radius); }
.search-icon { margin-left:14px; }
.faculty-card { padding:26px; }
.professor-rating { border-radius:12px; }
.rating-summary > div:first-child { border-radius:12px; }
.professor-suggestion { border-radius:6px; }

@media(max-width:900px) {
  .faculty-cards { grid-template-columns:1fr; }
  .profile-content { gap:32px; grid-template-columns:minmax(200px,1fr) minmax(0,1.5fr); }
  .discovery-sidebar { gap:24px; }
}
@media(max-width:700px) {
  .site-header,.home,.discovery,.page,footer { width:calc(100% - 40px); }
  .site-header { height:auto; min-height:72px; padding-block:12px; flex-wrap:wrap; gap:8px 16px; }
  .header-actions { gap:12px; }
  .header-actions > .text-button:first-child { display:none; }
  .brand-wordmark { font-size:19px; }
  .home { padding:40px 20px; min-height:560px; margin-block:12px 32px; border-radius:var(--panel-radius); }
  .hero-wordmark,html[lang="ja"] .hero-wordmark { font-size:clamp(30px,7vw,44px); }
  .hero-wordmark br { display:block; }
  .hero-emphasis::before { content:none; }
  .home-description { margin:22px 0 28px; font-size:13px; }
  .discovery-filter-bar { align-items:flex-start; flex-direction:column; gap:8px; }
  .discovery-filters { gap:4px; }
  .discovery-filters button { padding:10px 12px; }
  .discovery-sidebar { grid-template-columns:1fr; gap:24px; }
  .sidebar-card + .sidebar-card { border-top:1px solid var(--line); padding-top:24px; }
  .page { padding-block:24px 40px; }
  .profile-header { align-items:flex-start; flex-direction:column; gap:16px; }
  .profile-content { grid-template-columns:1fr; gap:32px; }
  .rating-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
  .rating-summary > div { padding-left:16px; }
  .rating-summary > div:nth-child(3) { border-left:0; padding-left:0; }
  .rating-summary > div:first-child { padding:16px; }
  .rating-summary > div:first-child dd { font-size:46px; }
  .result-row { grid-template-columns:72px minmax(0,1fr); gap:8px 16px; }
  .result-row .professor-rating { grid-row:1 / span 2; }
  .result-identity,.result-metrics { grid-column:2; }
  .result-arrow { display:none; }
  .result-name { font-size:18px; }
  .result-metrics { max-width:none; }
  footer { flex-direction:column; align-items:flex-start; gap:4px; }
}
@media(max-width:480px) {
  .site-header { align-items:center; }
  .header-actions { justify-content:flex-end; flex:1; gap:8px; }
  #header-review { padding:10px 12px; font-size:12px; }
  #header-review svg { display:none; }
  .language-toggle { font-size:12px; }
  .faculty-card { padding:20px 16px; grid-template-columns:72px minmax(0,1fr); gap:12px; }
  .faculty-identity h3 { font-size:18px; }
  .professor-rating { min-height:84px; }
  .professor-rating-value { font-size:36px; }
  .faculty-scores { gap:8px 12px; }
  .faculty-scores dt { font-size:12px; }
  .faculty-card-foot { flex-wrap:wrap; }
  .discovery-heading { align-items:flex-start; }
  .discovery-heading h2 { font-size:20px; }
  .discovery-sort { flex-direction:column; align-items:flex-end; gap:4px; }
  .discovery-sort select { max-width:124px; }
  .search-form { gap:4px; }
  .search-icon { margin-left:8px; width:18px; flex-basis:18px; }
  .search-box { padding:0 4px; }
  .search-box::placeholder { font-size:13px; }
  .search-submit { padding:0 14px; font-size:13px; }
  .search-submit svg { display:none; }
  .modal { width:calc(100% - 24px); max-height:calc(100svh - 24px); }
  .modal form { padding:24px 20px; }
  .modal-heading h2 { font-size:22px; }
  .rating-row { gap:8px; }
}
@media(prefers-reduced-motion:reduce) { button,a { transition:none; } }
@media(max-width:360px) {
  .modal form { padding:20px 16px; }
  .rating-row { gap:4px; }
}
