:root {
  color-scheme: dark;
  --bg: #0c0c0b;
  --panel: #171715;
  --raised: #20201c;
  --ink: #f6f2e8;
  --muted: #b7b2a7;
  --line: #38362f;
  --gold: #ecc77d;
  --gold-soft: #30291c;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font: 100%/1.5 var(--sans);
  background: var(--bg);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
p { color: var(--muted); line-height: 1.6; }
button, input, select, textarea { font: inherit; }
a { color: var(--gold); text-underline-offset: .2em; }
a:hover { color: #ffe3a8; }
button {
  min-height: 42px; border: 1px solid #49463c; border-radius: .45rem;
  padding: .48rem .86rem; background: var(--raised); color: var(--ink); cursor: pointer;
}
button:hover { border-color: #807053; background: #2b2922; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
label { display: block; margin: .95rem 0 .35rem; font-size: .93rem; font-weight: 600; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: .56rem .75rem;
  border: 1px solid #535044; border-radius: .45rem; color: var(--ink); background: #11110f;
}
textarea { min-height: 5.5rem; resize: vertical; }
::placeholder { color: #aaa598; }
.primary, .hero-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem; min-height: 43px;
  border: 1px solid #d3ad65; border-radius: .45rem; padding: .55rem 1rem;
  color: #21190d; background: var(--gold); font-size: .88rem; font-weight: 700; text-decoration: none;
}
.primary:hover, .hero-action:hover { color: #171109; background: #f9dba0; border-color: #f9dba0; }
.quiet { background: transparent; border-color: var(--line); color: #ded8cb; font-size: .84rem; }
.muted { color: var(--muted); font-size: .87rem; }
.shell { display: grid; grid-template-columns: clamp(190px, 16vw, 245px) minmax(0, 1fr); min-height: 100vh; }
aside {
  position: sticky; top: 0; height: 100vh; height: 100dvh; min-width: 0; overflow: auto;
  display: flex; flex-direction: column; padding: 2rem clamp(.9rem, 1.4vw, 1.65rem) 1.5rem;
  border-right: 1px solid var(--line); background: #11110f;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.brand, .login-brand {
  display: inline-flex; align-items: center; gap: .72rem;
  color: var(--ink); text-decoration: none; font: 500 1.55rem/1.05 var(--serif); letter-spacing: -.045em;
}
.brand img, .login-brand img { flex: none; border-radius: 50%; box-shadow: 0 0 0 1px #615237; }
.brand small { display: block; margin-top: .3rem; color: var(--muted); font: 500 .73rem/1.3 var(--sans); letter-spacing: .015em; }
#nav-toggle { display: none; }
#dashboard-nav { display: grid; gap: .35rem; margin-top: 2.8rem; }
#dashboard-nav button {
  position: relative; display: flex; align-items: center; gap: .66rem; min-height: 45px; min-width: 0;
  padding: .55rem .75rem; border: 1px solid transparent; border-radius: .44rem;
  background: transparent; color: #c8c3b8; font-size: .92rem; font-weight: 500; text-align: left;
}
#dashboard-nav button:hover { color: var(--ink); background: var(--raised); }
#dashboard-nav button.active { border-color: #53432b; background: #29241b; color: var(--gold); font-weight: 650; }
#dashboard-nav button.active::before { position: absolute; left: -1px; height: 42%; width: 2px; background: var(--gold); content: ""; }
.nav-symbol { flex: 0 0 1.2rem; text-align: center; font: 1.05rem/1.1 "Segoe UI Symbol", var(--sans); }
.aside-links { margin-top: auto; padding: 1.2rem .4rem 0; }
.aside-links a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 600; text-decoration: none; }
.aside-links small { color: var(--muted); font-size: .73rem; }
main { width: min(100%, 1550px); min-width: 0; margin-inline: auto; padding: clamp(1.75rem, 3.3vw, 3.6rem) clamp(1.3rem, 3.4vw, 4rem) 1.6rem; }
main > header { display: flex; align-items: center; justify-content: space-between; gap: .85rem; margin-bottom: 1.5rem; }
main > header > div { min-width: 0; }
#page-title { font-size: clamp(1.6rem, 2.3vw, 2.4rem); line-height: 1.16; font-weight: 620; letter-spacing: -.052em; }
#page-title:focus:not(:focus-visible) { outline: none; }
#subtitle { margin-top: .28rem; color: var(--muted); font-size: .9rem; }
main:has(#overview:not([hidden])) #subtitle { display: none; }
#logout { flex: none; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: clamp(14.3rem, 18.3vw, 19rem); padding: clamp(1.45rem, 3.3vw, 3.25rem);
  background: #050504; color: var(--ink); border: 1px solid #4b402b; border-radius: .9rem;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("/saturnus/saturn-gold.webp") right center / auto 117% no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0c0b09 0%, #0b0a08ef 23%, #0a09077a 49%, transparent 74%);
}
.hero-copy { min-width: 0; width: min(65%,47rem); }
.server-label {
  display: inline-flex; align-items: center; gap: .65rem; color: var(--gold);
  font-size: .68rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
}
.server-label::before { content: ""; width: 1.65rem; height: 1px; background: #b79754; }
.hero h2 { margin: .47rem 0 .32rem; font: 400 clamp(2.45rem, 4.3vw, 4.45rem)/1.03 var(--serif); letter-spacing: -.058em; }
.hero p { color: #dbd6ca; font-size: .9rem; }
.hero-action { margin-top: 1.1rem; }
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden;
  margin: 1.05rem 0 1.1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--panel);
}
.stat { min-width: 0; position: relative; padding: 1.15rem clamp(1rem, 1.7vw, 1.85rem); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: .82rem; font-weight: 550; overflow-wrap: anywhere; }
.stat strong { display: block; margin-top: .2rem; color: var(--ink); font: 400 clamp(1.8rem, 2.65vw, 2.55rem)/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.05rem; }
.card { min-width: 0; margin-bottom: 1.05rem; padding: clamp(1.1rem, 2vw, 1.85rem); background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; }
.card h2 { margin: 0 0 .7rem; font-size: clamp(1.08rem, 1.45vw, 1.36rem); font-weight: 600; line-height: 1.3; letter-spacing: -.035em; }
.card p { font-size: .92rem; }
.split > .card:first-child { display: flex; align-items: flex-start; flex-direction: column; }
.split > .card:first-child p { max-width: 41ch; }
.split > .card:first-child .primary { margin-top: auto; }
.split > .card:first-child p { margin-bottom: 1.15rem; }
.line { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; padding: .47rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; overflow-wrap: anywhere; }
.line:last-child { border-bottom: 0; }
.status { flex: none; padding: .15rem .5rem; background: #2c291c; color: #f0d49c; border: 1px solid #584a2d; border-radius: .35rem; font-size: .72rem; }
.status.off { color: #b9b4a7; background: #211f1b; border-color: #403d33; }
main > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .81rem; }
main > footer > span { font: 1.03rem var(--serif); }
main > footer a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; }
body[data-auth="signed-out"] .shell { display: block; min-height: 100svh; }
body[data-auth="signed-out"] aside, body[data-auth="signed-out"] main > header, body[data-auth="signed-out"] main > footer { display: none; }
body[data-auth="signed-out"] main { display: grid; place-items: center; min-height: 100svh; max-width: none; padding: 1rem; background: radial-gradient(ellipse at 50% 36%, #211c13, #0c0c0b 68%); }
#login { width: min(100%, 32rem); padding: clamp(1.35rem, 4vw, 2.7rem); background: var(--panel); border: 1px solid #524731; border-radius: .9rem; box-shadow: 0 1rem 4rem #0003; }
.login-brand { margin-bottom: 1.7rem; }
#login h1 { font: 400 clamp(2.2rem, 5vw, 3.3rem)/1.03 var(--serif); letter-spacing: -.055em; }
#login p { font-size: .95rem; margin-top: .75rem; }
#login .free-note { color: var(--gold); font-weight: 650; }
.login-action { margin: 1.05rem 0 .4rem; }
#login .login-fallback { border-top: 1px solid var(--line); padding-top: 1rem; font-size: .87rem; }
#login code { color: var(--ink); overflow-wrap: anywhere; }
.guide-link { display: inline-block; margin-top: .8rem; font-size: .88rem; }
@media (min-width: 1850px) {
  .shell { max-width: 1920px; margin-inline: auto; border-inline: 1px solid #292820; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 182px minmax(0, 1fr); }
  main { padding: 1.4rem; }
  .hero-copy { width: 70%; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  aside { position: static; height: auto; overflow: visible; padding: .72rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 1.32rem; gap: .58rem; }
  .brand img { width: 35px; height: 35px; }
  .brand small { font-size: .68rem; margin-top: .13rem; }
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; }
  .menu-mark { width: .86rem; height: .62rem; border-block: 1px solid currentColor; }
  #dashboard-nav { margin-top: .68rem; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .3rem; }
  aside:has(#nav-toggle[aria-expanded="false"]) #dashboard-nav { display: none; }
  .aside-links { display: none; }
  main { padding: 1.25rem 1rem; }
  main > header { margin-bottom: .9rem; }
  .hero { min-height: 13.5rem; }
  .stat { padding: .9rem .8rem; }
}
@media (max-width: 580px) {
  main { padding-inline: .9rem; }
  #page-title { font-size: 1.6rem; }
  .hero { align-items: flex-end; padding: 1.12rem; min-height: 13.25rem; }
  .hero::before { background-size: auto 92%; background-position: right -3rem top -1.1rem; }
  .hero::after { background: linear-gradient(90deg,#090906eb 0%,#090905a6 38%,transparent 85%), linear-gradient(0deg,#080806fa 0%,#080806a6 31%,transparent 70%); }
  .hero-copy { width: 100%; }
  .hero h2 { font-size: clamp(2.35rem, 9vw, 3.15rem); }
  .hero p { max-width: 31ch; line-height: 1.45; font-size: .81rem; }
  .hero-action { margin-top: .8rem; min-height: 44px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); margin: .75rem 0; }
  .stat { padding: .7rem .95rem; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .split { grid-template-columns: minmax(0,1fr); gap: 0; }
  .card { margin-bottom: .75rem; }
  #login .login-action { display: flex; width: 100%; }
}

/* The month grid switches to a day-by-day agenda when seven columns no longer
   leave enough room to read an event title. Every date stays available. */
.agenda-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}
.agenda-toolbar h2 {
  min-width: 9.5rem;
  margin: 0 .25rem;
  color: var(--ink);
  font: 500 clamp(1.35rem, 2.4vw, 1.85rem)/1.15 var(--serif);
  text-align: center;
}
#agenda-prev,
#agenda-next {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 0 .15rem;
  font-size: 1.4rem;
  line-height: 1;
}
#agenda-new { margin-inline-start: auto; }
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--line);
}
.agenda-grid:empty { display: none; }
.weekday {
  padding: .65rem .5rem;
  background: var(--raised);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}
.empty-day { background: var(--bg); }
.calendar-day {
  min-width: 0;
  min-height: clamp(5.5rem, 8vw, 7.5rem);
  padding: .28rem;
  background: var(--panel);
}
.day-number {
  min-width: 2rem;
  min-height: 2rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  padding: .2rem .35rem;
  background: transparent;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.day-number:hover { border-color: var(--line); background: var(--raised); }
.day-number[aria-current="date"] { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.calendar-event {
  display: block;
  width: 100%;
  min-height: 2rem;
  margin-top: .2rem;
  border: 0;
  border-inline-start: 2px solid var(--gold);
  border-radius: .18rem .35rem .35rem .18rem;
  padding: .32rem .45rem;
  background: var(--gold-soft);
  color: var(--gold);
  font: 600 .79rem/1.4 var(--sans);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.calendar-event:hover { background: #413721; }
.calendar-event[data-state="cancelled"] {
  border-inline-start-color: #b59489;
  background: #302622;
  color: #ddc7be;
  text-decoration: line-through;
}
.calendar-event[data-state="archived"] {
  border-inline-start-color: var(--muted);
  background: var(--raised);
  color: var(--muted);
}
.agenda-grid button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

#agenda-draft-section { margin-top: 1.25rem; }
#agenda-drafts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
}
#agenda-drafts button {
  max-width: 100%;
  min-height: 2.75rem;
  text-align: left;
  overflow-wrap: anywhere;
}
#agenda-editor {
  width: min(34rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #68604d;
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 1.8rem);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1.5rem 6rem #0009;
  color-scheme: dark;
}
#agenda-editor::backdrop { background: rgb(4 4 3 / 78%); }
#agenda-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .9rem;
}
#agenda-form > * { min-width: 0; grid-column: 1 / -1; }
#agenda-form > label:has(input[type="date"]),
#agenda-form > label:has(input[type="time"]) { grid-column: auto; }
#agenda-form h2 {
  margin: 0;
  font: 500 clamp(1.7rem, 3vw, 2.1rem)/1.15 var(--serif);
}
#agenda-form label { display: grid; gap: .35rem; margin: 0; }
#agenda-form :is(input, select, textarea) { min-width: 0; width: 100%; }
#agenda-form textarea { min-height: 5.5rem; resize: vertical; }
#agenda-zone {
  margin: -.35rem 0 .1rem;
  color: var(--muted);
  font-size: .85rem;
}
#agenda-roster {
  margin: .2rem 0 0;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
  color: var(--gold);
  font-weight: 650;
}
#agenda-people {
  max-height: 8rem;
  overflow: auto;
  margin: 0;
  padding-inline-start: 1.2rem;
  color: var(--muted);
  font-size: .92rem;
  overflow-wrap: anywhere;
}
#agenda-roster:empty,
#agenda-people:empty { display: none; }
#agenda-discord { width: fit-content; max-width: 100%; }
.agenda-actions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .95rem;
  border-top: 1px solid var(--line);
}
.agenda-actions button,
#agenda-confirm button { min-height: 2.75rem; margin: 0; }
#agenda-submit { margin-inline-start: auto; }
#agenda-cancel,
#agenda-confirm button[type="submit"] {
  border-color: #745247;
  background: #332622;
  color: #f0c1b2;
}
#agenda-cancel:hover,
#agenda-confirm button[type="submit"]:hover { background: #44312a; }
#agenda-confirm {
  border: 1px solid #745247;
  border-radius: .6rem;
  padding: .8rem;
  background: #251d1a;
}
#agenda-confirm p { margin: 0 0 .65rem; color: var(--ink); }

