/* 中考估分 + 学校分数线 (estimate.html). Base tokens, header, buttons and footer come from portal.css. */
.estimate-page {
  --night: #0a1530; --night-2: #13295a; --focus: #ffc861;
  background: var(--canvas);
}
.desktop-nav a[aria-current="page"] { color: var(--blue); }
.tool-main { padding-bottom: 72px; }
.notice { margin-block: 24px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.field-error { margin-top: 4px; color: #c2372c; font-size: 13px; }

/* ================= Entry ================= */
.entry { padding-top: clamp(24px, 4vw, 48px); }
.entry-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 18px 32px; margin-bottom: 24px; }
.entry-head h1 { margin-top: 6px; font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: -.045em; }
.mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: #e9eef7; min-width: min(460px, 100%); }
.mode-switch button { position: relative; z-index: 1; display: grid; gap: 1px; padding: 10px 14px; border: 0; background: none; text-align: start; border-radius: 12px; color: var(--muted); transition: color 250ms; }
.mode-switch b { font-size: 17px; }
.mode-switch small { font-size: 12px; }
.mode-switch button[aria-pressed="true"] { color: var(--ink); }
.mode-switch button[aria-pressed="true"] b { color: var(--blue); }
.mode-thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px #1f365a1f; transition: transform 450ms cubic-bezier(.3, 1.25, .4, 1); }
.mode-switch.second .mode-thumb { transform: translateX(100%); }

.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.score-form { --pad: clamp(16px, 2.4vw, 28px); min-width: 0; padding: var(--pad); background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.form-tip { margin-bottom: 14px; color: var(--muted); font-size: 15px; }
.form-tip b { color: var(--ink); }
kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--canvas); font: 600 12px var(--ui); }

