:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: #203036;
  background: #f5f7f7;
  --green: #155b55;
  --green-dark: #104943;
  --border: #d4dcdf;
  --muted: #64747b;
  --focus: #b36d28;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #d19b52; outline-offset: 2px; }

.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1024px; height: 62px; padding: 0 28px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 730; color: var(--green-dark); white-space: nowrap; }
.brand-mark { display: inline-block; width: 10px; height: 26px; border-radius: 2px; background: var(--green); box-shadow: 5px 0 #d08b41; }
.topbar-note { font-size: .82rem; color: var(--muted); text-align: right; }
.layout { max-width: 800px; margin: 0 auto; padding: 36px 28px 80px; }

h1, h2, p { margin-top: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; margin-bottom: 32px; font-weight: 720; }
h2 { font-size: 1.35rem; line-height: 1.32; font-weight: 690; }
label { display: block; font-size: .9rem; font-weight: 640; margin-bottom: 8px; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], textarea, select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #bfcbd0;
  border-radius: 6px;
  color: #203036;
  background: #fff;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #155b551a; }
input::placeholder, textarea::placeholder { color: #8a989d; }
textarea { resize: vertical; min-height: 132px; line-height: 1.5; }
.start-view { padding-top: 22px; }
.start-view form { max-width: 640px; }
.start-view input { margin-bottom: 24px; }
.start-view select { margin-bottom: 24px; }
.start-view .search-wrap input { margin-bottom: 0; }
.search-wrap { position: relative; }
.search-results { position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 10; max-height: 290px; overflow-y: auto; border: 1px solid #bfcbd0; border-radius: 6px; background: #fff; box-shadow: 0 14px 30px #1c303721; }
.search-option { display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #e6ebed; text-align: left; color: #203036; background: #fff; }
.search-option:hover, .search-option:focus { background: #ebf4f2; }
.search-option strong, .search-option span { display: block; }
.search-option strong { font-size: .92rem; font-weight: 680; line-height: 1.35; }
.search-option span { font-size: .78rem; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.search-empty { padding: 16px; color: var(--muted); font-size: .9rem; }
.selected-school { margin: 8px 0 0; color: var(--muted); font-size: .86rem; }

.primary, .secondary { min-height: 45px; padding: 10px 18px; border-radius: 6px; font-weight: 670; transition: background .15s, border-color .15s; }
.primary { background: var(--green); color: #fff; border: 1px solid var(--green); }
.primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.secondary { background: #fff; color: #35484f; border: 1px solid #bfcbd0; }
.secondary:hover:not(:disabled) { background: #ebf1f0; }
.start-button { margin-top: 26px; min-width: 166px; display: inline-flex; justify-content: center; align-items: center; gap: 16px; }

.form-heading { padding-bottom: 25px; }
.text-button { padding: 0; border: 0; background: none; color: var(--green); font-size: .85rem; font-weight: 680; }
.text-button:hover { text-decoration: underline; }
.school-heading { margin-top: 22px; }
.eyebrow { text-transform: uppercase; color: #9d612e; font-size: .72rem; font-weight: 760; letter-spacing: .06em; }
.school-heading h1 { font-size: 1.45rem; margin: 8px 0 6px; }
.school-heading p { font-size: .9rem; color: var(--muted); margin-bottom: 0; }
.form-meta { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: .83rem; color: var(--muted); }
.progress-line { height: 7px; background: #dfe7e8; border-radius: 4px; overflow: hidden; }
.progress-line > div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .8rem; margin-top: 10px; }
.question-area { min-height: 286px; padding-top: 52px; }
.question-area h2 { margin: 8px 0 22px; }
.question-area input:not([type="radio"]) { max-width: 540px; }
.choice-group { max-width: 580px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: block; margin: 0; }
.choice input { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; accent-color: var(--green); }
.choice span { display: flex; align-items: center; min-height: 56px; padding: 12px 15px 12px 43px; border: 1px solid #becbd0; border-radius: 6px; background: #fff; line-height: 1.28; }
.choice:hover span { border-color: var(--green); }
.choice input:checked + span { border-color: var(--green); background: #ecf6f3; color: var(--green-dark); }
.choice input:focus-visible + span { outline: 3px solid #d19b52; outline-offset: 2px; }
.quick-button { margin-top: 10px; border: 0; background: none; color: var(--green); padding: 3px 0; font-weight: 670; }
.quick-button:hover { text-decoration: underline; }
.form-actions { display: flex; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-actions .primary { margin-left: auto; }
.notice { margin-top: 20px; padding: 12px 14px; border-left: 3px solid #5a8894; background: #eaf2f4; color: #24444d; font-size: .9rem; line-height: 1.4; }
.notice[data-type="error"] { border-color: #b34732; background: #f9ebe8; color: #803b2f; }
.notice[data-type="success"] { border-color: var(--green); background: #e9f4ed; color: #20553f; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #16292eb3; }
.dialog { width: min(100%, 430px); padding: 26px; border-radius: 8px; background: #fff; box-shadow: 0 25px 70px #142a3066; }
.dialog h2 { margin-bottom: 8px; }
.dialog p { color: #475c63; line-height: 1.5; margin-bottom: 24px; }
.dialog .primary { min-width: 90px; }

@media (max-width: 600px) {
  .topbar-inner { padding: 0 18px; }
  .topbar-note { display: none; }
  .layout { padding: 22px 18px 0; }
  .start-view { padding: 12px 0 58px; }
  .form-view { display: flex; flex-direction: column; min-height: calc(100dvh - 84px); }
  h1 { font-size: 1.5rem; margin-bottom: 26px; }
  .school-heading h1 { font-size: 1.26rem; }
  .question-area { flex: 1; padding-top: 40px; min-height: 318px; }
  .progress-line { scroll-margin-top: 16px; }
  .question-area { padding-bottom: 18px; }
  .choice-group { grid-template-columns: 1fr; }
  .choice span { min-height: 48px; }
  .form-actions { position: sticky; bottom: 0; z-index: 20; margin: auto -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: #f5f7f7; box-shadow: 0 -6px 20px #20303614; }
  .form-actions button { flex: 1; min-height: 48px; }
  .form-actions .save-button { flex: 1.8; }
}
