:root {
  --ink: #14243a;
  --muted: #607086;
  --line: #dce5ef;
  --soft: #f4f8fc;
  --brand: #0b5da8;
  --brand-dark: #073f73;
  --accent: #15a3a3;
  --danger: #ad2d2d;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(22, 49, 82, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #eef4f9;
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #edf5fb 0, #f8fbfd 45%, #eef4f9 100%); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 50px; }
.hero { background: radial-gradient(circle at top right, rgba(72, 200, 207, .32), transparent 38%), linear-gradient(135deg, #083d6e, #0b67ad); color: white; border-radius: 24px; padding: 34px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; box-shadow: var(--shadow); }
.hero h1 { margin: 5px 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.04em; }
.hero-copy { max-width: 760px; margin: 0; line-height: 1.75; color: rgba(255,255,255,.9); }
.eyebrow { margin: 0; letter-spacing: .16em; font-size: .78rem; font-weight: 800; opacity: .82; }
.hero-badge { white-space: nowrap; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); padding: 10px 14px; border-radius: 999px; font-size: .9rem; }
.notice { margin: 18px 0; padding: 15px 18px; background: #fff9e8; border: 1px solid #f0dda8; border-radius: 14px; line-height: 1.65; color: #654d12; }
.progress-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 8px 24px rgba(22,49,82,.06); }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.progress-track { height: 9px; background: #e8eff5; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 16.666%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: inherit; transition: width .25s ease; }
form { margin-top: 18px; background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.step { display: none; }
.step.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; gap: 15px; align-items: flex-start; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0 0 5px; font-size: 1.45rem; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.step-number { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; background: #e8f4fe; color: var(--brand); font-weight: 900; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
label { display: block; font-size: .94rem; font-weight: 700; color: #263a52; }
input, select, textarea { width: 100%; margin-top: 8px; border: 1px solid #cdd9e5; border-radius: 11px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; transition: border .15s ease, box-shadow .15s ease; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #58a7dd; box-shadow: 0 0 0 4px rgba(66, 153, 212, .13); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(173,45,45,.1); }
.required, .consent-box b { color: var(--danger); }
.step > label, fieldset, .table-card, .consent-box { margin-top: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
legend { padding: 0 7px; font-size: .94rem; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.choice-grid label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--soft); border-radius: 10px; font-weight: 600; }
.choice-grid input { width: auto; margin: 0; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.action-right { display: flex; gap: 10px; }
button { border: 0; border-radius: 11px; padding: 11px 17px; font-weight: 800; }
button.primary { background: linear-gradient(135deg, var(--brand), #168bbd); color: white; box-shadow: 0 8px 18px rgba(11,93,168,.22); }
button.primary:hover { background: var(--brand-dark); }
button.secondary { background: #edf4f9; color: #21425f; }
button.ghost { background: transparent; color: var(--brand); border: 1px solid #bdd3e6; }
button.small { padding: 8px 11px; font-size: .86rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
.hidden { display: none !important; }
.error-box { margin-top: 15px; background: #fff0f0; border: 1px solid #efb7b7; color: #842323; padding: 13px 15px; border-radius: 11px; line-height: 1.55; }
.table-card { border: 1px solid var(--line); border-radius: 16px; padding: 17px; background: #fbfdff; }
.table-head, .school-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.table-head h3 { margin: 0; }
.school-rows { display: grid; gap: 14px; margin-top: 14px; }
.school-row { padding: 16px; border: 1px solid #d4e1ec; background: white; border-radius: 14px; }
.school-row .grid { margin-top: 12px; }
.school-row > label { margin-top: 12px; }
.remove-school { padding: 5px 8px; background: transparent; color: #a33b3b; font-size: .84rem; }
.consent-box { background: #f5f9fc; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.check-line { display: flex; align-items: flex-start; gap: 11px; font-weight: 600; line-height: 1.55; }
.check-line + .check-line { margin-top: 12px; }
.check-line input { width: auto; margin: 4px 0 0; }
.honeypot { position: absolute !important; left: -9999px !important; height: 1px; width: 1px; overflow: hidden; }
.result-card { margin-top: 20px; background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.spinner { width: 46px; height: 46px; border: 5px solid #dceaf4; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 20px; }
.result-header h2 { margin: 5px 0; }
.result-header p { color: var(--muted); }
.score-ring { width: 108px; height: 108px; flex: 0 0 auto; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(var(--accent) 0deg, var(--brand) 260deg, #e8eff5 260deg); border: 8px solid #fff; box-shadow: 0 0 0 1px #dce5ef, 0 8px 20px rgba(22,49,82,.13); }
.score-ring strong { font-size: 1.8rem; line-height: 1; color: white; text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.score-ring span { font-size: .75rem; color: white; font-weight: 800; }
.report-section { margin: 22px 0; }
.report-section h3 { font-size: 1.1rem; margin: 0 0 10px; color: #123d62; }
.report-section p { line-height: 1.75; }
.report-section ul { margin: 9px 0 0; padding-left: 20px; line-height: 1.7; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.report-box { border: 1px solid var(--line); background: #f9fcfe; border-radius: 14px; padding: 16px; }
.report-box h4 { margin: 0 0 8px; }
.school-review { border-left: 4px solid var(--brand); padding: 13px 15px; margin: 10px 0; background: #f6faff; border-radius: 0 12px 12px 0; }
.timeline-item { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-period { font-weight: 900; color: var(--brand); }
.priority-pill { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: white; font-weight: 900; margin-right: 7px; }
.result-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 0 0; }
@media (max-width: 760px) {
  .app-shell { width: min(100% - 18px, 1120px); padding-top: 10px; }
  .hero { padding: 23px; border-radius: 18px; flex-direction: column; }
  form, .result-card { padding: 20px 16px; border-radius: 18px; }
  .grid.two, .report-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-actions, .result-header { align-items: stretch; }
  .form-actions { flex-direction: column-reverse; }
  .action-right { display: grid; grid-template-columns: 1fr 1fr; }
  .action-right .primary:last-child { grid-column: 1 / -1; }
  #prevBtn { width: 100%; }
  .timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .score-ring { width: 88px; height: 88px; }
}
@media print {
  body { background: white; }
  .hero, .notice, .progress-card, form, footer, .result-actions { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .result-card { box-shadow: none; border: 0; margin: 0; padding: 0; }
}
.success-mark { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; background: #e7f7ee; color: #187653; font-size: 2rem; font-weight: 900; margin-bottom: 14px; }
#successPanel h2 { margin: 6px 0 10px; }
#successPanel > p { line-height: 1.7; }
.submission-meta { color: var(--muted); font-size: .9rem; word-break: break-all; }

/* v2.5 logo, saved drafts, resume and review mode */
.hero-main { display: flex; gap: 22px; align-items: center; min-width: 0; }
.brand-logo-card { width: 128px; height: 188px; flex: 0 0 128px; border-radius: 18px; background: rgba(255,255,255,.96); padding: 9px; box-shadow: 0 10px 28px rgba(0,0,0,.13); display:grid; place-items:center; overflow:hidden; }
.brand-logo { display: block; width: auto; max-width: 100%; height: 170px; object-fit: contain; }
.hero-side { display: grid; gap: 10px; justify-items: stretch; min-width: 190px; }
.hero-button { width: 100%; border: 1px solid rgba(255,255,255,.42); background: rgba(255,255,255,.15); color: white; box-shadow: none; }
.hero-button:hover { background: rgba(255,255,255,.24); }
.hero-button.subtle { background: transparent; }
.cloud-draft-banner, .view-mode-banner { margin: 18px 0; padding: 14px 17px; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cloud-draft-banner { background: #edf8ff; border: 1px solid #bcdcf2; color: #144e75; }
.view-mode-banner { background: #fff6df; border: 1px solid #ead293; color: #684b0d; }
.cloud-draft-banner strong, .view-mode-banner strong { display: block; margin-bottom: 3px; }
.cloud-draft-banner span, .view-mode-banner span { display: block; font-size: .88rem; line-height: 1.45; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(10, 28, 48, .58); backdrop-filter: blur(3px); }
.modal-card { position: fixed; z-index: 90; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 28px)); max-height: min(88vh, 760px); overflow-y: auto; background: white; border-radius: 20px; padding: 27px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.modal-card h2 { margin: 6px 0 10px; }
.modal-copy { color: var(--muted); line-height: 1.65; margin: 0 0 18px; }
.modal-card label + label { margin-top: 14px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: transparent; color: #63778b; font-size: 1.65rem; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.split-actions { flex-wrap: wrap; }
.resume-code-box { margin: 18px 0; padding: 17px; border: 1px solid #b9d5eb; border-radius: 14px; background: #f1f8fd; display: grid; gap: 8px; }
.resume-code-box span { color: var(--muted); font-size: .84rem; font-weight: 800; }
.resume-code-box strong { font-size: clamp(1.25rem, 4vw, 1.75rem); letter-spacing: .06em; color: var(--brand-dark); word-break: break-all; }
.resume-code-box button { justify-self: start; }
.privacy-tip { padding: 12px 14px; border-radius: 12px; background: #fff9e8; color: #6d5416; font-size: .88rem; line-height: 1.55; }
body.modal-open { overflow: hidden; }
form.view-only input, form.view-only select, form.view-only textarea { background: #f3f6f8; color: #415264; cursor: default; }
form.view-only .remove-school, form.view-only #addSchoolBtn { display: none; }
form.view-only .consent-box { opacity: .82; }

@media (max-width: 760px) {
  .hero-main { align-items: flex-start; flex-direction: column; }
  .brand-logo-card { width: 112px; height: 165px; flex-basis: auto; }
  .brand-logo { height: 148px; }
  .hero-side { width: 100%; min-width: 0; grid-template-columns: 1fr 1fr; }
  .hero-badge { grid-column: 1 / -1; justify-self: start; }
  .cloud-draft-banner, .view-mode-banner { align-items: stretch; flex-direction: column; }
  .modal-card { padding: 24px 18px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .split-actions .primary { grid-column: 1 / -1; }
}
.hero-side a.hero-button{display:block;text-align:center;text-decoration:none;padding:12px 14px;border-radius:11px;font-weight:800;box-sizing:border-box}

/* v3.1 school/campus entry guidance */
.school-campus-tip{display:flex;gap:10px;align-items:flex-start;margin:13px 0 2px;padding:11px 13px;border:1px solid #bcdcf2;border-radius:12px;background:#f1f8fd;color:#285777;font-size:.88rem;line-height:1.55}.school-campus-tip b{white-space:nowrap;color:var(--brand-dark)}
@media(max-width:760px){.school-campus-tip{display:block}.school-campus-tip b{display:block;margin-bottom:4px;white-space:normal}}

/* v3.9 front-end readability */
body{font-size:15px;line-height:1.62;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}.app-shell{width:min(1180px,calc(100% - 32px));padding-bottom:56px}.hero-copy,.notice,.section-heading p,.report-section p,.report-section li{line-height:1.72}.progress-card,form,.result-card{border-color:#d7e3ec}.section-heading{margin-bottom:25px}.section-heading p{max-width:850px}.grid{gap:20px}label{line-height:1.45}input,select,textarea{min-height:46px;padding:12px 14px;line-height:1.5}textarea{line-height:1.65}.choice-grid label{line-height:1.45}.table-card,.school-row,.consent-box{padding:18px}.school-row{line-height:1.55}.form-actions{margin-top:30px}.review-box p{line-height:1.62}.preview-item{padding:10px 0;line-height:1.55}
@media(max-width:760px){body{font-size:14.5px}.app-shell{width:min(100% - 16px,1180px)}.hero{padding:22px}.section-heading{gap:12px}.section-heading h2{font-size:1.32rem}.grid{gap:15px}input,select,textarea{min-height:44px}}

/* v3.12 three application tracks */
.track-chooser{margin:18px 0;padding:24px;background:#fff;border:1px solid #d7e3ec;border-radius:18px;box-shadow:0 12px 34px rgba(29,65,92,.08)}
.compact-heading{margin-bottom:18px}.track-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.track-card{min-height:165px;padding:20px;text-align:left;border:1px solid #cbdbe7;border-radius:16px;background:linear-gradient(180deg,#fff,#f7fbfe);color:#173a54;box-shadow:none;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px}.track-card:hover{border-color:#6da9cf;background:#f0f8fd;transform:translateY(-1px)}.track-card.selected{border-color:#1f76aa;background:#eaf6fd;box-shadow:0 0 0 2px rgba(31,118,170,.12)}.track-card strong{font-size:1.22rem;color:#114f78}.track-card span{font-size:.95rem;font-weight:750}.track-card small{color:#5f7484;line-height:1.5}
.track-context{margin:18px 0;padding:15px 17px;border:1px solid #bcdcf2;border-radius:14px;background:#edf8ff;display:flex;justify-content:space-between;gap:14px;align-items:center}.track-context>div{display:grid;grid-template-columns:auto 1fr;gap:3px 10px;align-items:center}.track-context #trackContextCopy{grid-column:2;color:#45697f;font-size:.9rem}.badge{display:inline-flex;align-items:center;width:max-content;padding:4px 9px;border-radius:999px;font-size:.78rem;font-weight:900;background:#eef2f5;color:#4a5c68}.badge.blue{background:#dff1fc;color:#155d89}
.track-panel{margin:18px 0 0;padding:18px;border:1px solid #d9e5ed;border-radius:15px;background:#fbfdff}.track-panel h3{margin:0 0 15px;color:#174f73}.span2{grid-column:1/-1}.footer{text-align:center;color:var(--muted);font-size:.85rem;padding:24px 0 0}.footer p{margin:0}.footer-links{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 8px;margin-top:6px}.footer-links a{color:#0d5ca6;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border-radius:10px}.footer-links a:hover{background:#eef6fb}.resume-code-card{margin:18px 0;padding:17px;border:1px solid #b9d5eb;border-radius:14px;background:#f1f8fd;display:grid;gap:8px}.resume-code-card strong{font-size:1.35rem;letter-spacing:.05em;color:#154c70}.small-mark{width:50px;height:50px;font-size:1.4rem}
@media(max-width:900px){.track-card-grid{grid-template-columns:1fr}.track-card{min-height:0}.track-context{align-items:stretch;flex-direction:column}.track-context>div{grid-template-columns:1fr}.track-context #trackContextCopy{grid-column:1}.span2{grid-column:auto}}

/* v4.2.1: preserve intrinsic form widths and usable controls on narrow screens. */
.grid>*,.hero-main,.hero-main>div,.hero-side,.section-heading>div,.track-context>div{min-width:0}
fieldset{min-inline-size:0}label,legend,.notice,.error-box,.hero-copy{overflow-wrap:anywhere}
input,select,textarea{min-width:0;max-width:100%}input[type="checkbox"],input[type="radio"]{min-height:20px;width:20px;height:20px;flex:0 0 20px;padding:0}
@media(max-width:760px){
 body{font-size:16px}input,select,textarea{font-size:16px}label,legend{font-size:15px;line-height:1.6}
 button,.hero-button,.hero-link{min-height:44px;white-space:normal;overflow-wrap:anywhere}button.small,.remove-school{min-height:44px}
 .hero-badge{max-width:100%;white-space:normal;line-height:1.5}.hero-main{width:100%}.hero-main>div{max-width:100%}
 .progress-meta{flex-wrap:wrap;line-height:1.6}.progress-meta>span{min-width:0;overflow-wrap:anywhere}
 .section-heading{gap:10px}.section-heading h2{line-height:1.5}.step-number{width:38px;height:38px;border-radius:10px}
 .table-head,.school-row-top{flex-wrap:wrap;align-items:flex-start}.table-head h3{min-width:0;overflow-wrap:anywhere}
 .table-card,.school-row,.consent-box{padding:14px}.choice-grid label{min-height:48px;min-width:0}
 .modal-card{max-height:calc(100dvh - 24px);scroll-padding-block:16px}.modal-card h2{padding-right:24px}.modal-close{width:44px;height:44px}
 .check-line{min-height:44px;align-items:flex-start}.check-line input{margin-top:3px}.modal-actions button{min-width:0}
}
@media(max-width:390px){.hero-side{grid-template-columns:minmax(0,1fr)}.hero-badge{grid-column:auto}.choice-grid{grid-template-columns:minmax(0,1fr)}.modal-actions{grid-template-columns:minmax(0,1fr)}.track-chooser{padding:18px}.hero{padding:18px}.result-actions{flex-direction:column}}
.planning-language{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#fff;text-align:left;min-width:180px;max-width:100%}
.planning-language select{width:100%;min-width:0;padding:8px 10px;border:1px solid #d4e2ed;border-radius:8px;background:#fff;color:#163e5a;font:inherit;font-size:14px}
@media(max-width:760px){#planningLanguageControl{grid-column:1/-1;min-width:0;width:100%}}
