:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2433;
  background: #f4f6f9;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
a { color: #174ea6; }

.site-header {
  background: #18233a;
  color: #fff;
  padding: 1rem;
}

.site-header a { color: #fff; text-decoration: none; }
.site-header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-title { font-weight: 700; margin-right: auto; }
.container { width: min(100% - 2rem, 720px); margin: 2rem auto; }
.card { background: #fff; border-radius: 8px; padding: 1.5rem; box-shadow: 0 2px 8px rgb(24 35 58 / 10%); }
.field { margin: 1rem 0; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, select, textarea { width: 100%; padding: .65rem; border: 1px solid #9aa5b5; border-radius: 4px; font: inherit; }
button { border: 0; border-radius: 4px; padding: .65rem 1rem; background: #174ea6; color: #fff; font: inherit; cursor: pointer; }
.alert { padding: .75rem 1rem; border-radius: 4px; background: #fce8e6; color: #8a1c15; }
.notice { padding: .75rem 1rem; border-radius: 4px; background: #e6f4ea; color: #137333; }
.meta { color: #586174; font-size: .92rem; }
.logout-form { display: inline; margin: 0; }
.container-wide { width: min(100% - 2rem, 1400px); }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem; border-bottom: 1px solid #d9dee7; text-align: left; vertical-align: top; }
th { white-space: nowrap; }
.compact-form { display: grid; gap: .5rem; min-width: 180px; }
.compact-form label { font-size: .86rem; }
.compact-form input, .compact-form select { min-width: 0; }
.checkbox-field label { display: inline; font-weight: 400; }
.checkbox-field input { width: auto; }

/* One shared column layout for every week; keep compact styling in this calendar. */
.target-schedule { font-size: .875rem; }
.target-schedule h2 { font-size: 1.125rem; }
.target-schedule .meta { font-size: .8125rem; }
.target-schedule details { margin: .75rem 0; border: 1px solid #d9dee7; border-radius: 6px; }
.target-schedule summary { padding: .5rem .65rem; background: #f4f6f9; font-weight: 600; cursor: pointer; }
.target-schedule-table { table-layout: fixed; min-width: 52rem; font-size: .875rem; }
.target-schedule-col-date { width: 7.5rem; }
.target-schedule-col-venue { width: 4.5rem; }
.target-schedule-col-grade { width: 4.5rem; }
.target-schedule-col-course { width: 7rem; }
.target-schedule-col-status { width: 11rem; }
.target-schedule-table th, .target-schedule-table td { padding: .5rem .6rem; vertical-align: middle; }
.target-schedule-table th { font-size: .8125rem; color: #586174; background: #f4f6f9; }
.target-schedule-table td:not(:last-child) { white-space: nowrap; }
.target-schedule-table th:nth-child(2), .target-schedule-table td:nth-child(2),
.target-schedule-table th:nth-child(4), .target-schedule-table td:nth-child(4) { text-align: center; }
.target-schedule-table td:first-child { font-variant-numeric: tabular-nums; }
.target-schedule-table tbody tr:nth-child(even) { background: #fafbfc; }
.target-schedule-table tbody tr:last-child td { border-bottom: 0; }

/* Submitted general selections alongside official finishers, in two compact bands. */
.result-prediction-cell { min-width: 6rem; }
.result-prediction-marks { display: grid; gap: .2rem; font-size: .75rem; line-height: 1.4; }
.result-prediction-line { min-height: 1.4em; white-space: nowrap; }


/* One readable rules page; tables scroll locally on narrow screens. */
.rules-page { font-size: .9375rem; line-height: 1.8; }
.rules-page > .card + .card { margin-top: 1rem; }
.rules-page h1 { font-size: 1.5rem; }
.rules-page h2 { font-size: 1.125rem; scroll-margin-top: 1rem; }
.rules-page h3 { font-size: 1rem; }
.rules-toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .4rem 1.5rem; padding-left: 1.5rem; }
.rules-page li + li { margin-top: .4rem; }
.rules-page table { font-size: .875rem; min-width: 360px; }
.rules-page caption { text-align: left; font-weight: 600; padding-bottom: .5rem; }
.rules-formula { padding: .75rem; border-radius: 4px; background: #f4f6f9; overflow-wrap: anywhere; }
.rules-back { font-size: .875rem; }
