:root {
  color-scheme: light;
  --ink: #0a1530;
  --muted: #414a63;
  --accent: #650ed5;
  --outline: #9daec8;
  --surface: #fff;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(150deg, #e2f0fc, #d9ebfa);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.masthead {
  min-height: 68px;
  padding: 10px clamp(16px, 2.2vw, 36px);
  background: var(--surface);
  border-bottom: 2px solid #232952;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: block; width: clamp(148px, 20vw, 240px); height: auto; }
a { color: var(--accent); }
.school-logo {
  display: block;
  width: clamp(174px, 29vw, 312px);
  height: auto;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
}
main { width: min(85.5%, 1240px); margin-inline: auto; padding: clamp(36px, 4.1vw, 66px) 0 30px; }
h1 { margin: 0; text-align: center; font-size: clamp(2rem, 4.2vw, 4.15rem); line-height: 1.08; letter-spacing: -.042em; font-weight: 820; }
.intro { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: clamp(1rem, 1.85vw, 1.65rem); }

.workbench {
  --status: #56617a;
  --tint: #edf0f6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 30px;
  margin-top: clamp(28px, 3.5vw, 52px);
  padding: clamp(20px, 2.25vw, 36px) 0;
}
.workbench[data-level="weak"] { --status: #bc251e; --tint: #fbe1df; }
.workbench[data-level="fair"] { --status: #895000; --tint: #fff0d6; }
.workbench[data-level="strong"] { --status: #127046; --tint: #dcf4e7; }
.controls, .results { min-width: 0; padding-inline: clamp(20px, 2.75vw, 42px); }
.controls { padding-top: 20px; }
.results { border-left: 1px solid #c8cddd; }
#input-label, h2 { font-size: clamp(1.08rem, 1.8vw, 1.65rem); font-weight: 780; line-height: 1.2; letter-spacing: -.025em; }
.field {
  display: flex;
  min-height: 68px;
  margin-top: 20px;
  border: 1px solid #626d87;
  border-radius: 13px;
  overflow: hidden;
}
.field:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.field input { flex: 1; width: 0; padding: 10px 0 10px 20px; background: transparent; border: 0; outline: 0; font-size: 1.55rem; }
.field button { flex: 0 0 55px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.field button:focus-visible { outline-offset: -6px; }
.field button:disabled { opacity: .4; cursor: default; }
#privacy { margin: 13px 0 0; color: var(--muted); font-size: clamp(.9rem, 1.3vw, 1.18rem); }
.example-heading { margin: clamp(28px, 3.7vw, 52px) 0 8px; }
.example-help { margin: 0 0 14px; color: var(--muted); }
.examples { display: flex; flex-wrap: wrap; gap: 12px; }
.examples button { border: 1px solid #515d78; background: var(--surface); border-radius: 11px; min-height: 48px; padding: 8px clamp(12px, 1.3vw, 24px); font-size: clamp(.91rem, 1.32vw, 1.24rem); }
.examples button:hover, .field button:not(:disabled):hover { background: #f1eaff; }
.example-preview { margin: 14px 0 0; color: var(--muted); }
.example-preview code { display: block; margin-top: 5px; color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }

.score-line { font-size: clamp(2.5rem, 4.25vw, 3.85rem); font-weight: 820; line-height: 1; letter-spacing: -.065em; }
#score { color: var(--status); }
.rating { display: table; margin: 13px 0 17px; padding: 4px 15px; border-radius: 12px; font-size: clamp(.94rem, 1.55vw, 1.4rem); font-weight: 780; background: var(--tint); color: var(--status); }
meter { display: block; width: 100%; height: 15px; appearance: none; border: 0; border-radius: 999px; background: #e0e2ed; }
meter::-webkit-meter-bar { background: #e0e2ed; border: 0; border-radius: 999px; height: 15px; }
meter::-webkit-meter-optimum-value { background: var(--status); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--status); border-radius: 999px; }
.results h2 { margin: clamp(24px, 2.65vw, 38px) 0 10px; }
#empty, #feedback { font-size: clamp(.96rem, 1.36vw, 1.24rem); }
#empty { margin: 14px 0; color: var(--muted); }
#feedback { list-style: none; margin: 0; padding: 0; }
#feedback li { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 12px; min-height: 43px; padding: 9px 0; }
#feedback li + li { border-top: 1px solid #d6dbe7; }
.mark { display: grid; place-items: center; width: 23px; height: 23px; border: 2px solid currentColor; border-radius: 50%; color: #54637e; font-weight: 740; font-size: .85rem; }
.mark[data-kind="warning"] { color: #bc251e; }
.mark[data-kind="good"] { color: #127046; }
footer { margin-top: 28px; text-align: center; color: var(--muted); font-size: clamp(.86rem, 1.36vw, 1.24rem); }
footer p { margin: 0 0 8px; }
footer .disclaimer { max-width: 72ch; margin-inline: auto; font-size: .9em; }

@media (min-width: 1024px) {
  .school-logo { width: 264px; }
  main { padding-block: 34px 20px; }
  h1 { font-size: clamp(2.75rem, 3.6vw, 3.65rem); }
  .intro { margin-top: 12px; }
  .workbench { margin-top: 28px; padding-block: 24px; }
  .controls { padding-top: 8px; }
  .field { min-height: 58px; margin-top: 12px; }
  .example-heading { margin-top: 24px; }
  .examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .examples button { padding-inline: 10px; min-height: 44px; font-size: 1rem; }
  .results h2 { margin-top: 24px; }
  footer { margin-top: 18px; font-size: 1rem; }
  footer p { margin-bottom: 6px; }
}

@media (max-width: 760px) {
  .brand, .school-logo { max-width: calc((100% - 12px) / 2); }
  .school-logo { padding: 4px 0; }
  main { width: calc(100% - 32px); max-width: 520px; }
  .workbench { grid-template-columns: 1fr; border-radius: 22px; }
  .controls { padding-top: 0; }
  .results { margin-top: 24px; padding-top: 24px; border-left: 0; border-top: 1px solid #c8cddd; }
  .field { min-height: 52px; margin-top: 12px; }
  .example-heading { margin-top: 22px; }
}
