:root {
  color-scheme: light;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17212b;
  background: #f2f4f6;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #075a83; }
a:hover { color: #003e5e; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: .65rem 1rem;
  color: white;
  background: #163d53;
}
.topbar a { color: white; text-decoration: none; }
.brand { font-weight: 700; white-space: nowrap; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.account { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.account form { margin: 0; }
.link-button { color: white; border: 1px solid #9bb5c3; background: transparent; padding: .3rem .55rem; }

.wrap { max-width: 1600px; margin: 0 auto; padding: 1rem; }
h1 { margin: 0 0 .8rem; font-size: 1.5rem; }
h2 { margin: 0 0 .75rem; font-size: 1.08rem; }
p { margin: .35rem 0 .8rem; }
.muted { color: #596773; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .2rem 0 1rem; }
.page-heading h1 { margin-bottom: .2rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.panel { background: white; border: 1px solid #cbd3d9; border-radius: 4px; padding: 1rem; margin: 0 0 1rem; }
.section-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.section-card { display: block; padding: .75rem 1rem; border: 1px solid #9eabb4; border-radius: 3px; text-decoration: none; font-weight: 600; }
.notice { padding: .75rem; border: 1px solid #d5b66d; background: #fff8e5; margin-bottom: 1rem; }

button, .button {
  display: inline-block;
  padding: .4rem .65rem;
  border: 1px solid #0e587e;
  border-radius: 3px;
  background: #0e587e;
  color: white;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: #084363; color: white; }
button.danger { border-color: #9c3030; background: #a43838; }
button.danger:hover { background: #7c2525; }
input, select {
  max-width: 100%;
  border: 1px solid #9aa8b2;
  border-radius: 3px;
  padding: .38rem .45rem;
  color: inherit;
  background: white;
  font: inherit;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid #e2a900;
  outline-offset: 1px;
}
label { display: flex; flex-direction: column; gap: .2rem; }
.inline-form { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.inline-form label { min-width: 180px; }
.wrap-form { align-items: end; }
.grow { flex: 1; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid #e0e5e8; }
.list-row:first-child { border-top: 0; }
.monitor-row { align-items: end; }

.table-scroll { width: 100%; overflow: auto; border: 1px solid #cbd3d9; background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .45rem; border-right: 1px solid #d9dfe3; border-bottom: 1px solid #d9dfe3; text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; z-index: 1; background: #e9eef1; }
.matrix { min-width: max-content; }
.matrix td { min-width: 112px; max-width: 150px; padding: .25rem; vertical-align: middle; }
.matrix .student-heading { min-width: 112px; max-width: 150px; text-align: center; }
.skill-column { position: sticky; left: 0; z-index: 2; min-width: 210px; max-width: 260px; background: #f4f6f7; }
.matrix thead .skill-column { z-index: 3; background: #e9eef1; }
.assessment-cell { display: flex; align-items: center; justify-content: center; gap: .2rem; }
.assessment-form { display: contents; }
.step-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.step-button:disabled { cursor: default; opacity: .4; }
.status-pill { display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 28px; border: 1px solid #aab5bc; border-radius: 999px; background: #edf0f2; font-weight: 700; }
.status-in_progress { border-color: #d4aa39; background: #fff2c9; }
.status-acquired { border-color: #5b9d75; background: #e0f2e7; }
.status-mastered { border-color: #4d7aa0; background: #deebf7; }
.save-status { min-height: 1.4em; margin: .4rem 0; color: #9c3030; }
.log-table td:first-child { white-space: nowrap; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-panel { width: min(100%, 390px); }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack button { align-self: flex-start; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .topbar { align-items: flex-start; }
  .topbar nav { order: 3; width: 100%; gap: .7rem; }
  .account { margin-left: auto; }
  .wrap { padding: .65rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .list-row { align-items: stretch; flex-direction: column; }
  .list-row > form { width: 100%; }
  .list-row .inline-form input:not([type=hidden]) { flex: 1; min-width: 130px; }
  .monitor-row { align-items: stretch; }
  .wrap-form label { flex: 1 1 100%; }
  .toolbar { width: 100%; }
  .toolbar select { max-width: 60vw; }
}
