/* Calm default theme: warm off-white, dark-grey text, one accent. Mobile first. */
:root {
  --bg: #fffdf9;
  --text: #403934;
  --muted: #7a6f66;
  --accent: #d77738;
  --line: #efe4d6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
body { margin: 0; }
main, footer { max-width: 44rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; line-height: 1.25; }
a { color: var(--accent); }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0 0 1rem; }
.field small { color: var(--muted); }
.field small.error, .has-error label { color: #a8321e; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="url"], input:not([type]), select, textarea {
  padding: 0.45rem 0.55rem; border: 1px solid #d9cbb9; border-radius: 6px; background: #fff; color: var(--text);
}
.has-error input, .has-error select { border-color: #a8321e; }
button { padding: 0.45rem 0.9rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }
button.quiet { background: none; color: var(--muted); text-decoration: underline; padding: 0.2rem; }
form.inline { display: inline-flex; gap: 0.4rem; align-items: center; margin: 0; }
.notice { padding: 0.6rem 0.8rem; border-radius: 6px; border: 1px solid var(--line); }
.notice.ok { background: #f1f7ee; border-color: #cfe3c4; }
.notice.error { background: #fbefea; border-color: #f0cbbd; }
.notice p { margin: 0.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { overflow-wrap: anywhere; }
button { white-space: nowrap; }
/* On phones, each row of a people table becomes a small card. */
@media (max-width: 36rem) {
  table.people thead { display: none; }
  table.people tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
  table.people td { display: block; border: 0; padding: 0.15rem 0; }
  table.people td:first-child { font-weight: 600; }
}
.instructor-nav, .student-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.instructor-nav a[aria-current="page"], .student-nav a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }
ul.sessions { list-style: none; padding: 0; }
ul.sessions li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
ul.sessions small { color: var(--muted); }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row .field { flex: 1 1 8rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: -0.5rem; }
.danger-zone { margin-top: 1.5rem; }
a.button { display: inline-block; padding: 0.45rem 0.9rem; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; white-space: nowrap; }
.focus { font-size: 1.05rem; }
.next-session { padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.next-session p { margin: 0.3rem 0; }
.next-session small, .meta, .weeks .locked { color: var(--muted); }
.notice.critical { margin: 1rem 0; background: #fbefea; border-color: #f0cbbd; }
.notice.critical h2 { margin: 0.2rem 0; font-size: 1.1rem; }
ol.activities { list-style: none; padding: 0; }
ol.activities > li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
ol.activities > li.retired { opacity: 0.7; }
ol.activities .meta { display: block; margin: 0.15rem 0 0.4rem; }
ol.activities form.inline, ol.activities a.button { margin-top: 0.2rem; }
.activity-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: baseline; justify-content: space-between; font-weight: 600; }
.state { font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--line); color: var(--text); white-space: nowrap; }
.state-completed { background: #e3f0dc; color: #2f5d22; }
.state-submitted, .state-in_progress { background: #e6eef8; color: #24466e; }
.state-needs_correction { background: #fbe3d6; color: #8a2f12; }
.state-excused, .state-optional { background: #f1ede8; color: var(--muted); }
.note { background: #fff8e8; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.95rem; }
.week-pager { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.week-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0.5rem 0 1rem; font-size: 0.95rem; }
.week-tabs a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }
form.filter { flex-wrap: wrap; margin-bottom: 1rem; }
.grid-wrap { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
table.grid { width: auto; min-width: 100%; font-size: 0.9rem; }
table.grid th, table.grid td { white-space: nowrap; padding: 0.4rem 0.6rem; }
table.grid thead th { vertical-align: bottom; font-weight: 600; }
table.grid thead small { font-weight: normal; color: var(--muted); }
table.grid tbody th { position: sticky; left: 0; background: var(--bg); text-align: left; font-weight: normal; }
table.grid td a { color: var(--text); }
table.grid td.match { outline: 2px solid var(--text); outline-offset: -3px; }
table.grid a.sub { color: var(--accent); font-size: 0.85rem; }
.cell-note { display: block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
fieldset.bulk { border: 1px solid var(--line); border-radius: 8px; margin-top: 1rem; padding: 0.6rem 0.9rem; }
dl.diary dt { font-weight: 600; margin-top: 0.4rem; }
dl.diary dd { margin: 0.1rem 0 0; white-space: pre-wrap; }
form.diary textarea { width: 100%; box-sizing: border-box; }
.diary-entry { border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.diary-entry h2 { font-size: 1.05rem; margin-top: 1.2rem; }
.field.checkbox label { display: flex; gap: 0.5rem; align-items: flex-start; }
.field.checkbox input { margin-top: 0.35rem; }
.announcement { border-bottom: 1px solid var(--line); padding: 0.4rem 0 0.8rem; }
.announcement h2 { margin: 0.8rem 0 0.1rem; font-size: 1.1rem; }
.announcement > small { color: var(--muted); }
.announcement.critical h2::before { content: "● "; color: var(--accent); }
