:root {
  --paper: #f4f0e6;
  --paper-2: #ebe4d6;
  --card: #fffcf7;
  --ink: #1c2433;
  --navy: #1c2c4e;
  --muted: #6e675d;
  --line: #e3dbcc;
  --teal: #0f7668;
  --teal-deep: #0c5c51;
  --teal-soft: #e5f3ef;
  --orange: #d86a2a;
  --danger: #a33b32;
  --danger-soft: #fdecea;
  --ok-soft: #e7f6f1;
  --shadow: 0 1px 2px rgba(28, 36, 51, 0.04), 0 16px 40px rgba(28, 36, 51, 0.06);
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --bill-title-font: 600 14px/1.5 var(--sans);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(15, 118, 104, 0.08), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--teal-deep); }
a:hover { color: var(--navy); }

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-200%);
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}
.skip:focus { transform: none; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 18px 28px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: #f6f1e6;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
}
.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
}
.brand-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.7);
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  text-decoration: none;
}
a.chip:hover { color: var(--navy); background: white; }

.wrap { width: min(760px, calc(100% - 32px)); margin: 12px auto 32px; flex: 1; min-width: 0; }
.wrap.wide { width: min(1180px, calc(100% - 32px)); }

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 26px; }
.lede { margin: 0 0 18px; color: #3d4553; max-width: 62ch; }
.fine { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

.card, .auth-card, .hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.hero { padding: 36px; }
.narrow { max-width: 640px; margin-inline: auto; }
.auth-card { max-width: 520px; margin: 24px auto; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 8px 0 18px;
}
.count-pill {
  margin: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head-actions .btn { margin-top: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.split > * { min-width: 0; }

.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 600; font-size: 14px; margin-top: 6px; }
input {
  width: 100%;
  border: 1px solid #d9d0c2;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}
select {
  width: 100%;
  border: 1px solid #d9d0c2;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}
input:focus, select:focus {
  outline: 3px solid rgba(15, 118, 104, 0.28);
  border-color: var(--teal);
}
input[readonly] {
  background: #f7f3eb;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:focus-visible { outline: 3px solid rgba(28, 44, 78, 0.35); outline-offset: 2px; }
.btn-navy { background: var(--navy); color: #f7f3ea; }
.btn-navy:hover { background: #15233f; color: white; }
.btn-teal { background: var(--teal); color: white; margin-top: 8px; }
.btn-teal:hover { background: var(--teal-deep); color: white; }
.btn-lg { width: 100%; padding: 12px 16px; margin-top: 8px; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn-ghost:hover { background: #f6f1e7; color: var(--navy); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #8c2f28; color: white; }
.btn-danger-ghost {
  background: transparent;
  border-color: #f0c7c2;
  color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-actions .btn { margin-top: 0; }

.banner {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-weight: 600;
}
.banner-ok { background: var(--ok-soft); color: var(--teal-deep); }
.banner-err { background: var(--danger-soft); color: #8d2d28; }
.banner-note { background: #f6f1e7; color: var(--navy); }

.meter-block { margin: 8px 0 20px; }
.meter-labels, .meter-caption {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.meter-labels span:first-child { color: #b42318; font-weight: 700; }
.meter-labels span:last-child { color: #0e6e73; font-weight: 700; }
.meter {
  position: relative;
  height: 12px;
  margin: 8px 0;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #c4453c 0%,
    #d86a2a 16%,
    #e0a23a 34%,
    #c6b15a 48%,
    #8aa356 64%,
    #3d8f72 80%,
    #0e7c74 100%);
}
.meter-knob {
  position: absolute;
  top: 50%;
  left: 78%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid #1c2433;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.meter-caption {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  display: block;
}

.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px 10px;
  border-bottom: 1px solid #efe8dc;
  vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); padding: 28px 10px; }
.roster .email,
.roster .who-name { white-space: nowrap; }
.roster .btn { padding: 6px 10px; font-size: 14px; }
.missing { color: var(--danger); font-weight: 700; }
.pill-primary {
  display: inline-block;
  margin-top: 4px;
  background: var(--navy);
  color: #f7f3ea;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.add-form { margin-top: 16px; max-width: 420px; }
.person-section { position: relative; }
.person-section > .add-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.section-titles { flex: 1 1 12rem; min-width: 0; }
.section-head h2 { margin: 0; }
.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.section-head .btn,
.section-head .add-open {
  margin: 0;
  white-space: nowrap;
}
.person-section > .add-form { display: none; }
.person-section > .add-toggle:checked ~ .section-head .add-open { display: none; }
.person-section > .add-toggle:checked ~ .add-form { display: flex; }
.person-section > .add-toggle:focus-visible ~ .section-head .add-open {
  outline: 3px solid rgba(15, 118, 104, 0.28);
  outline-offset: 2px;
}
.sections { display: flex; flex-direction: column; gap: 18px; }
.when { white-space: nowrap; color: #3d4553; font-size: 15px; }
.who { display: flex; align-items: center; gap: 10px; }
.who-name { display: block; font-weight: 700; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #f7f3ea;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.avatar-student {
  width: auto;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.avatar-0 { background: #0f7668; }
.avatar-1 { background: #1e3a5f; }
.avatar-2 { background: #c45c26; }
.avatar-3 { background: #3d6b4f; }
.avatar-4 { background: #8a4b2f; }
.avatar-5 { background: #245c6b; }
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.status-disabled { background: #eeeae3; color: var(--muted); }
.status-active { background: #e5f5d8; color: #3d6b4f; }
.row-actions { width: 1%; white-space: nowrap; }
.row-actions-inner { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-start; }
details.password-drop { display: flex; flex-direction: column; align-items: flex-end; text-align: left; }
summary.btn { list-style: none; cursor: pointer; }
summary.btn::-webkit-details-marker { display: none; }
summary.btn::marker { content: ""; }
details.password-drop > form { margin-top: 8px; min-width: 16rem; }

.token-box {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.token-row { display: flex; gap: 8px; align-items: center; }
.token-row input { flex: 1; }
.danger-card { border-color: #f0cfcb; }

.ticker {
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  background: #1a1d24;
  color: #f3efe6;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  font-size: 14px;
}
.ticker p { margin: 0; }
.events {
  background: #b42318;
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
  .top { padding: 16px 16px 4px; }
  .brand-name { font-size: 24px; }
  .brand-sub { letter-spacing: 0.04em; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .ticker { align-items: flex-start; }
  .token-row { flex-direction: column; align-items: stretch; }

  .roster thead { display: none; }
  .roster,
  .roster tbody,
  .roster tr,
  .roster td { display: block; width: auto; }
  .roster tr {
    padding: 12px 0;
    border-bottom: 1px solid #efe8dc;
  }
  .roster tr:last-child { border-bottom: 0; }
  .roster td { border: 0; padding: 4px 0; }
  .roster td.empty { padding: 16px 0; }
  .roster .email,
  .roster .who-name { white-space: normal; }
  .roster .email { font-size: 15px; }
  .roster .when { white-space: normal; }
  .roster .row-actions { width: auto; white-space: normal; }
  .row-actions-inner { justify-content: flex-start; margin-top: 4px; flex-wrap: wrap; }
  .roster details.password-drop,
  details.password-drop { align-items: flex-start; }
  details.password-drop > form { min-width: 0; width: 100%; }
}

.class-fold { border: 1px solid var(--line); border-radius: 16px; margin-top: 14px; background: #fff; }
.class-fold > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  color: var(--navy);
}
.class-fold > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: rotate(-45deg);
  margin-right: 2px;
  flex: 0 0 auto;
}
.class-fold[open] > summary::before { transform: rotate(45deg); translate: 0 2px; }
.class-fold > summary::marker { content: ""; }
.class-fold-name { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.class-fold-count { color: var(--muted); font-size: 14px; font-weight: 700; }
.class-fold > .class-panel { border: 0; margin-top: 0; padding-top: 0; }
.fold-sub, .class-panel .fold-sub { margin: 18px 0 8px; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-deep); }
.bill-assign { list-style: none; margin: 0; padding: 0; }
.bill-head, .bill-line {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) 9.5rem 9.5rem 9.5rem minmax(8.5rem, 12rem);
  gap: 8px 12px;
  align-items: center;
}
.bill-head {
  padding: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bill-head span:nth-child(n + 2):nth-child(-n + 4) { text-align: center; }
.bill-row { padding: 8px 0; border-top: 1px solid var(--line); }
.bill-needs-vote { box-shadow: inset 4px 0 0 #d86a2a; }
.bill-off {
  background: #f4f0e6;
  color: #4e483f;
  border-radius: 10px;
}
.bill-off .fine { color: #4e483f; }
.bill-tally { margin: 0; font-size: 14px; }
.bill-status { margin: 0; font-size: 12px; font-weight: 700; color: #8d2d28; white-space: nowrap; }
.bill-status.is-error { white-space: normal; flex-basis: 100%; }
.bill-status:empty { display: none; }
.bill-status.is-error, .assign-close-status { margin: 0; font-size: 13px; font-weight: 700; color: #8d2d28; }
.assign-tools, .meeting-days { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 8px 0; }
.day-check { margin: 0; font-size: 14px; }
.bill-main { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.bill-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bill-box { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.bill-year { font-weight: 600; flex: 0 0 auto; }
.bill-title { font: var(--bill-title-font); min-width: 0; }
.bill-dates { display: none; }
.bill-row:has(input[type="checkbox"]:checked) .bill-dates { display: contents; }
.bill-dates label { display: flex; min-width: 0; }
.bill-dates input,
.bill-dates input::-webkit-datetime-edit,
.bill-dates input::-webkit-datetime-edit-fields-wrapper,
.bill-dates input::-webkit-datetime-edit-text,
.bill-dates input::-webkit-datetime-edit-month-field,
.bill-dates input::-webkit-datetime-edit-day-field,
.bill-dates input::-webkit-datetime-edit-year-field,
.bill-dates input::-webkit-date-and-time-value {
  font: var(--bill-title-font);
  text-align: center;
}
.bill-dates input::-webkit-datetime-edit,
.bill-dates input::-webkit-datetime-edit-fields-wrapper,
.bill-dates input::-webkit-date-and-time-value {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}
.bill-dates input {
  position: relative;
  width: 9.5rem;
  max-width: 100%;
  height: 2.1rem;
  padding: 2px 1.5rem;
  text-align: center;
}
.bill-dates input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0.4rem;
  margin: 0;
  padding: 0;
}
.bill-date-caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.bill-outcome { grid-column: 5; min-width: 0; }
.bill-tally { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0; font-size: 13px; }
.synopsis-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.doc-icon { display: block; }
.synopsis-panel {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.synopsis-panel[hidden] { display: none; }
.result-drop > summary { min-height: 2rem; padding: 4px 10px; }
.result-drop > form { margin-top: 8px; }
.synopsis-panel p { margin: 0 0 8px; font-weight: 500; line-height: 1.4; }
.synopsis-panel h4 { margin: 10px 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-deep); }
.bill-result { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.bill-result label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.bill-result input { width: 4.5rem; }
@media (max-width: 860px) {
  .bill-head { display: none; }
  .bill-head, .bill-line { grid-template-columns: 1fr; }
  .bill-outcome { grid-column: auto; }
  .bill-dates { display: none; }
  .bill-row:has(input[type="checkbox"]:checked) .bill-dates { display: flex; flex-direction: column; align-items: stretch; }
  .bill-date-caption { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  .bill-dates label, .bill-result label, .bill-result input { width: 100%; }
  .bill-dates input { width: 9.5rem; }
  .bill-result { flex-direction: column; align-items: stretch; }
}
.class-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  background: #fff;
}
.class-panel h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; color: var(--navy); }
.class-panel .count-pill { display: inline-flex; width: auto; margin-top: 8px; }
.class-panel p { margin: 0; color: var(--muted); }
.synopsis-panel, .synopsis-panel p { color: var(--ink); }
.class-panel .bill-status.is-error { color: #8d2d28; }
.unassigned-list { background: var(--paper-2, #f7f3ea); }
.unassigned-person { padding: 12px 0; border-top: 1px solid var(--line); }
.assign-form { max-width: 320px; margin-top: 8px; }
@media (max-width: 860px) {
  .class-panel .section-head { align-items: flex-start; }
  .class-panel .section-actions { margin-left: 0; justify-content: flex-start; }
}
.bill-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.bill-hit {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.bill-hit:hover { border-color: var(--teal); color: var(--ink); }
.issue-card { border-top: 1px solid var(--line); padding: 14px 0; }
.issue-card h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; }
.issue-card-head { display: flex; gap: 12px; align-items: flex-start; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
textarea {
  width: 100%;
  border: 1px solid #d9d0c2;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}
textarea:focus { outline: 3px solid rgba(15, 118, 104, 0.28); border-color: var(--teal); }
.email-preview {
  white-space: pre-wrap;
  background: #f7f3eb;
  border-radius: 12px;
  padding: 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
}
input[type="radio"],
input[type="checkbox"] { width: auto; }
.holiday-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: end; }
.inline-form input { width: 8rem; }
.choice input { width: 1.1rem; height: 1.1rem; margin: 0; }
.choice { justify-content: flex-start; padding: 14px 16px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-row .btn { width: 100%; margin-top: 0; padding: 14px; }
.btn-nay { background: #9a3412; color: #fff; }
.lib-head, .lib-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 4.5rem 3rem 15rem 8rem 5.5rem;
  gap: 10px;
  align-items: center;
}
.lib-head {
  color: #5c564c;
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 0;
  padding: 0 10px;
  border: 1px solid transparent;
}
.lib-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  background: #fff;
}
.lib-check { margin: 0; }
.lib-row .fine { display: block; }
.bill-name { min-width: 0; }
.bill-drop summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  width: 100%;
}
.lib-row { align-items: start; }
.lib-row > :not(.bill-name) { margin-top: 6px; }
.lib-row input[type="datetime-local"] { margin-top: 0; padding: 6px 12px; }
.bill-drop summary::-webkit-details-marker { display: none; }
.bill-drop summary::marker { content: ""; }
.bill-drop summary:focus-visible { outline: 3px solid rgba(15, 118, 104, 0.28); outline-offset: 3px; border-radius: 8px; }
.bill-drop summary:hover strong { color: var(--teal-deep); }
.chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: translateY(-0.1rem) rotate(-45deg);
  flex: none;
  align-self: center;
}
.bill-drop[open] > summary .chevron { transform: translateY(0.05rem) rotate(45deg); }
.lib-row { container-type: inline-size; }
.bill-panel {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  width: 100cqi;
  margin-left: calc(-2.5rem - 10px);
  box-sizing: border-box;
}
.bill-facts {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0 0 14px;
}
.bill-facts dt { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.bill-facts dd { margin: 0; }
.bill-record h3 { margin: 16px 0 6px; font-size: 18px; }
.bill-record h4 { margin: 0 0 4px; font-size: 16px; }
.reading { margin: 0 0 12px; }
.reading-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.reading a, .bill-record a { overflow-wrap: anywhere; }
.overlap { color: #9a3412; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.filter-row > div { flex: 1 1 9rem; min-width: 0; }
.filter-row .btn { flex: 0 0 auto; margin-top: 0; }
.source-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.source-split .card { margin: 0; min-width: 0; }
.source-split .argument-card, .source-split a { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .filter-row, .lib-head, .lib-row, .source-split { grid-template-columns: 1fr; }
  .lib-head { display: none; }
  .bill-panel { width: auto; margin-left: 0; }
  .bill-facts { grid-template-columns: 1fr; }
}
.btn-nay:hover { background: #7c2d12; color: #fff; }
.email-preview { overflow-wrap: anywhere; max-width: 100%; }
.wrap { display: flex; flex-direction: column; gap: 16px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 16px;
  font-weight: 700;
  background: white;
}
.argument, .argument-card p { white-space: pre-wrap; }
.argument-card { border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.argument-for { background: var(--teal-soft); }
.argument-against { background: #f8f0e4; }
.grade-form { display: flex; flex-wrap: wrap; gap: 8px; }
.grade-form input { width: auto; min-width: 0; flex: 1; }
.link-list { padding-left: 18px; }
.builder { align-items: start; }
.day-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.day-row input { width: 100%; max-width: 100%; min-width: 0; }
.day-stack { grid-template-columns: minmax(0, 1fr); }
.class-days { font-weight: 700; }
tr.is-missing td:first-child { box-shadow: inset 3px 0 0 #c45c26; }
@media (max-width: 640px) {
  .choice-row { grid-template-columns: 1fr; }
  .grade-form { flex-direction: column; }
  .grade-form input { width: 100%; }
  .day-row { grid-template-columns: 1fr; }
  .holiday-row { flex-direction: column; align-items: stretch; }
}

.gate-home {
  --yea: #1db872;
  --nay: #e24b3e;
  --pres: #e8b13c;
  --board: #1a5c64;
  --board-2: #154b52;
  --board-row: #22727a;
  --board-line: #8ad9d0;
  --board-ink: #f4fbf9;
  --board-muted: #d5eeea;
  background: var(--paper);
  line-height: 1.55;
  overflow-x: hidden;
}
.gate-home .ic { width: 1em; height: 1em; display: inline-block; flex: none; }
.gate-home .sprite { position: absolute; width: 0; height: 0; }
.gate-home .masthead { background: var(--navy); color: #f6f1e6; padding: 22px 32px 20px; }
.gate-home .mast-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; max-width: 1160px; margin: 0 auto; }
.gate-home .mark { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.gate-home .mark:hover { color: inherit; }
.gate-home .logo { width: 44px; height: 44px; border-radius: 50%; background: #f6f1e6; color: var(--navy); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 24px; flex: none; }
.gate-home .paper-name { font-family: var(--serif); font-size: clamp(32px, 5vw, 52px); line-height: 0.95; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.gate-home .dateline { margin: 6px 0 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #c9c2b2; line-height: 1.4; }
.gate-home .rule { height: 4px; background: var(--teal); }
.gate-home .kicker { margin: 0 0 8px; color: var(--teal-deep); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.gate-home h2.headline { font-family: var(--serif); font-weight: 600; letter-spacing: -0.03em; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; margin: 0 0 16px; color: var(--navy); }
.gate-home .dek { margin: 0; font-size: 18px; color: #3d4553; max-width: none; }
.gate-home .gate { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.gate-home .gate h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0 0 6px; color: var(--navy); }
.gate-home .gate p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.gate-home .gate label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.gate-home .gate input[type="password"] { width: 100%; border: 1px solid #d9d0c2; background: #fff; border-radius: 12px; padding: 12px 14px; font: inherit; color: var(--ink); }
.gate-home .gate input:focus { outline: 3px solid rgba(15, 118, 104, 0.28); border-color: var(--teal); }
.gate-home .gate .btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-top: 14px; border: 0; border-radius: 999px; padding: 13px 16px; font: inherit; font-weight: 700; background: var(--teal); color: #fff; cursor: pointer; min-height: 48px; letter-spacing: 0.02em; text-decoration: none; }
.gate-home .gate .btn:hover { background: var(--teal-deep); color: #fff; }
.gate-home .gate .btn:focus-visible { outline: 3px solid rgba(15, 118, 104, 0.4); outline-offset: 2px; }
.gate-home .gate .fine { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.gate-home .gate .banner { margin-bottom: 14px; }
.gate-home .gate .gate-leave { background: transparent; color: var(--navy); border: 1px solid var(--line); font-weight: 600; margin-top: 10px; }
.gate-home .gate .gate-leave:hover { background: #f6f1e7; color: var(--navy); }
.gate-home .colophon { margin-top: auto; background: var(--navy); color: #f3efe6; display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding: 14px 32px; font-size: 14px; }
.gate-home .colophon p { margin: 0; }
.gate-home .stage { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(150px, 190px); grid-template-areas: "fl intro fr" "fl board fr" "fl gate fr"; gap: 8px 22px; width: min(1240px, calc(100% - 32px)); margin: 0 auto; align-items: stretch; padding: 0 0 8px; flex: 1; }
.gate-home .intro { grid-area: intro; padding: 34px 0 18px; }
.gate-home .board { grid-area: board; }
.gate-home .gate-wrap { grid-area: gate; width: min(440px, 100%); margin: 36px auto 48px; }
.gate-home .flank-l { grid-area: fl; }
.gate-home .flank-r { grid-area: fr; }
.gate-home .flank { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 12px 0; text-align: center; }
.gate-home .flank-inner { width: 100%; max-width: 190px; }
.gate-home .flank-art { width: 100%; height: auto; display: block; overflow: visible; }
.gate-home .flank-label { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--navy); margin: 10px 0 0; line-height: 1.15; }
.gate-home .flank-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.gate-home .board { background: var(--board); color: var(--board-ink); border-radius: 20px; border: 2px solid var(--board-line); box-shadow: 0 16px 40px rgba(28, 44, 78, 0.16); overflow: hidden; }
.gate-home .board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 2px solid var(--board-line); font-weight: 700; letter-spacing: 0.16em; font-size: 13px; text-transform: uppercase; background: var(--board-2); color: #fff; }
.gate-home .board-head .hr { color: #f6d36a; font-weight: 800; }
.gate-home .board-head .bt { display: flex; align-items: center; gap: 10px; color: #fff; }
.gate-home .board-head .bt .ic { font-size: 22px; color: #b7f0e8; }
.gate-home .quorum { display: flex; align-items: center; gap: 6px; color: #e7f7f4; }
.gate-home .quorum i { width: 11px; height: 11px; border-radius: 50%; background: var(--yea); border: 2px solid #f4f0e6; box-shadow: 0 0 8px rgba(29, 184, 114, 0.85); }
.gate-home .board-body { display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-home .steps { padding: 18px 22px 10px; border-right: 2px solid var(--board-line); }
.gate-home .pane-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #c8efe9; }
.gate-home .step-row { display: grid; grid-template-columns: 30px 36px 1fr 20px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; background: var(--board-row); border: 1.5px solid var(--board-line); }
.gate-home .step-no { font-weight: 700; color: #e7f7f4; font-size: 15px; font-variant-numeric: tabular-nums; }
.gate-home .step-row .ic { font-size: 30px; color: #b7f0e8; }
.gate-home .step-row h3 { margin: 0; font-size: 18px; font-weight: 700; color: #fff; line-height: 1.2; }
.gate-home .step-row p { margin: 2px 0 0; font-size: 14px; color: var(--board-muted); line-height: 1.35; }
.gate-home .steps .step-row:nth-child(2) { --i: 0; }
.gate-home .steps .step-row:nth-child(3) { --i: 1; }
.gate-home .steps .step-row:nth-child(4) { --i: 2; }
.gate-home .steps .step-row:nth-child(5) { --i: 3; }
.gate-home .steps .step-row:nth-child(6) { --i: 4; }
.gate-home .lamp { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #f4f0e6; background: var(--yea); box-shadow: 0 0 10px 2px rgba(29, 184, 114, 0.55); animation: gate-lamp 0.55s ease backwards; animation-delay: calc(var(--i) * 0.55s + 0.25s); }
@keyframes gate-lamp { from { background: #3d6d72; box-shadow: none; } }
.gate-home .roll { padding: 18px 22px 22px; }
.gate-home .sample { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #f6d36a; border: 1.5px solid #f6d36a; border-radius: 999px; padding: 2px 8px; margin-left: 8px; white-space: nowrap; }
.gate-home .seats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.gate-home .seats .seat { background: var(--board-row); border: 1.5px solid var(--board-line); border-radius: 10px; padding: 8px 4px 9px; text-align: center; font-size: 11px; letter-spacing: 0.04em; color: #e7f7f4; font-variant-numeric: tabular-nums; font-weight: 600; }
.gate-home .seats .seat:nth-child(1) i { --n: 0; }
.gate-home .seats .seat:nth-child(2) i { --n: 1; }
.gate-home .seats .seat:nth-child(3) i { --n: 2; }
.gate-home .seats .seat:nth-child(4) i { --n: 3; }
.gate-home .seats .seat:nth-child(5) i { --n: 4; }
.gate-home .seats .seat:nth-child(6) i { --n: 5; }
.gate-home .seats .seat:nth-child(7) i { --n: 6; }
.gate-home .seats .seat:nth-child(8) i { --n: 7; }
.gate-home .seats .seat:nth-child(9) i { --n: 8; }
.gate-home .seats .seat:nth-child(10) i { --n: 9; }
.gate-home .seats .seat:nth-child(11) i { --n: 10; }
.gate-home .seats .seat:nth-child(12) i { --n: 11; }
.gate-home .seats .seat:nth-child(13) i { --n: 12; }
.gate-home .seats .seat:nth-child(14) i { --n: 13; }
.gate-home .seats .seat:nth-child(15) i { --n: 14; }
.gate-home .seats .seat:nth-child(16) i { --n: 15; }
.gate-home .seats .seat:nth-child(17) i { --n: 16; }
.gate-home .seats .seat:nth-child(18) i { --n: 17; }
.gate-home .seats .seat:nth-child(19) i { --n: 18; }
.gate-home .seats .seat:nth-child(20) i { --n: 19; }
.gate-home .seats .seat i { display: block; width: 15px; height: 15px; border-radius: 50%; margin: 6px auto 0; border: 2px solid #f4f0e6; background: #3d6d72; animation: gate-seat 0.45s ease forwards; animation-delay: calc(var(--n) * 0.07s + 1.1s); }
.gate-home .seats .seat .y { --c: var(--yea); }
.gate-home .seats .seat .n { --c: var(--nay); }
.gate-home .seats .seat .p { --c: var(--pres); }
@keyframes gate-seat { to { background: var(--c); box-shadow: 0 0 8px 1px var(--c); } }
.gate-home .tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.gate-home .tally div { background: var(--board-2); border: 1.5px solid var(--board-line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.gate-home .tally span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: #c8efe9; }
.gate-home .tally b { display: block; font-size: 42px; line-height: 1.05; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.gate-home .tally .y b { color: #3ee89a; }
.gate-home .tally .n b { color: #ff7a6e; }
.gate-home .tally .p b { color: #ffd056; }
.gate-home .vb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gate-home .vb button { border: 0; border-radius: 999px; padding: 11px 8px; font: inherit; font-weight: 700; color: #fff; min-height: 44px; cursor: default; letter-spacing: 0.02em; }
.gate-home .vb .y { background: #15965c; }
.gate-home .vb .n { background: #d13c32; }
.gate-home .vb .p { background: #c49214; }
.gate-home .board-note { margin: 0; padding: 10px 22px 14px; font-size: 13px; color: var(--board-muted); border-top: 2px solid var(--board-line); }
@media (max-width: 860px) {
  .gate-home .masthead { padding: 18px 20px 16px; }
  .gate-home .colophon { padding: 16px 20px; align-items: flex-start; }
  .gate-home .dek { font-size: 17px; }
  .gate-home .stage { width: calc(100% - 32px); grid-template-columns: 1fr 1fr; grid-template-areas: "intro intro" "fl fr" "board board" "gate gate"; gap: 16px 14px; }
  .gate-home .intro { padding: 24px 0 4px; }
  .gate-home .board-body { grid-template-columns: 1fr; }
  .gate-home .steps { border-right: 0; border-bottom: 2px solid var(--board-line); }
  .gate-home .flank { padding: 8px 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
  .gate-home .flank-inner { max-width: none; }
  .gate-home .gate-wrap { margin: 8px auto 36px; }
}
@media (max-width: 520px) {
  .gate-home .dateline { letter-spacing: 0.06em; }
  .gate-home .board-head { padding: 12px 16px; }
  .gate-home .steps, .gate-home .roll { padding-left: 14px; padding-right: 14px; }
  .gate-home .step-row { grid-template-columns: 24px 30px 1fr 16px; gap: 10px; padding: 11px 10px; }
  .gate-home .step-row .ic { font-size: 26px; }
  .gate-home .seats { gap: 6px; }
  .gate-home .tally b { font-size: 34px; }
  .gate-home .board-note { padding: 10px 14px 14px; }
  .gate-home .sample { margin-left: 0; display: inline-block; margin-top: 6px; }
  .gate-home .flank-label { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-home .lamp, .gate-home .seats .seat i { animation: none !important; }
  .gate-home .seats .seat i.y { background: var(--yea); box-shadow: 0 0 8px 1px var(--yea); }
  .gate-home .seats .seat i.n { background: var(--nay); box-shadow: 0 0 8px 1px var(--nay); }
  .gate-home .seats .seat i.p { background: var(--pres); box-shadow: 0 0 8px 1px var(--pres); }
}
.gate-home .start-wrap { width: min(720px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; flex: 1; }
.gate-home .start-wrap .intro { padding: 8px 0 18px; }
.gate-home .start-wrap .headline { font-size: clamp(30px, 4vw, 44px); }
.gate-home .choices { display: grid; gap: 14px; margin-top: 20px; }
.gate-home .choice-block { display: grid; gap: 8px; }
.gate-home .mod-signin { margin: 0; text-align: center; font-size: 15px; }
.gate-home .mod-signin a { font-weight: 700; }
.gate-home .choice-card { display: flex; flex-direction: column; justify-content: center; min-height: 96px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px; text-decoration: none; color: inherit; }
.gate-home .choice-card h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.02em; color: var(--navy); }
.gate-home .choice-card p { margin: 0; color: var(--muted); font-size: 16px; }
.gate-home .choice-card:hover { border-color: var(--teal); color: inherit; }
.gate-home .choice-card:focus-visible { outline: 3px solid rgba(15, 118, 104, 0.4); outline-offset: 2px; }
.gate-home .start-wrap .gate { margin-top: 8px; }
.gate-home .start-wrap .gate label { margin-top: 14px; }
.gate-home .start-wrap .gate .headline { font-size: clamp(28px, 4vw, 36px); margin-bottom: 10px; }
.gate-home .start-wrap select { width: 100%; border: 1px solid #d9d0c2; background: #fff; border-radius: 12px; padding: 12px 14px; font: inherit; color: var(--ink); margin-bottom: 8px; }
.gate-home .roster-pick { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 14px; padding: 12px 14px; }
.gate-home .roster-pick legend { font-weight: 700; padding: 0 6px; }
.gate-home .roster-name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; margin: 0; }
.gate-home .roster-name input { width: 1.15rem; height: 1.15rem; }
@media (max-width: 520px) {
  .gate-home .choice-card { padding: 18px 16px; }
  .gate-home .start-wrap { width: calc(100% - 32px); }
}