.subject-group { margin: 0; padding: 14px 0 6px; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.subject-group:first-child { border-top: 0; padding-top: 0; }
.subject-group legend { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.subject-group legend span { font-weight: 700; font-size: 15px; }
.subject-group legend small { color: var(--muted); font-size: 13px; }
.subject-row { clear: both; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.subject { min-width: 0; }
.subject label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.subject-input { position: relative; display: flex; align-items: center; height: 56px; padding-inline: 14px 12px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fbfcfe; transition: border-color 180ms, box-shadow 180ms, background-color 180ms; }
.subject-input:focus-within { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px #2854a31f; }
.subject-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: 700 24px/1 var(--ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.subject-input input::placeholder { color: #c5cfdd; font-weight: 400; }
.subject-input > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.subject-ok { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--steady); box-shadow: 0 0 0 3px #fff; transform: scale(0); transition: transform 300ms cubic-bezier(.3, 1.6, .5, 1); }
.subject-ok::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.subject.is-valid .subject-ok { transform: scale(1); }
.subject.is-valid .subject-input { border-color: #b9d8c7; }
.subject [aria-invalid="true"] { color: #c2372c; }
.subject-note { min-height: 20px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.subject-note b { color: var(--blue); }

.total-panel { padding: 8px 0 4px; }
.total-label { display: block; font-weight: 700; margin-bottom: 8px; }
.total-input { display: flex; align-items: baseline; gap: 10px; padding: 8px 18px; border: 1.5px solid var(--line-strong); border-radius: 18px; background: #fbfcfe; transition: border-color 180ms, box-shadow 180ms; }
.total-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px #2854a31f; background: #fff; }
.total-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 700 clamp(44px, 7vw, 64px)/1.15 var(--ui); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.total-input input::placeholder { color: #ccd5e2; font-weight: 600; }
.total-input span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.total-range { --p: 0%; width: 100%; height: 36px; margin-top: 18px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.total-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--p), #dfe6f2 var(--p)); }
.total-range::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--p), #dfe6f2 var(--p)); }
.total-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 3px 10px #1f365a33; }
.total-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); }
.range-marks { position: relative; height: 22px; color: var(--muted); font-size: 12px; }
.range-marks span { position: absolute; top: 0; white-space: nowrap; }
.range-marks span:first-child { left: 0; } .range-marks span:last-child { right: 0; }
.range-marks .mark-general { left: 43.6%; translate: -50% 0; }
.range-marks .mark-first { left: 82.1%; translate: -50% 0; }

.bonus-box { margin-top: 16px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.bonus-box summary { display: flex; align-items: center; gap: 8px; min-height: 40px; list-style: none; color: var(--blue); font-size: 15px; font-weight: 700; }
.bonus-box summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--blue-soft); transition: transform 250ms; }
.bonus-box[open] summary::before { transform: rotate(45deg); }
.bonus-box summary span { margin-inline-start: auto; color: var(--steady); }
.bonus-body { display: grid; grid-template-columns: auto 140px 1fr; align-items: center; gap: 6px 12px; padding: 8px 0 4px; }
.bonus-body label { font-size: 15px; font-weight: 700; }
.mini-input { display: flex; align-items: center; height: 46px; padding-inline: 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; }
.mini-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px #2854a31f; }
.mini-input input { flex: 1; min-width: 0; border: 0; outline: 0; font: 700 20px var(--ui); background: none; }
.mini-input span { color: var(--muted); font-size: 13px; }
.bonus-note { color: var(--muted); font-size: 13px; }
.bonus-body .field-error { grid-column: 1 / -1; }

/* live summary card: light, quiet, no buttons — the only next step sits at the bottom of the form */
.dial-card { position: sticky; top: calc(var(--header) + 16px); padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: #fff; color: var(--ink); }
.dial-title { font-size: 15px; font-weight: 700; color: var(--muted); }
.dial { position: relative; width: min(190px, 100%); margin: 4px auto 2px; }
.dial svg { display: block; width: 100%; transform: rotate(-90deg); overflow: visible; }
.dial-track { fill: none; stroke: #edf2fa; stroke-width: 12; }
.dial-fill { fill: none; stroke: var(--blue-light); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 0 1000; transition: stroke-dasharray 650ms cubic-bezier(.2, .8, .2, 1), stroke 400ms; }
.dial-card.is-complete .dial-fill { stroke: var(--blue); }
.dial-mark { stroke-width: 2.5; stroke-linecap: round; }
.dial-mark.general { stroke: var(--deco); } .dial-mark.first { stroke: #e2981c; }
.dial-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-center strong { font-size: 56px; font-weight: 700; letter-spacing: -.05em; line-height: 1; color: var(--ink); }
.dial-card.is-complete .dial-center strong { color: var(--blue); }
.dial-center span { margin-top: 6px; font-size: 13px; color: var(--muted); }
.line-checks { list-style: none; display: grid; gap: 6px; margin-top: 10px; }
.line-checks li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--canvas); font-size: 13px; color: var(--muted); transition: background-color 300ms; }
.line-checks b { color: var(--ink); }
.line-checks i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #b8c4d6; transition: background-color 300ms, border-color 300ms; }
.line-checks li.passed { background: var(--steady-soft); }
.line-checks li.passed i { background: var(--steady); border-color: var(--steady); box-shadow: inset 0 0 0 3px #fff; }
.line-checks em { font-style: normal; font-weight: 700; font-size: 12px; color: var(--muted); }
.line-checks li.passed em { color: var(--steady); }
.mix { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mix:empty { display: none; }
.mix-row { display: grid; grid-template-columns: 4.2em 1fr 4.8em; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mix-track { height: 6px; border-radius: 99px; background: #edf2fa; overflow: hidden; }
.mix-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue-light); transition: width 600ms cubic-bezier(.2, .8, .2, 1); }
.mix-row b { text-align: end; color: var(--ink); font-variant-numeric: tabular-nums; }
.mix-row small { color: var(--muted); font-weight: 400; }
.dial-foot { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; }

/* the one next step, at the end of the form */
.form-submit { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin: 18px calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding: 18px var(--pad); border-top: 1px solid var(--line); border-radius: 0 0 22px 22px; background: #f7f9fd; }
.submit-status { color: var(--muted); font-size: 15px; font-weight: 600; }
.submit-status.done { color: var(--steady); }
.submit-status.done::before { content: "✓ "; }
.go-button { min-height: 54px; padding-inline: 28px; font-size: 17px; box-shadow: 0 8px 22px -8px #2854a399; }
.skip-estimate { margin-top: 6px; color: var(--muted); font-size: 15px; }
.skip-estimate .text-link { min-height: 32px; font-size: 15px; }
.sticky-bar { display: none; }

/* ================= Results: iPhone-style cards ================= */
.estimate-page {
  /* One palette for the whole section: brand blue for anything you can tap, three fit colours, two text greys. */
  --accent: var(--blue); --accent-soft: var(--blue-soft); --accent-hover: var(--blue-hover); --blue-light: #8fb0e6;
  --ios-ink: var(--ink); --ios-2: var(--muted); --ios-3: #5f6b7a; --deco: #c3cad5; --ios-fill: #e9edf3;
  --ios-card-shadow: 0 1px 2px #0000000a, 0 8px 24px #18263d0d;
  --reach: #a64b05; --reach-soft: #fff1e0; --steady: #1b7a43; --steady-soft: #e6f6ec; --safe: #2c6a72; --safe-soft: #e4f1f2; --far: #5f6b7a; --far-soft: #f1f3f6; }
.results-wrap { max-width: 1080px; padding-top: clamp(24px, 4vw, 48px); }
.hero-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-inline: 4px; }
.hero-kicker { color: var(--ios-2); font-size: 15px; font-weight: 600; }
.hero-score h1 { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; color: var(--ios-ink); font-size: 56px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.hero-score h1 small { font-size: 20px; font-weight: 600; color: var(--ios-2); letter-spacing: 0; }
.hero-score h1:focus { outline: none; }
.hero-gaps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--ios-2); font-size: 15px; font-weight: 400; }
.hero-gaps .up { color: var(--steady); }
.hero-gaps .down { color: var(--reach); }
.ios-button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 200ms, transform 150ms; }
.ios-button:hover { background: #dde7f8; }
.ios-button:active { transform: scale(.97); }

/* segmented control */
.seg { --n: 4; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 28px; padding: 3px; border-radius: 12px; background: var(--ios-fill); }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; background: none; color: var(--ios-ink); font-size: 15px; font-weight: 400; border-radius: 9px; }
.seg button small { color: var(--ios-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] { font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 9px; background: #fff; box-shadow: 0 3px 8px #0000001f, 0 3px 1px #0000000a; transform: translateX(calc(var(--seg-i, 0) * 100%)); transition: transform 380ms cubic-bezier(.3, 1.1, .4, 1); }
.seg-caption { margin-top: 10px; padding-inline: 4px; color: var(--ios-2); font-size: 13px; }

/* filter menus */
.menus { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.menus::-webkit-scrollbar { display: none; }
.menu { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 30px 0 14px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px #0000000f, 0 0 0 1px #0000000a; color: var(--ios-2); font-size: 13px; cursor: pointer; }
.menu::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid var(--deco); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.menu select { border: 0; background: none; outline: 0; color: var(--ios-ink); font: 600 15px var(--ui); -webkit-appearance: none; appearance: none; cursor: pointer; }
.menu:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.menus-caption { padding-inline: 4px; color: var(--ios-2); font-size: 13px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.s-card {
  --g: var(--far); --g-soft: var(--far-soft);
  display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 16px 20px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--ios-card-shadow);
  text-align: start; color: var(--ios-ink); transition: transform 220ms cubic-bezier(.2, .8, .2, 1), box-shadow 220ms;
}
.s-card.fit-reach { --g: var(--reach); --g-soft: var(--reach-soft); }
.s-card.fit-steady { --g: var(--steady); --g-soft: var(--steady-soft); }
.s-card.fit-safe { --g: var(--safe); --g-soft: var(--safe-soft); }
.s-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px #0000000a, 0 16px 34px #18263d17; }
.s-card:active { transform: scale(.985); }
.s-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.s-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.s-name { font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.s-gap { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--g-soft); color: var(--g); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-gap em { margin-right: 4px; font-style: normal; font-weight: 700; }
.s-meta { margin-top: 4px; color: var(--ios-2); font-size: 13px; }
.s-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 20px; }
.s-line { display: grid; }
.s-line b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.s-line small { margin-top: 2px; color: var(--ios-2); font-size: 12px; }
.s-chev { width: 9px; height: 9px; margin-bottom: 8px; border: solid var(--deco); border-width: 1.8px 1.8px 0 0; transform: rotate(45deg); }
.ios-more { display: flex; margin: 18px auto 0; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px #0000000f, 0 0 0 1px #0000000a; color: var(--accent); font-size: 15px; font-weight: 600; }
.empty-state { margin-top: 16px; padding: 40px 20px; text-align: center; border-radius: 20px; background: #fff; box-shadow: var(--ios-card-shadow); }
.empty-state h3 { font-size: 17px; font-weight: 600; }
.empty-state p { margin-top: 6px; color: var(--ios-2); font-size: 15px; }
.method-card { margin-top: 32px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #0000000a; }
.method-card summary { display: flex; align-items: center; min-height: 50px; padding-inline: 18px; list-style: none; color: var(--ios-2); font-weight: 600; font-size: 15px; }
.method-body { display: grid; gap: 10px; padding: 0 18px 18px; color: var(--ios-2); font-size: 13px; }
.historical-controls { border-collapse: collapse; font-size: 15px; }
.historical-controls caption { text-align: start; font-weight: 600; color: var(--ios-ink); margin-bottom: 4px; }
.historical-controls th, .historical-controls td { padding: 4px 16px 4px 0; text-align: start; }
.data-sources p { margin-top: 2px; }

/* ---------- detail sheet (iOS sheet) ---------- */
.school-sheet { width: min(480px, 100%); max-width: none; height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; background: #f2f2f7; color: var(--ios-ink); box-shadow: -20px 0 60px #0000002e; }
.school-sheet::backdrop { background: #0000004d; }
.sheet-inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 32px; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; margin-inline: -18px; padding: 20px 18px 14px; background: #f2f2f7eb; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.sheet-head h2 { margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ios-2); font-size: 13px; }
.sheet-tags .lv-badge { color: var(--accent); font-weight: 600; }
.sheet-batch { color: var(--ios-2); font-size: 13px; margin-top: 2px; }
.sheet-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e3e3e8; color: #6e6e73; font-size: 20px; line-height: 1; }
.sheet-verdict { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; background: #fff; font-size: 15px; }
.sheet-verdict b { padding: 2px 10px; border-radius: 999px; background: var(--far-soft); color: var(--far); font-size: 15px; }
.sheet-verdict.fit-reach b { background: var(--reach-soft); color: var(--reach); }
.sheet-verdict.fit-steady b { background: var(--steady-soft); color: var(--steady); }
.sheet-verdict.fit-safe b { background: var(--safe-soft); color: var(--safe); }
.sheet-verdict strong { font-size: 17px; }
.sheet-sec { margin-top: 14px; padding: 16px; background: #fff; border-radius: 16px; }
.sheet-sec h3 { font-size: 13px; font-weight: 600; color: var(--ios-2); letter-spacing: .02em; }
.sheet-sec h3 small { margin-left: 6px; color: var(--ios-3); font-size: 12px; font-weight: 400; }
.sheet-small, .chart-note { margin-top: 8px; color: var(--ios-2); font-size: 13px; }
.sheet-empty { margin-top: 8px; color: var(--ios-2); font-size: 15px; }
.cut-chart { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; height: 200px; margin-top: 12px; padding-bottom: 40px; }
.bar-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col b { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.bar { position: relative; width: min(52px, 70%); height: calc((100% - 26px) * var(--h)); min-height: 2px; }
.bar i { position: absolute; inset: 0; border-radius: 10px 10px 6px 6px; background: var(--accent); transform-origin: bottom; }
.bar-col.muted .bar i { background: repeating-linear-gradient(135deg, #d8d8de 0 6px, #ececf0 6px 12px); }
.bar-col span { position: absolute; bottom: -22px; font-size: 13px; font-weight: 600; }
.bar-col small { position: absolute; bottom: -40px; color: var(--ios-2); font-size: 12px; white-space: nowrap; }
.you-line, .avg-line { position: absolute; left: 0; right: 0; bottom: calc(40px + (100% - 66px) * var(--y, 0)); height: 0; border-top: 2px dashed #ff9500; pointer-events: none; }
.you-line span, .avg-line span { position: absolute; left: 0; top: -20px; padding: 0 6px; border-radius: 6px; background: #ff9500; color: #fff; font-size: 12px; font-weight: 700; }
.avg-line { border-top-color: var(--far); }
.avg-line span { left: auto; right: 0; background: var(--far); }
.perf-year + .perf-year { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ececf0; }
.perf-year h4 { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; font-weight: 600; }
.tag-warn { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: #fff3e0; color: #b36200; font-size: 12px; font-weight: 600; }
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.perf-metric h5 { font-size: 13px; color: var(--ios-2); font-weight: 600; margin-bottom: 4px; }
.perf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; margin-top: 6px; font-size: 12px; color: var(--ios-2); }
.perf-row > span { grid-column: 1; grid-row: 1; }
.perf-row > .perf-track { grid-column: 1; grid-row: 2; }
.perf-row > b { grid-column: 2; grid-row: 1 / 3; color: var(--ios-ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.perf-track { height: 6px; border-radius: 99px; background: #ececf0; overflow: hidden; }
.perf-track i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: #34c759; }
.perf-metric:last-child .perf-track i { background: #ff9500; }
.perf-none { color: var(--ios-3); font-size: 13px; }
.perf-src { margin-top: 10px; color: var(--ios-2); font-size: 12px; line-height: 1.6; word-break: break-all; }
.perf-empty { margin-top: 10px; color: var(--ios-2); font-size: 15px; }
.sheet-scope { margin-top: 8px; font-size: 15px; font-weight: 600; }
.sheet-scope[data-scope="covered"] { color: var(--steady); }
.sheet-scope[data-scope="outside"] { color: var(--reach); }
.sibling-list { list-style: none; margin-top: 6px; }
.sibling-list li + li { border-top: 1px solid #ececf0; }
.sibling-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 0; border: 0; background: none; text-align: start; font-size: 15px; color: var(--ios-ink); }
.sibling-list b { font-size: 17px; color: var(--accent); }
.sheet-foot { margin-top: 16px; color: var(--ios-3); font-size: 12px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .dial-card { position: relative; top: 0; display: grid; grid-template-columns: 180px 1fr; gap: 0 20px; align-items: center; }
  .dial-card .dial-title { grid-column: 1 / -1; }
  .dial-card .dial { grid-row: span 3; }
  .dial-card .mix, .dial-card .dial-foot { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .estimate-page .desktop-nav { display: none; }
}
@media (max-width: 640px) {
  .entry-head { margin-bottom: 16px; }
  .mode-switch { width: 100%; min-width: 0; }
  .mode-switch small { display: none; }
  .mode-switch button { padding: 10px; text-align: center; }
  .score-form { --pad: 14px; border-radius: 18px; }
  .subject-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .subject-group[data-group="core"] .subject-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .subject-group[data-group="core"] .subject-input { padding-inline: 10px 8px; }
  .subject-group[data-group="core"] .subject-input > span { font-size: 12px; }
  .subject-input input { font-size: 20px; }
  .bonus-body { grid-template-columns: auto 1fr; }
  .bonus-note { grid-column: 1 / -1; }
  .dial-card { grid-template-columns: 130px 1fr; padding: 16px; }
  .dial-center strong { font-size: 34px; }
  .dial-center span { font-size: 12px; }
  .line-checks li { padding: 6px 8px; font-size: 12px; }
  .sticky-bar { position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 18px; background: #0a1530f2; color: #fff; box-shadow: 0 12px 30px #0a153059; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform 300ms cubic-bezier(.2, .8, .2, 1); }
  .sticky-bar small { display: block; font-size: 12px; color: #a9bad8; }
  .sticky-bar strong { font-size: 24px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
  .sticky-bar .button { min-height: 46px; background: var(--blue); border-color: var(--blue); }
  .on-results .sticky-bar { display: none; }
  .tool-main { padding-bottom: 110px; }
}

/* ---------- motion ---------- */
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sheet-out-right { to { transform: translateX(100%); } }
@keyframes sheet-in-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out-up { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes grow-up { from { transform: scaleY(0); } }
@keyframes grow-x { from { width: 0; } }
@keyframes banner-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: no-preference) {
  .school-sheet[open] { animation: sheet-in-right 380ms cubic-bezier(.2, .85, .25, 1); }
  .school-sheet[open]::backdrop { animation: fade-in 300ms; }
  .school-sheet.closing { animation: sheet-out-right 220ms ease-in forwards; }
  .school-sheet.closing::backdrop { animation: fade-out 220ms forwards; }
  .school-sheet[open] .bar i { animation: grow-up 700ms cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(200ms + var(--d)); }
  .school-sheet[open] .perf-track i { animation: grow-x 900ms 300ms cubic-bezier(.2, .8, .2, 1) both; }
  .school-sheet[open] .you-line, .school-sheet[open] .avg-line { animation: fade-in 400ms 700ms both; }
  .entry:not([hidden]) .score-form, .entry:not([hidden]) .dial-card { animation: banner-in 600ms cubic-bezier(.2, .8, .2, 1) both; }
  .entry:not([hidden]) .dial-card { animation-delay: 90ms; }
  @media (max-width: 640px) {
    .school-sheet[open] { animation-name: sheet-in-up; }
    .school-sheet.closing { animation-name: sheet-out-up; }
  }
}

/* Groups sit two per row on wide screens; 语数英 spans the full width. */
#subject-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
#subject-groups .subject-group[data-group="core"] { grid-column: 1 / -1; }
#subject-groups .subject-group:not([data-group="core"]) .subject-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#subject-groups .subject-group[data-group="pe"] .subject-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#subject-groups .subject-group:nth-child(2) { border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 640px) {
  #subject-groups { grid-template-columns: minmax(0, 1fr); }
}
.perf-row > span { grid-column: 1; grid-row: 1; }
.perf-row > .perf-track { grid-column: 1; grid-row: 2; }
.perf-row > b { grid-column: 2; grid-row: 1 / 3; }
.you-line span { left: 0; right: auto; }
.avg-line span { left: auto; right: 0; }

@media (max-width: 640px) {
  .form-submit { margin-top: 14px; padding-block: 14px; border-radius: 0 0 18px 18px; }
  .go-button { width: 100%; }
  .dial-foot { display: none; }
  .dial-center strong { font-size: 34px; }
}

/* phone bottom bar: light, matches the summary card */
@media (max-width: 640px) {
  .sticky-bar { background: #fffffff2; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 30px #1f365a2e; }
  .sticky-bar small { color: var(--muted); }
  .sticky-bar strong { color: var(--ink); }
  .sticky-bar .button { background: var(--blue); border-color: var(--blue); }
}


/* ---------- results: responsive + motion ---------- */
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .results-wrap { padding-top: 20px; }
  .hero-score { align-items: flex-start; }
  .hero-score h1 { font-size: 56px; }
  .seg { margin-top: 20px; }
  .seg button { font-size: 15px; flex-direction: column; gap: 0; min-height: 46px; }
  .menus { margin-inline: -16px; padding-inline: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .s-card { padding: 16px 16px 14px 18px; }
  .s-bottom { padding-top: 14px; }
  .s-line b { font-size: 34px; }
  .school-sheet { width: 100%; height: 90dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px #00000033; }
  .sheet-inner { padding-inline: 16px; }
  .sheet-head { margin-inline: -16px; padding: 22px 16px 12px; border-radius: 14px 14px 0 0; }
  .sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: #c7c7cc; }
  .perf-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .cards.is-entering .s-card { animation: card-in 460ms cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 28ms); }
  .results:not([hidden]) .hero-score { animation: banner-in 600ms cubic-bezier(.2, .8, .2, 1) both; }
  .results:not([hidden]) .seg, .results:not([hidden]) .menus { animation: banner-in 600ms 80ms cubic-bezier(.2, .8, .2, 1) both; }
}

/* ---------- 冲稳保 help ---------- */
.seg-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.help-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 8px; border: 0; border-radius: 999px; background: none; color: var(--accent); font-size: 13px; font-weight: 600; }
.help-button::before { content: "?"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.help-button:hover { background: var(--accent-soft); }
.help-card { width: min(440px, calc(100% - 32px)); max-height: min(88dvh, 720px); overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; border-radius: 22px; background: #f2f2f7; color: var(--ios-ink); box-shadow: 0 30px 80px #0000003d; }
.help-card::backdrop { background: #0000004d; }
.help-inner { padding: 20px 18px 22px; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.help-list { list-style: none; margin-top: 14px; border-radius: 16px; background: #fff; overflow: hidden; }
.help-list li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
.help-list li + li { border-top: 1px solid #ececf0; }
.help-list b { align-self: start; justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 15px; white-space: nowrap; }
.help-list .fit-reach b { background: var(--reach-soft); color: var(--reach); }
.help-list .fit-steady b { background: var(--steady-soft); color: var(--steady); }
.help-list .fit-safe b { background: var(--safe-soft); color: var(--safe); }
.help-list p { font-size: 15px; line-height: 1.55; }
.help-list p:first-child { font-weight: 600; }
.help-list p + p { margin-top: 2px; color: var(--ios-2); }
.help-note { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: #fff; }
.help-note h3 { font-size: 15px; font-weight: 600; }
.help-note p { margin-top: 4px; color: var(--ios-2); font-size: 15px; line-height: 1.6; }
.help-tip { margin-top: 14px; padding-inline: 4px; font-size: 15px; line-height: 1.6; }
.help-tip a { color: var(--accent); font-weight: 600; }
.help-fine { margin-top: 8px; padding-inline: 4px; color: var(--ios-3); font-size: 12px; line-height: 1.6; }
.sheet-risk { margin-top: 8px; padding: 0 4px; color: var(--ios-2); font-size: 13px; line-height: 1.6; }
.sheet-risk b { color: var(--ios-ink); }
@media (prefers-reduced-motion: no-preference) {
  .help-card[open] { animation: help-in 320ms cubic-bezier(.2, .9, .3, 1.1); }
  .help-card[open]::backdrop { animation: fade-in 250ms; }
}
@keyframes help-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* 只看本区 toggle inside the menu row */
.menu.toggle { padding: 0 14px 0 10px; color: var(--ios-ink); font-weight: 600; font-size: 15px; }
.menu.toggle::after { display: none; }
.menu.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { position: relative; width: 34px; height: 20px; border-radius: 99px; background: #d1d1d6; transition: background-color 200ms; flex: none; }
.toggle-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0000004d; transition: transform 240ms cubic-bezier(.3, 1.3, .5, 1); }
.menu.toggle input:checked + .toggle-ui { background: #34c759; }
.menu.toggle input:checked + .toggle-ui::after { transform: translateX(14px); }
.menu.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.menus-caption { margin-top: 2px; }
.clear-scores { margin-inline-start: 14px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.clear-scores:hover { color: #c2372c; }

/* ---------- 体育: quick full marks + calculator ---------- */
.subject-note .quick-full, .subject-note .pe-link { padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; }
.subject-note .quick-full { margin-right: 12px; color: var(--blue); }
.subject-note .pe-link { color: var(--muted); }
.subject-note .pe-link:hover, .subject-note .quick-full:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 体育分换算器: step-by-step, roomy */
.pe-card { width: min(560px, calc(100% - 24px)); max-height: min(92dvh, 760px); padding: 0; overflow: hidden; }
.wiz { display: flex; flex-direction: column; max-height: min(92dvh, 760px); }
.wiz-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 16px 16px 6px; }
.wiz-head h2 { text-align: center; font-size: 17px; font-weight: 600; }
.wiz-back { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--accent); font-size: 34px; line-height: 1; }
.wiz-back:hover { background: var(--accent-soft); }
.wiz-head .sheet-close { justify-self: end; }
.wiz-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px 20px 2px; }
.wiz-steps li { display: grid; gap: 6px; color: var(--ios-3); font-size: 12px; font-weight: 600; text-align: center; }
.wiz-steps li::before { content: ""; height: 4px; border-radius: 99px; background: #dcdce2; transition: background-color 300ms; }
.wiz-steps li.done::before, .wiz-steps li.now::before { background: var(--accent); }
.wiz-steps li.now { color: var(--accent); }
.wiz-steps li.done { color: var(--ios-2); }
.wiz-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 24px; }
.wiz-body.slide { animation: wiz-in 320ms cubic-bezier(.2, .8, .2, 1); }
@keyframes wiz-in { from { opacity: 0; transform: translateX(18px); } }
.wiz-q { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.wiz-help { margin-top: 6px; color: var(--ios-2); font-size: 15px; line-height: 1.6; }
.wiz-options { display: grid; gap: 10px; margin-top: 18px; }
.wiz-options.two { grid-template-columns: 1fr 1fr; }
.wiz-options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wiz-option { display: grid; gap: 4px; justify-items: start; min-height: 76px; padding: 14px 16px; border: 2px solid transparent; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px #0000000d; text-align: start; color: var(--ios-ink); transition: border-color 200ms, background-color 200ms, transform 150ms; }
.wiz-option b { font-size: 17px; font-weight: 600; }
.wiz-option small { color: var(--ios-2); font-size: 13px; }
.wiz-option:active { transform: scale(.98); }
.wiz-option.is-on { border-color: var(--accent); background: var(--accent-soft); }
.wiz-option.is-on b { color: var(--accent); }
.wiz-option.is-on::after { content: "✓"; position: absolute; }
.wiz-option { position: relative; }
.wiz-option.is-on::after { top: 10px; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.wiz-label { display: block; margin-top: 24px; font-size: 17px; font-weight: 600; }
.wiz-time, .wiz-unit { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.wiz-time input, .wiz-unit input { height: 64px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px #0000000d, inset 0 0 0 1.5px #d9d9df; color: var(--ios-ink); font: 700 34px var(--ui); text-align: center; font-variant-numeric: tabular-nums; }
.wiz-time input { width: 84px; }
.wiz-unit input { width: 150px; }
.wiz-time input::placeholder, .wiz-unit input::placeholder { color: #c7c7cc; font-weight: 600; }
.wiz-time input:focus, .wiz-unit input:focus { outline: 0; box-shadow: 0 0 0 3px var(--accent); }
.wiz-time span, .wiz-unit span { color: var(--ios-2); font-size: 17px; font-weight: 600; }
.wiz-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: #fff; }
.wiz-score b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.wiz-score span { color: var(--ios-2); font-size: 13px; }
.wiz-score em { margin-left: auto; font-style: normal; color: var(--ios-2); font-size: 15px; }
.wiz-score em strong { color: var(--ios-ink); font-size: 17px; }
.wiz-score.great b { color: var(--steady); }
.wiz-score.ok b { color: var(--accent); }
.wiz-score.low b { color: var(--reach); }
.wiz-score.dropped { opacity: .55; }
.wiz-score.empty { color: var(--ios-3); font-size: 13px; background: #ffffff99; }
.wiz-empty-pick { margin-top: 18px; color: var(--ios-3); font-size: 15px; }
.wiz-result { padding: 20px; border-radius: 20px; background: #fff; text-align: center; }
.wiz-result p { color: var(--ios-2); font-size: 15px; font-weight: 600; }
.wiz-result strong { display: block; margin-top: 4px; font-size: 56px; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; color: var(--accent); }
.wiz-result strong span { font-size: 20px; color: var(--ios-2); font-weight: 600; letter-spacing: 0; }
.wiz-result em { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 99px; background: #fff3e0; color: #b36200; font-style: normal; font-size: 13px; }
.wiz-breakdown { list-style: none; margin-top: 14px; border-radius: 18px; background: #fff; overflow: hidden; }
.wiz-breakdown li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.wiz-breakdown li + li { border-top: 1px solid #ececf0; }
.wiz-breakdown li > div { display: grid; gap: 2px; }
.wiz-breakdown b { font-size: 15px; font-weight: 600; }
.wiz-breakdown small { color: var(--ios-2); font-size: 13px; }
.wiz-breakdown li > span { color: var(--ios-2); font-size: 15px; white-space: nowrap; }
.wiz-breakdown li > span strong { color: var(--ios-ink); font-size: 20px; font-weight: 700; }
.wiz-breakdown li.dropped { opacity: .5; }
.wiz-breakdown button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; }
.wiz-fine { margin-top: 14px; color: var(--ios-3); font-size: 12px; line-height: 1.6; }
.wiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: #f2f2f7f2; border-top: 1px solid #e3e3e8; }
.wiz-running { display: flex; align-items: baseline; gap: 4px; }
.wiz-running small { margin-right: 4px; color: var(--ios-2); font-size: 13px; }
.wiz-running b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wiz-running span { color: var(--ios-2); font-size: 15px; }
.wiz-next { min-height: 52px; min-width: 150px; margin-inline-start: auto; border-radius: 999px; font-size: 17px; }
@media (max-width: 640px) {
  .pe-card { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .wiz { max-height: 94dvh; }
  .wiz-body { padding: 14px 16px 20px; }
  .wiz-q { font-size: 20px; }
  .wiz-options.three { grid-template-columns: minmax(0, 1fr); }
  .wiz-options.three .wiz-option { min-height: 60px; }
  .wiz-steps { padding-inline: 16px; }
  .wiz-unit input { width: 140px; }
}


/* ================= Polish pass (2026-11-13) ================= */
/* 4. Layout */
.score-form .mode-switch { width: 100%; min-width: 0; margin-bottom: 20px; }
.entry-head { align-items: flex-start; }
.hero-score { display: block; }
.hero-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 2px; }
.hero-line h1 { margin-top: 0; }
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; }
.filter-pop { flex: 1 1 auto; min-width: 0; }
.filter-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 0 16px 0 14px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px #0000000f, 0 0 0 1px #0000000d; list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ios-ink); }
.filter-btn::-webkit-details-marker { display: none; }
.filter-btn b { overflow: hidden; color: var(--accent); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.filter-btn::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border: solid var(--deco); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform 200ms; }
.filter-pop[open] .filter-btn::after { transform: rotate(-135deg) translateY(-2px); }
.filter-icon { width: 16px; height: 12px; background: linear-gradient(var(--ios-ink) 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(var(--ios-ink) 0 0) 50% 50% / 70% 2px no-repeat, linear-gradient(var(--ios-ink) 0 0) 50% 100% / 40% 2px no-repeat; }
.filter-panel { margin-top: 10px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: var(--ios-card-shadow); }
.filter-panel .menus { flex-wrap: wrap; margin-top: 0; padding: 0; overflow: visible; }
.filter-panel .menu { background: var(--canvas); box-shadow: none; min-height: 44px; }
.filter-panel .menus-caption { margin-top: 8px; }
.toolbar .help-button { min-height: 44px; }
.list-lead { margin-top: 14px; padding-inline: 4px; color: var(--ios-2); font-size: 15px; }
.seg-caption { display: none; }

/* 5. Phone details: bigger tap areas */
.subject-note { min-height: 0; }
.subject-note .quick-full, .subject-note .pe-link { display: inline-flex; align-items: center; min-height: 36px; margin-top: 4px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; }
.subject-note .quick-full { margin-right: 6px; background: var(--accent-soft); color: var(--accent); }
.subject-note .pe-link { background: var(--canvas); color: var(--ios-ink); box-shadow: inset 0 0 0 1px var(--line); }
.subject-note .quick-full:hover, .subject-note .pe-link:hover { text-decoration: none; filter: brightness(.97); }
.clear-scores { display: inline-flex; align-items: center; min-height: 40px; margin-inline-start: 12px; padding: 0 12px; border-radius: 999px; background: none; color: var(--muted); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.clear-scores:hover { color: #b42318; box-shadow: inset 0 0 0 1px #f0c3bd; }
.skip-estimate { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
@media (max-width: 640px) {
  .score-form .mode-switch { margin-bottom: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filter-btn { width: 100%; }
  .filter-panel .menu { flex: 1 1 calc(50% - 4px); }
  .filter-panel .menu.toggle { flex-basis: 100%; }
  .toolbar .help-button { align-self: flex-start; }
}

/* 6. One sheet design for all three pop-ups (冲稳保说明 / 学校详情 / 体育分换算器) */
.app-sheet { width: min(560px, calc(100% - 24px)); max-width: none; height: fit-content; max-height: min(92dvh, 760px); margin: auto; padding: 0; border: 0; border-radius: 20px; background: #f2f4f8; color: var(--ios-ink); box-shadow: 0 30px 80px #0b13233d; overflow: hidden; }
.app-sheet::backdrop { background: #0b13234d; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sheet-bar { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; min-height: 56px; padding: 8px 12px; background: #f2f4f8eb; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.sheet-bar h2, .sheet-bar .bar-title { margin: 0; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--ios-ink); }
.sheet-bar .sheet-close { justify-self: end; }
.app-sheet .sheet-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e2e6ed; color: var(--muted); font-size: 20px; line-height: 1; }
.app-sheet .sheet-close:hover { background: #d7dce5; color: var(--ink); }
/* content areas scroll under the bar */
.app-sheet .help-inner, .app-sheet.school-sheet .sheet-inner { max-height: min(92dvh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.app-sheet .help-inner { padding: 0 18px 22px; }
.app-sheet .help-inner > .sheet-bar { margin-inline: -18px; }
.app-sheet.school-sheet .sheet-inner { height: auto; padding: 0 18px 28px; }
.app-sheet.school-sheet .sheet-inner > .sheet-bar { margin-inline: -18px; }
.app-sheet.school-sheet .sheet-head { position: static; margin: 0; padding: 4px 4px 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; }
.app-sheet.school-sheet .sheet-head h2 { font-size: 24px; font-weight: 700; }
.app-sheet.school-sheet .sheet-head::before { display: none; }
.app-sheet .help-list, .app-sheet .sheet-sec, .app-sheet .help-note, .app-sheet .wiz-breakdown, .app-sheet .wiz-result { border-radius: 16px; }
.app-sheet.pe-card .wiz { max-height: min(92dvh, 760px); }
.wiz-head.sheet-bar { padding-inline: 12px; }
@media (max-width: 640px) {
  .app-sheet, .app-sheet.school-sheet, .app-sheet.pe-card { width: 100%; max-width: 100%; height: fit-content; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .app-sheet .help-inner, .app-sheet.school-sheet .sheet-inner, .app-sheet.pe-card .wiz { max-height: 94dvh; }
  .sheet-bar { padding-top: 16px; }
  .sheet-bar::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: #c3cad5; }
}
@keyframes sheet-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes sheet-pop-out { to { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (prefers-reduced-motion: no-preference) {
  .app-sheet[open], .app-sheet.school-sheet[open], .app-sheet.help-card[open] { animation: sheet-pop 300ms cubic-bezier(.2, .9, .3, 1.05); }
  .app-sheet.school-sheet.closing { animation: sheet-pop-out 200ms ease-in forwards; }
  .app-sheet[open]::backdrop { animation: fade-in 250ms; }
  @media (max-width: 640px) {
    .app-sheet[open], .app-sheet.school-sheet[open], .app-sheet.help-card[open] { animation: sheet-up 340ms cubic-bezier(.2, .85, .25, 1); }
    .app-sheet.school-sheet.closing { animation: sheet-down 220ms ease-in forwards; }
  }
}
@media (max-width: 640px) { .range-marks span:last-child { display: none; } }
@media (max-width: 640px) { .estimate-page:not(.on-results) .site-footer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); } }
