:root {
  color-scheme: light;
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #182637;
  background: #edf2f6;
  --navy: #142b46;
  --blue: #175f94;
  --line: #dce5ed;
  --muted: #506477;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(1320px, 100% - 2rem); margin-inline: auto; }
.banner { background: var(--navy); color: white; padding-top: 1.6rem; }
.period { margin: 0; font-weight: 650; color: #a9d9f9; }
h1 { margin: .25rem 0 1.25rem; font-size: clamp(1.6rem, 5vw, 2.45rem); }
h2 { margin: 1.6rem 0 1rem; font-size: clamp(1.35rem, 4vw, 1.75rem); }
h3 { margin: 0 0 .85rem; font-size: 1.08rem; }
nav { display: flex; gap: .45rem; overflow-x: auto; }
nav button { white-space: nowrap; }
nav button[aria-current] { background: #edf2f6; color: #142b46; font-weight: 750; }
main { padding-bottom: 1.5rem; }
.panel { background: white; border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; margin: 0 0 1rem; }
.scroll { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: .48rem .65rem; text-align: left; vertical-align: middle; }
thead th { background: #edf3f9; white-space: nowrap; }
th[scope="row"] { white-space: nowrap; }
tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.grid th, .grid td { text-align: center; padding: .25rem; }
.grid th { min-width: 2.2rem; }
.grid .sticky { position: sticky; left: 0; z-index: 1; padding-inline: .55rem; }
tbody .sticky { background: white; box-shadow: 2px 0 0 var(--line); }
thead .weekend, .day.weekend { background: #eaf4fb; }
button, input, select, textarea { font: inherit; }
button, input:not([type="checkbox"]), select, textarea {
  border: 1px solid #b9c9d8; border-radius: .36rem; padding: .44rem .62rem; color: inherit; background: white;
}
button { cursor: pointer; font-weight: 630; }
nav button { background: #223e5d; color: white; border-color: transparent; border-radius: .55rem .55rem 0 0; }
button:not(:disabled):hover { filter: brightness(.94); }
button:disabled { color: #68798a; cursor: default; background: #f3f6f9; }
:focus-visible { outline: 3px solid #328bc5; outline-offset: 2px; }
button.primary { background: var(--blue); color: white; border-color: var(--blue); }
input[type="checkbox"] { accent-color: var(--blue); width: 1rem; height: 1rem; margin: 0; }
.attendance { width: 2rem; height: 2rem; padding: 0; border-color: transparent; }
.yes, button.yes { color: #116247; background: #e0f5eb; }
.no, button.no { color: #a32f42; background: #fceaf0; }
.maybe, button.maybe { color: #805109; background: #fff2d1; }
.tag { display: inline-block; min-width: 2.1em; text-align: center; border-radius: .25rem; padding: .1em .25em; font-weight: 750; }
.fields, .toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem 1rem; margin: .55rem 0 .85rem; }
.fields label, .week-picker { display: grid; gap: .27rem; font-size: .9rem; }
.fields p { width: 100%; margin: 0; }
label.inline { display: inline-flex; gap: .4rem; align-items: center; min-height: 2.3rem; }
summary { cursor: pointer; font-weight: 700; }
.metrics { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; }
.metrics span { background: #eff5fa; border-radius: .4rem; padding: .2rem .6rem; }
.metrics strong { color: var(--blue); font-size: 1.2rem; }
.timeline { display: grid; gap: .4rem; padding: 0; list-style: none; }
.timeline li {
  display: grid; grid-template-columns: max-content 1fr max-content; align-items: center; gap: .7rem;
  background: var(--chain-bg); border-left: .3rem solid var(--chain); padding: .45rem .6rem; border-radius: .3rem;
}
.chain-label { font-size: .8rem; color: #34495b; font-weight: 700; }
.chain-0 { --chain: #0c907f; --chain-bg: #e5f6f2; }
.chain-1 { --chain: #3b78bc; --chain-bg: #e8f2fd; }
.chain-2 { --chain: #a07629; --chain-bg: #fff3db; }
.chain-3 { --chain: #a45492; --chain-bg: #f9eaf6; }
.chain-4 { --chain: #528234; --chain-bg: #edf6e8; }
.chain-5 { --chain: #c25a44; --chain-bg: #fff0eb; }
.calendar { min-width: 760px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.calendar > div { background: white; }
.calendar .weekday { text-align: center; font-weight: 700; padding: .4rem; background: #edf3f9; }
.day { min-height: 6rem; padding: .48rem; display: flex; flex-direction: column; gap: .2rem; }
.day span { font-size: .875rem; font-weight: 700; }
.day small { font-size: .8rem; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.warning, .warnings { color: #854018; background: #fff3e6; border-radius: .4rem; }
.warnings { padding: .45rem .75rem .45rem 1.9rem; margin-bottom: .25rem; }
.warning { padding: .7rem; }
textarea { display: block; width: 100%; resize: vertical; line-height: 1.55; margin-bottom: .65rem; }
.week-picker { width: max-content; margin-bottom: .7rem; }
.notice:not(:empty) {
  position: fixed; z-index: 2; right: 1rem; bottom: 1rem; max-width: calc(100% - 2rem);
  background: var(--navy); color: white; border-radius: .5rem; padding: .7rem 1rem; box-shadow: 0 4px 22px #142b463c;
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 1rem); }
  .panel { padding: .7rem; }
  .timeline li { grid-template-columns: 1fr; gap: .25rem; }
  .timeline select { width: max-content; }
}
