:root {
  --ink: #26322e;
  --muted: #65716b;
  --blue: #3659d9;
  --blue-soft: #edf1fc;
  --line: #e4e8e0;
  --surface: #fff;
  --background: #f6f7f4;
  --pending: #906018;
  --pending-soft: #fbf3e3;
  --danger: #ad403d;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--background); color-scheme: light; }
body { margin: 0; color: var(--ink); font: 15px/1.7 var(--sans); }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #8098ed; outline-offset: 3px; }
a { color: var(--blue); text-underline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #dce5ff; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Property facts extend the existing residence detail, not a second search UI. */
.property-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.property-heading h2 { font-size: 18px; font-weight: 600; }
.property-heading > span, .property-caption { color: var(--muted); font-size: 12px; line-height: 1.8; }
.property-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-top: 22px; }
.property-facts > div { min-width: 0; }
.property-facts dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.property-facts dd { font-size: 15px; overflow-wrap: anywhere; }
.property-wide { grid-column: 1 / -1; }
.property-difference { display: block; color: var(--pending); font-size: 12px; font-weight: 400; }
.property-qualification { margin-top: 18px; padding: 10px 12px; border-radius: 8px; background: var(--pending-soft); color: var(--pending); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.property-panel > .property-caption { margin-top: 7px; }
.property-fold { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.property-fold > summary { color: var(--ink); font-size: 14px; }
.property-fold > summary span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.property-observation { padding: 17px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.property-observation:last-child { padding-bottom: 0; border-bottom: 0; }
.property-observation-top { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.property-observation-top a { text-decoration: none; }
.property-observation p.property-value { margin: 7px 0 4px; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.6; font-variant-numeric: tabular-nums; }
.property-observation .property-caption { margin-top: 4px; }
.property-observation-note { margin-top: 3px; }
.property-observation-note > summary { min-height: 32px; padding: 4px 0; }
.property-source-links { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }

/* A compact identity; the interface starts with the query, not a cover page. */
.topbar { width: min(100% - 64px, 1120px); min-height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 21px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; }
.brand-dot { color: var(--blue); margin-left: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.district-button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); font-size: 14px; font-weight: 600; }
.district-button::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--blue); vertical-align: 1px; }
.icon-button { min-width: 44px; min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.district-button:hover, .icon-button:hover { color: var(--blue); }
.app-shell { width: min(100% - 64px, 1120px); margin: 0 auto; }

/* Filter sheet and a directory; one family of rounded, quiet surfaces. */
#listing { display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 36px; padding-top: 24px; align-items: start; }
.controls { position: sticky; top: 24px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #f1f3ee; }
.mode-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; transition: color .15s, background .15s; }
.mode-tabs button.selected { color: var(--blue); background: var(--surface); font-weight: 600; box-shadow: 0 2px 6px #26322e08; }
.mode-tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.search-form { position: relative; display: flex; align-items: center; min-height: 58px; margin-top: 20px; border: 1px solid #d7ddd2; border-radius: 13px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.search-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px #3659d912; }
.search-icon { width: 19px; height: 19px; margin-left: 14px; flex: 0 0 auto; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search-form input { min-width: 0; width: 100%; height: 56px; padding: 0 30px 0 10px; border: 0; border-radius: 13px; color: var(--ink); background: transparent; font-size: 16px; outline: none; }
.search-form input::placeholder { color: #7d877f; }
.primary-button { flex: 0 0 auto; min-height: 44px; min-width: 56px; padding: 0 12px; margin-right: 6px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-size: 14px; font-weight: 600; transition: background .15s; }
.primary-button:hover { background: #2947bc; }
.clear-button { flex: 0 0 auto; width: 32px; height: 44px; margin-left: -30px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.control-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.year-control { display: flex; align-items: center; gap: 8px; }
.year-control select { min-height: 44px; padding: 4px; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.results-area { min-width: 0; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; margin-bottom: 20px; }
.result-heading h2 { font-size: 19px; font-weight: 600; line-height: 1.5; }
.result-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.result-heading p:empty { display: none; }
.result-count { flex: 0 0 auto; padding: 3px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.result-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.school-card, .residence-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.school-card:has(a:hover), .residence-card:has(a:hover) { border-color: #acbaeb; box-shadow: 0 4px 16px #354da908; }
.school-entry { display: grid; grid-template-columns: 46px minmax(0, 1fr) 18px; align-items: center; gap: 18px; min-height: 112px; height: 100%; padding: 20px; border-radius: inherit; color: var(--ink); text-decoration: none; }
.school-entry:hover h2 { color: var(--blue); }
.place-symbol { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 50px; border-radius: 13px; background: var(--blue-soft); color: #5673c8; }
.place-symbol svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.place-symbol.junior { color: #668150; background: #f0f4e8; }
.place-symbol.residence { color: #8a7559; background: #f7f1e8; }
.entry-body { min-width: 0; }
.entry-body h2 { font-size: 18px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.entry-summary, .address { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.entry-profile { margin-top: 5px; color: var(--blue); font-size: 12px; }
.entry-arrow { color: #8e9b90; font-size: 21px; line-height: 1; font-family: var(--sans); }
.residence-card .class-label { margin-top: 7px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; }
.pager button { min-height: 44px; min-width: 84px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; }
.pager button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pager button:disabled { cursor: default; color: #989f95; background: transparent; }
.pager span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* The same sheet, with community headings and residential rows one level apart. */
#detail { max-width: 800px; margin: 0 auto; padding-top: 8px; }
.detail-top { position: relative; padding: 8px 0 24px; }
.back-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.back-button:hover { color: var(--blue); }
.detail-eyebrow { margin-top: 16px; color: var(--muted); font-size: 13px; }
.detail-eyebrow span { padding: 0 8px; color: #aab2a6; }
.detail-top h1 { margin-top: 8px; font-size: 29px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.detail-meta, .detail-alias { margin-top: 8px; color: var(--muted); font-size: 14px; }
.detail-tabs { position: sticky; top: 12px; z-index: 2; display: flex; gap: 5px; max-width: 100%; overflow-x: auto; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #eef1e9; }
.detail-tabs button { flex: 1 0 auto; min-height: 46px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.detail-tabs button.selected { color: var(--blue); background: var(--surface); font-weight: 600; box-shadow: 0 2px 5px #26322e08; }
.detail-panel { margin-bottom: 20px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.scope-panel { padding: 0; border: 0; background: transparent; }
.panel-lead { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.campus-section + .campus-section { margin-top: 30px; }
.campus-title { margin: 8px 0 16px; }
.campus-title h2, .detail-panel > h2 { font-size: 18px; font-weight: 600; }
.community-group { margin-bottom: 16px; padding: 0 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.community-heading { padding: 18px 0 12px; }
.community-name { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; }
.community-heading h2 { font-size: 18px; font-weight: 600; line-height: 1.6; }
.collection-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.scope-condition { margin: 0 0 12px; padding: 10px 13px; border-radius: 9px; background: #f3f5ef; color: #51614f; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.scope-warning { margin: 8px 0 14px; padding: 12px 14px; border-radius: 10px; color: var(--pending); background: var(--pending-soft); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.residence-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 16px 0; border-bottom: 1px solid #edf0e9; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.residence-row:last-child { border-bottom: 0; }
.residence-row:hover strong { color: var(--blue); }
.residence-content { min-width: 0; }
.residence-name { display: block; }
.residence-row strong { font-size: 16px; font-weight: 500; line-height: 1.75; }
.residence-pending { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 5px; background: var(--pending-soft); color: var(--pending); font-size: 12px; line-height: 1.6; white-space: nowrap; vertical-align: 1px; }
.residence-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.row-arrow { flex-shrink: 0; color: #92a18f; font-size: 23px; font-family: var(--sans); }
.scope-evidence { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.scope-evidence summary { width: fit-content; min-height: 44px; padding: 11px 0; font-size: 13px; }
.scope-evidence summary::marker { font-size: 10px; color: #87967f; }
.community-evidence { margin-top: 8px; border-top: 1px solid var(--line); padding: 2px 0 4px; }
.scope-evidence p { margin-top: 10px; line-height: 1.85; white-space: pre-wrap; }
.scope-original { padding: 14px 16px; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9f6; color: #4c5a4b; font-size: 14px; }
.scope-original > p:first-child { margin-top: 0; }
.community-related, .archived-rows { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.community-related h3, .archived-rows h3 { font-size: 14px; font-weight: 600; }
.community-related a { display: block; padding: 13px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.community-related small { display: block; margin-top: 4px; color: var(--muted); }
.community-empty { padding: 16px 0 22px; color: var(--muted); font-size: 14px; }
.candidate-materials { margin-top: 24px; padding: 4px 24px; border-top: 1px solid var(--line); }
.candidate-materials > summary { padding: 16px 0; color: var(--muted); font-size: 14px; }
.candidate-materials > summary span { margin-left: 10px; font-size: 13px; }
.candidate-materials > .small-note { margin-bottom: 8px; }
.candidate-reference { padding: 16px 0; border-bottom: 1px solid var(--line); }
.candidate-reference:last-child { border-bottom: 0; }
.candidate-reference > p { margin-top: 10px; }
.empty, .scope-empty { padding: 38px 24px; border: 1px dashed #d5dcce; border-radius: 16px; background: #f1f4ea; color: #5d6d54; font-size: 14px; text-align: center; line-height: 1.9; }
.result-list > .empty { grid-column: 1 / -1; }
.path-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 22px 0; border-top: 1px solid var(--line); }
.path-row:last-child { padding-bottom: 0; }
.path-row strong { font-size: 18px; font-weight: 600; }
.path-row p { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.path-status, .class-label { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 12px; line-height: 1.7; }
.path-status.official, .class-label.scope_direct { color: var(--blue); background: var(--blue-soft); }
.path-status.pending, .class-label.residence_candidate, .class-label.historical_collection { color: var(--pending); background: var(--pending-soft); }
.class-label.official_crosscheck { color: #586c50; background: #eef3e8; }
.class-label.excluded { color: #95504c; background: #faf0ed; }
.source-list { display: grid; }
.source-row { padding: 18px 0; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.source-row:first-child { border-top: 0; }
.source-row small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; }
.profile-campus-picker { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.profile-campus-picker select { flex: 1; min-width: 0; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.profile-panel, .profile-section, .profile-field, .profile-field dd, .exam-observation { min-width: 0; overflow-wrap: anywhere; }
.profile-section + .profile-section, .profile-reference, .exam-year + .exam-year { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.profile-section h2, .profile-reference > h2, .exam-year > h2 { margin-bottom: 12px; font-size: 18px; font-weight: 600; }
.school-profile-facts { display: grid; gap: 18px; }
.profile-field dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.profile-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.profile-caption { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-identity + .profile-identity { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.profile-identity .school-profile-facts { gap: 10px; }
.profile-identity .profile-field { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.profile-identity .profile-field dt { margin-bottom: 0; }
.profile-identity .profile-text { line-height: 1.6; }
.profile-identity-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.profile-reference { padding: 18px; border: 1px solid #e9dfca; border-radius: 12px; background: #fcfaf5; }
.profile-panel > .profile-reference:first-child { margin-top: 0; }
.profile-subject-reference > .profile-reference { padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.profile-reference > h2 { color: var(--pending); }
.profile-reference > .profile-caption { margin-bottom: 18px; }
.profile-reference .profile-section h2 { font-size: 15px; }
.profile-evidence { margin-top: 4px; }
.profile-evidence > summary { min-height: 36px; padding: 6px 0; }
.profile-evidence .source-row { padding: 9px 0; font-size: 13px; }
.profile-evidence .source-row small { font-size: 12px; }
.profile-empty-note { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.exam-group { margin-top: 20px; }
.exam-group > h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.exam-reference > h3 { color: var(--pending); }
.exam-observation { padding: 18px 0; border-bottom: 1px solid var(--line); }
.exam-observation:last-child { padding-bottom: 0; border-bottom: 0; }
.exam-observation h3 { color: var(--muted); font-size: 13px; font-weight: 400; }
.exam-value { margin-top: 7px; font-size: 17px; }
.profile-source-heading { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.community-evidence .source-row { padding: 12px 0; font-size: 13px; }
.community-evidence .source-row small { font-size: 12px; }
.membership-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.membership-row strong { font-size: 17px; font-weight: 500; }
.membership-row span { display: block; margin-top: 6px; color: var(--pending); font-size: 13px; }
.small-note { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.relations-title { margin-top: 30px; }
.relation-card { padding: 22px 0; border-bottom: 1px solid var(--line); }
.relation-card:last-child { border-bottom: 0; }
.relation-card strong { font-size: 17px; font-weight: 600; }
.relation-card .class-label { margin: 10px 0; }
.relation-scope { color: #51614f; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.condition { margin-top: 12px; padding: 12px; border-radius: 9px; background: var(--background); color: var(--muted); font-size: 13px; }

/* Feedback and sheets are part of the same interface, not browser defaults. */
.loading { opacity: .55; transition: opacity .15s; }
.loading-detail { padding: 64px 0; color: var(--muted); text-align: center; }
.error { margin: 20px 0; padding: 16px; border: 1px solid #efc9c2; border-radius: 12px; background: #fdf0ed; color: var(--danger); font-size: 14px; }
footer { margin-top: 38px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.9; text-align: center; }
dialog { width: min(92vw, 480px); max-height: 85dvh; padding: 24px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 80px #26322e22; }
dialog::backdrop { background: #26322e55; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 18px; }
.dialog-head h2 { font-size: 20px; font-weight: 600; }
.dialog-close { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f2f4ef; color: var(--muted); font-size: 25px; }
.district-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.district-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 56px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; font-size: 14px; }
.district-option.selected { border-color: #abbbea; color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.district-option:hover { border-color: #abbbea; }
.district-option small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.info-list { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 20px 14px; font-size: 14px; }
.info-list dt { color: var(--ink); font-weight: 600; }
.info-list dd { color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 20; max-width: 90vw; padding: 12px 18px; transform: translateX(-50%); border-radius: 12px; color: #fff; background: var(--ink); font-size: 14px; }

@media (min-width: 1180px) {
  .result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-entry { min-height: 136px; padding: 20px 16px; gap: 13px; }
  .entry-body h2 { font-size: 17px; }
  .entry-summary { font-size: 12px; }
}
@media (max-width: 959px) {
  .topbar { width: min(100% - 40px, 680px); min-height: 76px; }
  .wordmark { font-size: 20px; gap: 8px; }
  .app-shell { width: min(100% - 40px, 680px); }
  #listing { display: block; padding-top: 8px; }
  .controls { position: static; padding: 16px; border-radius: 18px; }
  .search-form { margin-top: 14px; }
  .control-foot { margin-top: 8px; padding-top: 4px; border-top: 0; }
  .results-area { margin-top: 26px; }
  .result-heading { margin-bottom: 14px; }
  .result-heading h2 { font-size: 17px; }
  .school-entry { min-height: 104px; padding: 18px 16px; grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 13px; }
  .place-symbol { width: 40px; height: 44px; border-radius: 11px; }
  .place-symbol svg { width: 27px; height: 27px; }
  .entry-body h2 { font-size: 17px; }
  .entry-summary { font-size: 12px; }
  #detail { padding-top: 0; }
  .detail-top { padding-top: 0; padding-bottom: 22px; }
  .detail-eyebrow { margin-top: 12px; font-size: 12px; }
  .detail-top h1 { font-size: 25px; }
  .detail-tabs { top: 8px; margin-bottom: 20px; }
  .community-group { padding: 0 18px; border-radius: 16px; }
  .community-heading { padding-top: 17px; }
  .community-heading h2 { font-size: 18px; }
  .community-name { gap: 4px 8px; }
  .collection-hint { font-size: 12px; }
  .scope-condition { font-size: 13px; padding: 9px 11px; }
  .detail-panel:not(.scope-panel) { padding: 20px; }
  .residence-row { min-height: 60px; padding: 14px 0; }
  .residence-row strong { font-size: 16px; }
  .candidate-materials { padding: 4px 18px; }
  footer { margin-top: 28px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); font-size: 12px; text-align: left; }
  dialog { width: min(calc(100% - 24px), 460px); padding: 20px; border-radius: 20px; }
}
@media (max-width: 359px) {
  .app-shell, .topbar { width: calc(100% - 32px); }
  .topbar-actions { gap: 2px; }
  .wordmark { font-size: 17px; gap: 6px; }
  .brand-mark { width: 29px; height: 29px; }
  .district-button { padding: 7px 10px; font-size: 12px; }
  .district-button::before { margin-right: 6px; width: 6px; height: 6px; }
  .icon-button { font-size: 12px; padding: 4px; }
  .controls { padding: 12px; }
  .search-icon { margin-left: 10px; }
  .search-form input { padding-left: 7px; }
  .school-entry { padding: 16px 12px; gap: 10px; grid-template-columns: 34px minmax(0, 1fr) 14px; }
  .place-symbol { width: 34px; height: 40px; }
  .place-symbol svg { width: 25px; height: 25px; }
  .entry-body h2 { font-size: 16px; }
  .detail-top h1 { font-size: 23px; }
  .detail-tabs button { padding-inline: 3px; font-size: 13px; }
  .community-group { padding-inline: 15px; }
  .district-option { padding: 10px; gap: 4px; font-size: 13px; }
  .district-option small { font-size: 10px; }
  .info-list { grid-template-columns: 1fr; gap: 7px; }
  .info-list dd { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; transition: none !important; animation: none !important; }
}