.section-intro { max-width: 62ch; margin: 0 0 1.2rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: .75rem;
}
.module-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-width: 0;
  min-height: 5.25rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .85rem 1rem;
  background: var(--panel);
}
.module-card > div { min-width: 0; }
.module-card h3,
.rule-card h3 {
  margin: 0;
  color: var(--ink);
  font: 650 1rem/1.35 var(--sans);
  overflow-wrap: anywhere;
}
.module-card small { color: var(--muted); font-size: .82rem; }
.module-card:has(.toggle[aria-checked="true"]) {
  border-color: #5d513b;
}
.module-card:has(.toggle[aria-checked="true"]) small { color: var(--gold); }
/* The visual track is smaller than the keyboard and touch target. */
.toggle {
  position: relative;
  flex: 0 0 3rem;
  width: 3rem;
  height: 2.75rem;
  border: 0;
  border-radius: .55rem;
  padding: 0;
  background: transparent;
}
.toggle::before,
.toggle::after {
  position: absolute;
  top: 50%;
  content: "";
  transform: translateY(-50%);
}
.toggle::before {
  inset-inline-start: .12rem;
  width: 2.72rem;
  height: 1.55rem;
  border: 1px solid #6e695d;
  border-radius: 99px;
  background: #36352f;
}
.toggle::after {
  inset-inline-start: .42rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--ink);
  transition: inset-inline-start .15s;
}
.toggle[aria-checked="true"]::before { border-color: var(--gold); background: var(--gold); }
.toggle[aria-checked="true"]::after { inset-inline-start: 1.55rem; background: #302718; }
.toggle:hover { background: transparent; }
.toggle:hover::before { border-color: var(--ink); }
.toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.toggle:disabled { cursor: wait; opacity: .65; }

.settings-card { max-width: 48rem; min-width: 0; }
.settings-card > label { display: block; margin: 1.1rem 0 .35rem; }
.settings-card :is(select, input, textarea) { display: block; width: 100%; min-width: 0; }
#action-select { text-overflow: ellipsis; }
#action-fields:not(:empty) {
  margin-top: 1.15rem;
  border-top: 1px solid var(--line);
  padding-top: .15rem;
}
#action-fields label { display: block; margin: 1.05rem 0 .35rem; }
#action-fields .help {
  display: block;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#action-fields textarea { min-height: 6rem; resize: vertical; }
#action-form > .primary { margin-top: 1.25rem; }

#rule-list,
#submissions {
  display: grid;
  gap: .75rem;
}
.rule-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: clamp(.95rem, 2vw, 1.3rem);
  background: var(--panel);
}
.rule-card p { margin: .5rem 0 0; overflow-wrap: anywhere; }
.rule-card > p.muted {
  width: fit-content;
  max-width: 100%;
  border-radius: .25rem;
  padding: .1rem .45rem;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: .8rem;
}
#submissions .rule-card > p:nth-child(2) { color: var(--muted); font-size: .85rem; }
#submissions .rule-card > p:nth-child(3) {
  margin-top: .8rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
#submissions .rule-card > p:nth-child(n+3) { white-space: pre-wrap; }
#rule-list > .muted,
#submissions > .muted {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: .6rem;
  padding: 1.1rem;
}

#moderation .table-wrap { min-width: 0; max-width: 100%; overflow: auto; }
#moderation table { width: 100%; border-collapse: collapse; text-align: left; }
#moderation th {
  border-bottom: 1px solid var(--line);
  padding: .6rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}
#moderation td {
  border-bottom: 1px solid var(--line);
  padding: .75rem .6rem;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.45;
  vertical-align: top;
  overflow-wrap: anywhere;
}
#moderation tr:last-child td { border-bottom: 0; }
#cases td:nth-child(1),
#cases td:nth-child(3) { font-variant-numeric: tabular-nums; }
#cases td:nth-child(5) { color: var(--gold); }
#cases td[colspan] { color: var(--muted); }
#toast {
  position: fixed;
  z-index: 10;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(31rem, calc(100vw - 2rem));
  max-height: 45vh;
  overflow: auto;
  border: 1px solid #645942;
  border-inline-start: 3px solid var(--gold);
  border-radius: .55rem;
  padding: .85rem 1rem;
  background: #29261f;
  color: var(--ink);
  box-shadow: 0 .4rem 1.8rem #0007;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .agenda-toolbar {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
  }
  .agenda-toolbar h2 { grid-column: 2 / 4; min-width: 0; }
  #agenda-today { grid-column: 1 / 3; }
  #agenda-next { grid-column: 4; }
  #agenda-new { grid-column: 3 / 5; grid-row: 2; margin: 0; }
  .agenda-grid { grid-template-columns: minmax(0, 1fr); }
  .weekday,
  .empty-day { display: none; }
  .calendar-day {
    display: grid;
    grid-template-columns: 2.65rem minmax(0, 1fr);
    align-content: center;
    align-items: start;
    gap: .1rem .65rem;
    min-height: 2.8rem;
    padding: .18rem .5rem;
  }
  .calendar-day:has(.calendar-event) { padding-block: .4rem; }
  .day-number { grid-column: 1; grid-row: 1; width: 2.65rem; min-height: 2.55rem; }
  .day-number::before { display: block; content: attr(data-weekday); color: var(--muted); font-size: .65rem; font-weight: 500; }
  .calendar-event { grid-column: 2; min-height: 2.55rem; margin: 0; font-size: .85rem; }
  .calendar-day > .calendar-event:nth-child(2) { grid-row: 1; }
}

@media (max-width: 550px) {
  /* Keep the column headers accessible while the values become a vertical row. */
  #moderation thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #moderation table,
  #cases,
  #cases tr { display: block; }
  #cases tr { border-top: 1px solid var(--line); padding: .6rem 0; }
  #cases td:not([colspan]) {
    display: grid;
    grid-template-columns: minmax(3.7rem, 23%) minmax(0, 1fr);
    gap: .6rem;
    border: 0;
    padding: .22rem 0;
  }
  #cases td:not([colspan])::before { color: var(--muted); font-size: .83rem; }
  #cases td:nth-child(1):not([colspan])::before { content: "Number"; }
  #cases td:nth-child(2)::before { content: "Action"; }
  #cases td:nth-child(3)::before { content: "Member"; }
  #cases td:nth-child(4)::before { content: "Reason"; }
  #cases td:nth-child(5)::before { content: "Status"; }
  #cases td[colspan] { display: block; padding: .45rem 0; border: 0; }
  #agenda-editor { width: calc(100% - 1rem); padding: 1rem; }
  .agenda-actions:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #agenda-submit { margin: 0; }
  #agenda-drafts { display: grid; }
  #agenda-drafts button { width: 100%; }
}
@media (max-width: 360px) {
  #agenda-form { grid-template-columns: minmax(0, 1fr); }
  .module-card { padding: .7rem .75rem; }
  #agenda-confirm button { display: block; width: 100%; margin-top: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .toggle::after { transition: none; }
}
@media (forced-colors: active) {
  .toggle::before,
  .toggle::after { forced-color-adjust: none; }
  .toggle::before { border-color: ButtonText; background: ButtonFace; }
  .toggle::after { background: ButtonText; }
  .toggle[aria-checked="true"]::before { border-color: Highlight; background: Highlight; }
  .toggle[aria-checked="true"]::after { background: HighlightText; }
}
