:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --ink: #1c2430;
  --muted: #5c6b7a;
  --brand: #0f4c81;
  --brand-ink: #fff;
  --card: #fff;
  --line: #d5dde6;
  --danger: #8d1d2c;
  --ok: #0f6b45;
}

body[data-theme="slate"] {
  color-scheme: dark;
  --bg: #0f1720;
  --ink: #e7eef6;
  --muted: #a9b8c7;
  --brand: #8eb8e5;
  --brand-ink: #102033;
  --card: #182430;
  --line: #2c3e50;
  --danger: #ffb4b4;
  --ok: #9ddeb8;
}

body[data-theme="forest"] {
  --bg: #f3f6f2;
  --ink: #1d2a22;
  --muted: #5d6f64;
  --brand: #1f6b45;
  --brand-ink: #fff;
  --card: #fff;
  --line: #d5e0d8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--brand); }
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-user { font-size: 0.8rem; font-weight: 450; color: var(--muted); }

.brand img { height: 36px; width: auto; }
.logo-preview { max-height: 72px; width: auto; }
.profile-photo { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.group-who { display: grid; grid-template-columns: 168px 1fr; gap: 1.5rem; align-items: end; margin: 0.5rem 0 1.5rem; }
.group-who img { width: 168px; height: 168px; object-fit: cover; border-radius: 8px; display: block; }
.group-who h1 { font-size: 2.6rem; font-weight: 500; line-height: 1; margin: 0; }
.group-facts dl { margin: 0; }
.group-facts dl div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.group-facts dt { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.group-facts dd { margin: 0; }
.group-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.group-photos figure { margin: 0; width: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0; overflow: hidden; }
.group-photos img { width: 100%; height: 220px; object-fit: cover; display: block; }
.group-photos figcaption, .group-docs li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.7rem; }
.group-docs { list-style: none; padding: 0; margin: 0; }
.group-docs li { border-top: 1px solid var(--line); }
@media (max-width: 680px) {
  .group-who, .group-photos, .group-facts dl div { grid-template-columns: 1fr; }
  .group-who h1 { font-size: 2rem; }
}
.member-profile { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.member-profile .side img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; display: block; }
.member-profile h1 { font-size: 1.8rem; margin: 0.8rem 0 0.2rem; }
.member-profile .member-main { min-width: 0; }
.member-profile .card h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.7rem; }
.member-profile dl { margin: 0; display: grid; gap: 0.75rem; }
.member-profile dt { font-size: 0.78rem; color: var(--muted); }
.member-profile dd { margin: 0; min-width: 0; }
.member-profile .member-bio { overflow-wrap: anywhere; }
.member-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.member-photos figure { margin: 0; width: auto; background: transparent; border: 0; padding: 0; }
.member-photos img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }
.member-photos figcaption, .member-docs li { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }
.member-photos figcaption { margin-top: 0.3rem; }
.member-docs { list-style: none; padding: 0; margin: 0; }
.member-docs li { padding: 0.7rem 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .member-profile, .member-photos { grid-template-columns: 1fr; }
}
.gallery { display: flex; flex-wrap: wrap; gap: 1rem; }
.gallery figure { margin: 0; width: 180px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; }
.gallery img { width: 160px; height: 120px; object-fit: cover; background: var(--line); display: block; }
.gallery figcaption { display: grid; gap: 0.2rem; margin-top: 0.4rem; }
.gallery.manage figure { width: 240px; }
.gallery.manage img, .gallery.manage .file-type { width: 100%; }
.file-type { width: 160px; height: 120px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.file-type span { border: 2px solid var(--brand); border-radius: 4px; padding: 0.35rem 0.5rem; background: var(--card); color: var(--brand); font-weight: 700; letter-spacing: 0.04em; }
.file-actions { display: grid; gap: 0.35rem; }
.file-actions input[type=text] { width: 100%; }
.file-actions button { margin-top: 0.25rem; }
.file-flag { display: inline-block; font-size: 0.75rem; line-height: 1.4; border: 1px solid var(--line); border-radius: 999px; padding: 0 0.45rem; }
.warn { color: var(--danger); }
button.as-link { margin: 0; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; cursor: pointer; text-align: inherit; }
button.as-link:hover { text-decoration: underline; }
dialog.member-card { width: min(46rem, 94vw); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; }
dialog.member-card::backdrop { background: rgba(0, 0, 0, 0.4); }
.member-card-files { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.member-card-files a { width: 120px; display: grid; gap: 0.25rem; color: inherit; text-decoration: none; }
.member-card-files img, .member-card-files .file-type { width: 120px; height: 90px; }
.drop { border: 1px dashed var(--line); border-radius: 8px; padding: 0.75rem; max-width: 32rem; }
.drop.over { background: var(--card); }

nav, .subnav { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.menu-pop { position: relative; }
.mail-link, .menu-mail .panel a { position: relative; }
.mail-link { display: inline-flex; align-items: center; gap: 0.35rem; }
.mail-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #e53935; flex: none; }
.mail-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.15rem; height: 1.15rem; margin-left: 0.35rem; padding: 0 0.3rem; border-radius: 999px; background: #e53935; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.menu-pop > .panel { display: none; position: absolute; z-index: 2; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; min-width: 10rem; }
.menu-pop:hover > .panel, .menu-pop:focus-within > .panel { display: grid; gap: 0.35rem; }
.menu-pop > .panel .menu-pop > .panel { left: 100%; top: 0; }
nav.primary a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; }
.actions button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.cal-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
}
.cal-toolbar .cal-tools,
.cal-toolbar .cal-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.cal-toolbar .cal-tools { justify-self: start; }
.cal-toolbar .cal-nav { justify-self: end; }
.cal-period { margin: 0; justify-self: center; text-align: center; font-size: 1.2rem; white-space: nowrap; }
.cal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}
.cal-icon svg { width: 1.15rem; height: 1.15rem; display: block; fill: currentColor; }
.social-icon { width: 1.05rem; height: 1.05rem; vertical-align: -0.18rem; margin-right: 0.28rem; fill: currentColor; }
.cal-icon[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
@media (max-width: 720px) {
  .cal-toolbar { grid-template-columns: 1fr; justify-items: center; }
  .cal-period { order: -1; white-space: normal; }
  .cal-toolbar .cal-tools, .cal-toolbar .cal-nav { justify-self: center; }
}
.cal-scroll, .table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 36rem; }
.cal-grid { display: grid; gap: 2px; min-width: 36rem; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-head div { font-size: 0.8rem; color: var(--muted); padding: 0.2rem; }
.cal-day { min-height: 4.5rem; border: 1px solid var(--line); border-radius: 6px; padding: 0.2rem; background: var(--card); }
.cal-day.outside { opacity: 0.55; }
.cal-day.today { outline: 2px solid var(--brand); }
.cal-num { display: block; font-size: 0.8rem; }
.cal-event { display: block; width: 100%; margin-top: 0.15rem; text-align: left; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dialog { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; max-width: 32rem; }
.cal-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.menu-toggle { display: none; }
.group-switch { display: flex; align-items: center; gap: 0.4rem; }
.group-switch label { margin: 0; font-size: 0.85rem; color: var(--muted); }
.group-switch select { width: auto; min-width: 10rem; margin: 0; }
body.menu-side nav.primary { flex-direction: column; align-items: flex-start; }
body.menu-side .group-switch { flex-direction: column; align-items: stretch; width: 100%; }
body.menu-side .group-switch select { width: 100%; }
@media (min-width: 768px) {
  /* Left menu: the top bar keeps the logo, site name and user name; the menu sits below it on the left with the page beside it. */
  body.menu-side .page-body { display: grid; grid-template-columns: 14rem 1fr; align-items: start; }
  body.menu-side .page-body > nav.primary { position: sticky; top: 0; padding: 1rem 1.25rem; gap: 0.55rem; }
  body.menu-side .page-main { min-width: 0; }
  body.menu-side .menu-pop > .panel { left: 100%; top: 0; }
}
@media (max-width: 767px) {
  .menu-pop > .panel, .menu-pop > .panel .menu-pop > .panel { position: static; }
  /* The Classes submenu has no hover on a phone, so show it once the menu is open. */
  nav.primary.open .menu-pop > .panel[aria-label="Classes"] { display: grid; gap: 0.35rem; }
  .menu-toggle { display: inline-block; }
  nav.primary { display: none; width: 100%; }
  nav.primary.open { display: flex; flex-direction: column; align-items: flex-start; }
  body.menu-side .page-body > nav.primary { padding: 0.75rem 1.25rem; }
}
nav form { margin: 0; }

main { max-width: 960px; margin: 0 auto; padding: 1.25rem; }

.landing-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 0.5rem; }
.site-footer { max-width: 960px; margin: 0 auto; padding: 0 1.25rem 2rem; color: var(--muted); }
.check { display: flex; gap: 0.4rem; align-items: flex-start; margin-top: 0.8rem; }
.landing-links .button { margin-top: 0; }

h1 { font-size: 1.6rem; margin: 0 0 0.75rem; }

.card, form.card, .stack > * {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.stack { display: grid; gap: 1rem; }
.site-account-list { display: grid; gap: 0.75rem; max-height: 28rem; overflow: auto; margin-top: 0.5rem; }
.site-account-row { padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.site-account-row p { margin: 0.15rem 0; }
.site-account-row .check { margin-top: 0.35rem; }

label { display: block; font-weight: 600; margin-top: 0.75rem; }
input, select, textarea {
  width: 100%;
  max-width: 32rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: inherit;
  font: inherit;
}
textarea { min-height: 6rem; }
input[type="checkbox"], input[type="radio"] { width: auto; max-width: none; margin: 0; }

label.check {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 400;
  text-align: left;
}

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td form { margin: 0; }
details.add-row { margin-top: 0.75rem; }
details.add-row > summary { cursor: pointer; width: fit-content; color: var(--brand); }
.bot-picker { max-height: 24rem; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.75rem; }
.bot-output { white-space: pre-wrap; margin: 0.25rem 0; }

button, .button {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button.quiet, .button.quiet { background: transparent; color: var(--brand); border: 1px solid var(--line); }

.password-line {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  max-width: 32rem;
}
.password-line input { flex: 1 1 auto; width: 1%; max-width: none; }
.password-line button { margin-top: 0; white-space: nowrap; }
.schedule-fields,
.schedule-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.4fr) minmax(9rem, 11rem) minmax(7.5rem, 9rem) minmax(7.5rem, 9rem) auto;
  gap: 0.5rem;
  align-items: center;
}
.schedule-fields { margin: 0.75rem 0 0.25rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.schedule-dates { display: grid; gap: 0.5rem; }
.schedule-row input { width: 100%; max-width: none; }
.schedule-row input[type="hidden"] { display: none; }
.schedule-row button { margin-top: 0; }
.class-dates { list-style: none; margin: 0.35rem 0; padding: 0; }
.class-dates li { margin: 0.15rem 0; }
.class-date-past { opacity: 0.72; }
@media (max-width: 720px) {
  .schedule-fields,
  .schedule-row { grid-template-columns: 1fr 1fr; }
  .schedule-fields span:first-child,
  .schedule-row input[type="text"] { grid-column: 1 / -1; }
  .schedule-row button { justify-self: end; }
}

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.errors, .flash { padding: 0.6rem 0.8rem; border-radius: 6px; }
.errors { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--card)); }
.validation-summary-valid, .field-validation-valid { display: none; }
.field-error { display: block; margin-top: 0.25rem; color: var(--danger); font-size: 0.92rem; }
.flash, .tenant { color: var(--ok); }
.tenant { margin: 0; padding: 0.4rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.row-actions form { display: inline; }
code { font-family: ui-monospace, monospace; }
.lesson-body { white-space: pre-wrap; }
.player { display: grid; grid-template-columns: 16rem 1fr; gap: 1rem; align-items: start; }
.lesson-nav { list-style: none; padding: 0; margin: 0; }
.lesson-nav li { margin: 0.35rem 0; }
@media (max-width: 768px) {
  .player { grid-template-columns: 1fr; }
}

.message-list li.message-item { cursor: pointer; }
.message-list li.message-item:hover, .message-list li.message-item:focus { background: rgba(0, 0, 0, 0.04); outline: none; }
.message-preview { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
dialog.message-dialog { max-width: min(42rem, 92vw); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; }
dialog.message-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog.message-dialog .message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-list li.message-item.unread { font-weight: 600; border-left: 3px solid var(--brand); padding-left: 0.5rem; }
.message-list li.message-item.unread .message-preview { font-weight: normal; }

/* Rich editor (Quill): its own light, high-contrast chrome so every theme (default, slate, forest, gold, etheric, custom CSS) shows the controls.
   The site's global button/select rules would otherwise paint Quill's tiny toolbar buttons with the theme colours. */
body .ql-toolbar.ql-snow { background: #f7f9fb; border: 1px solid #b8c4d0; border-radius: 6px 6px 0 0; color: #1c2430; max-width: none; }
body .ql-container.ql-snow { border: 1px solid #b8c4d0; border-top: 0; border-radius: 0 0 6px 6px; }
body .ql-snow.ql-toolbar button, body .ql-snow .ql-toolbar button {
  margin: 0; padding: 3px 5px; width: 28px; height: 24px; border: 0; border-radius: 4px;
  background: transparent; color: #1c2430; display: inline-block; float: left; line-height: 1;
}
body .ql-snow.ql-toolbar button:hover, body .ql-snow.ql-toolbar button:focus, body .ql-snow.ql-toolbar button.ql-active { background: #dde6ef; }
body .ql-snow .ql-stroke, body .ql-snow .ql-stroke-miter { stroke: #1c2430; }
body .ql-snow .ql-fill, body .ql-snow .ql-stroke.ql-fill { fill: #1c2430; }
body .ql-snow.ql-toolbar button:hover .ql-stroke, body .ql-snow.ql-toolbar button.ql-active .ql-stroke,
body .ql-snow .ql-picker-label:hover .ql-stroke, body .ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: #0f4c81; }
body .ql-snow.ql-toolbar button:hover .ql-fill, body .ql-snow.ql-toolbar button.ql-active .ql-fill,
body .ql-snow .ql-picker-label:hover .ql-fill, body .ql-snow .ql-picker-label.ql-active .ql-fill { fill: #0f4c81; }
body .ql-snow .ql-picker { color: #1c2430; }
body .ql-snow .ql-picker-label { color: #1c2430; background: transparent; border-color: transparent; }
body .ql-snow .ql-picker-label:hover, body .ql-snow .ql-picker-label.ql-active, body .ql-snow .ql-picker-item:hover, body .ql-snow .ql-picker-item.ql-selected { color: #0f4c81; }
body .ql-snow .ql-picker-options { background: #fff; color: #1c2430; border: 1px solid #b8c4d0; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
body .ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: #b8c4d0; color: #1c2430; }
body .ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { stroke: #1c2430; }
body .ql-snow .ql-tooltip { background: #fff; color: #1c2430; border-color: #b8c4d0; }
body .ql-snow .ql-tooltip input[type="text"] { width: 170px; max-width: none; padding: 3px 5px; background: #fff; color: #1c2430; border: 1px solid #b8c4d0; }
body .ql-snow .ql-tooltip a { color: #0f4c81; }
body .rich-editor, body .rich-editor .ql-editor { background: #fff; color: #111; }
body .rich-editor .ql-editor.ql-blank::before { color: #6b7785; }
body .rich-source { background: #fff !important; color: #111 !important; border: 1px solid #b8c4d0; max-width: none; }
body .rich-tabs button { margin-top: 0.25rem; }
body .rich-tabs button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* Vimeo lesson video */
.vimeo-field { border: 1px dashed currentColor; border-radius: 6px; padding: .6rem; margin: .5rem 0; }
.vimeo-chosen { display: flex; gap: .6rem; align-items: center; min-height: 2rem; }
.vimeo-chosen img { width: 120px; border-radius: 4px; }
.vimeo-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.vimeo-upload-btn { cursor: pointer; padding: .35rem .8rem; border: 1px solid currentColor; border-radius: 4px; }
.vimeo-field progress { width: 100%; }
.vimeo-picker { width: min(900px, 95vw); max-height: 85vh; }
.vimeo-picker-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.vimeo-picker-head input[type=search] { flex: 1; }
.vimeo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; overflow: auto; }
.vimeo-card { display: flex; flex-direction: column; gap: .25rem; text-align: left; padding: .4rem; }
.vimeo-card img, .vimeo-noimg { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #0002; display: flex; align-items: center; justify-content: center; }
.vimeo-player { position: relative; padding-top: 56.25%; margin: 1rem 0; }
.vimeo-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.vimeo-drop { border: 2px dashed currentColor; opacity: .7; border-radius: 6px; padding: .8rem; text-align: center; margin-bottom: .5rem; }
.vimeo-field.dragging { outline: 3px solid #4da3ff; background: #4da3ff22; }
.vimeo-field.dragging .vimeo-drop { opacity: 1; border-color: #4da3ff; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.build-stamp { font-size: 0.8rem; margin: 0.75rem 0 0; }
.build-stamp a, .build-stamp span { text-transform: none; letter-spacing: normal; font-size: inherit; font-weight: inherit; }
tr.changelog-current td { background: color-mix(in srgb, var(--brand) 22%, var(--card)); }
tr.changelog-current td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.changelog-notes p { margin: 0 0 0.35rem; }
.changelog-notes ul { margin: 0.15rem 0 0.35rem; padding-left: 1.15rem; }
.member-classes .chip { display: inline-flex; align-items: center; gap: .2rem; border: 1px solid currentColor; border-radius: 999px; padding: 0 .5rem; margin: 0 .2rem .2rem 0; font-size: .9em; }
form.inline { display: inline; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; }
.facts dt { font-weight: 600; }
.new-lesson { outline: 2px solid #4da3ff; }

.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Gold. Palette and type only: navy, gold, cream, white, Montserrat.
   #DAA243 is the button and highlight gold (navy text on it is 8.8:1).
   Small gold text on white or cream uses #8A5A10 so it stays above WCAG AA.
   Edges use #6E4A0C so buttons and fields stay above the 3:1 non-text bar. */
body[data-theme="gold"] {
  color-scheme: light;
  --bg: #fff;
  --ink: #00081A;
  --muted: #3d4a5c;
  --brand: #DAA243;
  --brand-ink: #00081A;
  --card: #F1ECE3;
  --line: #d9cfc2;
  --danger: #8d1d2c;
  --ok: #0f6b45;
  --gold-text: #8A5A10;
  --gold-edge: #6E4A0C;
  font-family: Montserrat, Poppins, "Segoe UI", sans-serif;
}

body[data-theme="gold"] main { padding: 2.75rem 1.5rem 3.5rem; }
body[data-theme="gold"] h1,
body[data-theme="gold"] h2,
body[data-theme="gold"] h3 {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
body[data-theme="gold"] h1 {
  font-size: 1.7rem;
  letter-spacing: 0.16em;
  margin: 0 0 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--brand);
}
body[data-theme="gold"] a { color: var(--gold-text); }
body[data-theme="gold"] a:hover { color: var(--ink); }
body[data-theme="gold"] .card,
body[data-theme="gold"] form.card,
body[data-theme="gold"] .stack > * {
  background: var(--card);
  border: 0;
  border-radius: 0;
  padding: 1.75rem 1.6rem 1.9rem;
}
body[data-theme="gold"] input,
body[data-theme="gold"] select,
body[data-theme="gold"] textarea {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--gold-edge);
  border-radius: 0;
}
body[data-theme="gold"] button,
body[data-theme="gold"] .button {
  background: var(--brand);
  color: var(--brand-ink);
  border: 2px solid var(--gold-edge);
  border-radius: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.8rem 1.3rem;
}
body[data-theme="gold"] button.quiet,
body[data-theme="gold"] .button.quiet {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--gold-edge);
  padding: 0.55rem 0.9rem;
}
body[data-theme="gold"] button.danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}
body[data-theme="gold"] button.as-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-text);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}
body[data-theme="gold"] a:focus,
body[data-theme="gold"] button:focus,
body[data-theme="gold"] input:focus,
body[data-theme="gold"] select:focus,
body[data-theme="gold"] textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

body[data-theme="gold"] .top {
  background: var(--ink);
  color: #F1ECE3;
  border-bottom: 3px solid var(--brand);
  padding: 1.05rem 1.75rem;
}
body[data-theme="gold"] .top a,
body[data-theme="gold"].menu-side .page-body > nav.primary a {
  color: #F1ECE3;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
}
body[data-theme="gold"] .top .brand {
  letter-spacing: 0.18em;
  font-weight: 600;
}
body[data-theme="gold"] .top .brand-user {
  color: var(--brand);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.8rem;
  font-weight: 500;
}
body[data-theme="gold"] .top a:hover,
body[data-theme="gold"] .top a:focus,
body[data-theme="gold"].menu-side .page-body > nav.primary a:hover,
body[data-theme="gold"].menu-side .page-body > nav.primary a:focus {
  color: var(--brand);
}
body[data-theme="gold"] .top .group-switch label,
body[data-theme="gold"].menu-side nav.primary .group-switch label {
  color: #F1ECE3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
body[data-theme="gold"] .top a:focus,
body[data-theme="gold"] .top button:focus,
body[data-theme="gold"] .top select:focus,
body[data-theme="gold"].menu-side nav.primary a:focus,
body[data-theme="gold"] .site-footer a:focus {
  outline-color: var(--brand);
}
body[data-theme="gold"].menu-side .page-body > nav.primary {
  background: var(--ink);
  color: #F1ECE3;
}
body[data-theme="gold"] .menu-pop > .panel {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 0;
  padding: 0.85rem 1rem;
}
body[data-theme="gold"] .top .menu-pop > .panel a,
body[data-theme="gold"].menu-side .page-body > nav.primary .menu-pop > .panel a {
  color: var(--ink);
  font-size: 0.72rem;
}
body[data-theme="gold"] .top .menu-pop > .panel a:hover,
body[data-theme="gold"] .top .menu-pop > .panel a:focus,
body[data-theme="gold"].menu-side .page-body > nav.primary .menu-pop > .panel a:hover,
body[data-theme="gold"].menu-side .page-body > nav.primary .menu-pop > .panel a:focus {
  color: var(--gold-text);
  outline-color: var(--ink);
}
body[data-theme="gold"] .top nav.primary a[aria-current="page"],
body[data-theme="gold"].menu-side .page-body > nav.primary a[aria-current="page"] {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
body[data-theme="gold"] .top .menu-pop > .panel a[aria-current="page"],
body[data-theme="gold"].menu-side .page-body > nav.primary .menu-pop > .panel a[aria-current="page"] {
  color: var(--gold-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
body[data-theme="gold"] .subnav a {
  color: var(--ink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
body[data-theme="gold"] .subnav a:hover { color: var(--gold-text); }

body[data-theme="gold"] .page-main { display: flex; flex-direction: column; min-height: calc(100vh - 5rem); }
body[data-theme="gold"] main { flex: 1 0 auto; }
body[data-theme="gold"] .site-footer {
  flex: none;
  max-width: none;
  margin: 0;
  background: var(--ink);
  color: #F1ECE3;
  border-top: 3px solid var(--brand);
  padding: 2.75rem 1.75rem 3rem;
}
body[data-theme="gold"] .site-footer a {
  color: var(--brand);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
body[data-theme="gold"] .site-footer a:hover { color: #fff; }
body[data-theme="gold"] .site-footer .build-stamp a {
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
}

body[data-theme="gold"] .cal-day { background: #fff; }
body[data-theme="gold"] .cal-day.today { outline: 2px solid var(--gold-edge); }
body[data-theme="gold"] a.cal-icon {
  color: var(--ink);
  background: #fff;
  border-color: var(--gold-edge);
  text-decoration: none;
  letter-spacing: normal;
  text-transform: none;
}
body[data-theme="gold"] a.cal-icon[aria-current="page"] {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--gold-edge);
}
body[data-theme="gold"] button.cal-event {
  margin-top: 0.15rem;
  padding: 0.12rem 0.35rem;
  background: var(--brand);
  color: var(--brand-ink);
  border: 1px solid var(--gold-edge);
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: left;
  line-height: 1.3;
}
body[data-theme="gold"] .message-list li.message-item.unread { border-left-color: var(--gold-edge); }
body[data-theme="gold"] .cal-period { letter-spacing: 0.08em; }

/* Etheric. Light mist, dusk lilac, and a pearl line. Type is Cormorant Garamond
   for titles and Source Sans 3 for text, both from the shared Google Fonts sheet.
   #2A2438 on #F6F4FB / #FBFAFE / #EDE8F6 is 13.7:1 / 14.4:1 / 12.4:1.
   Muted #655C78 on those same surfaces is 5.7:1 / 6.0:1 / 5.2:1.
   Links #5C4E8A on those surfaces, and on white, are 6.6:1 / 6.9:1 / 6.0:1 / 7.2:1.
   White on button #6E5EA6 is 5.5:1 (the suggested #7B6BB0 was 4.6:1 on white and
   4.4:1 on the card, under the small-text bar). White on hover #5A4A90 is 7.5:1.
   Header and footer text #F6F4FB on dusk #3E355C is 10.3:1. Pearl #E6D9C4 on that
   dusk is 8.1:1, used for the thin line, the signed-in name, and footer links.
   Input edge #746898 on #FBFAFE is 4.2:1, above the 3:1 non-text bar. */
body[data-theme="etheric"] {
  color-scheme: light;
  --bg: #F6F4FB;
  --ink: #2A2438;
  --muted: #655C78;
  --brand: #6E5EA6;
  --brand-ink: #fff;
  --card: #FBFAFE;
  --line: #D5CCE6;
  --danger: #8d1d2c;
  --ok: #0f6b45;
  --wash: #EDE8F6;
  --link: #5C4E8A;
  --dusk: #3E355C;
  --pearl: #E6D9C4;
  --edge: #746898;
  --brand-hover: #5A4A90;
  --shadow: 0 12px 32px rgba(62, 53, 92, 0.07);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.65;
}

body[data-theme="etheric"] main { padding: 2.75rem 1.5rem 3.25rem; }
body[data-theme="etheric"] h1,
body[data-theme="etheric"] h2,
body[data-theme="etheric"] h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
body[data-theme="etheric"] h1 {
  font-size: 2.5rem;
  margin: 0 0 1.35rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
body[data-theme="etheric"] h2 { font-size: 1.85rem; margin: 1.4rem 0 0.7rem; }
body[data-theme="etheric"] h3 { font-size: 1.45rem; }
body[data-theme="etheric"] .member-profile .card h2,
body[data-theme="etheric"] .group-facts dt {
  letter-spacing: 0.16em;
}
body[data-theme="etheric"] a { color: var(--link); }
body[data-theme="etheric"] a:hover { color: var(--ink); }
body[data-theme="etheric"] .card,
body[data-theme="etheric"] form.card,
body[data-theme="etheric"] .stack > * {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.55rem 1.55rem;
  box-shadow: var(--shadow);
}
body[data-theme="etheric"] .stack { gap: 1.25rem; }
body[data-theme="etheric"] label { font-weight: 600; letter-spacing: 0.01em; }
body[data-theme="etheric"] input,
body[data-theme="etheric"] select,
body[data-theme="etheric"] textarea {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
body[data-theme="etheric"] button,
body[data-theme="etheric"] .button {
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  border-radius: 999px;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  box-shadow: 0 6px 16px rgba(110, 94, 166, 0.18);
}
body[data-theme="etheric"] button:hover,
body[data-theme="etheric"] .button:hover {
  background: var(--brand-hover);
  color: #fff;
}
body[data-theme="etheric"] button.quiet,
body[data-theme="etheric"] .button.quiet {
  background: transparent;
  color: var(--link);
  border: 1px solid var(--edge);
  box-shadow: none;
}
body[data-theme="etheric"] button.quiet:hover,
body[data-theme="etheric"] .button.quiet:hover {
  background: var(--wash);
  color: var(--link);
}
body[data-theme="etheric"] button.danger,
body[data-theme="etheric"] button.danger:hover {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  box-shadow: none;
}
body[data-theme="etheric"] button.as-link {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--link);
  font-weight: inherit;
  letter-spacing: normal;
  box-shadow: none;
}
body[data-theme="etheric"] button.as-link:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
}
body[data-theme="etheric"] a:focus,
body[data-theme="etheric"] button:focus,
body[data-theme="etheric"] input:focus,
body[data-theme="etheric"] select:focus,
body[data-theme="etheric"] textarea:focus {
  outline: 2px solid var(--dusk);
  outline-offset: 2px;
}

body[data-theme="etheric"] .top {
  background: var(--dusk);
  color: #F6F4FB;
  border-bottom: 1px solid var(--pearl);
  padding: 1rem 1.75rem;
}
body[data-theme="etheric"] .top a,
body[data-theme="etheric"].menu-side .page-body > nav.primary a {
  color: #F6F4FB;
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 0.84rem;
  font-weight: 600;
}
body[data-theme="etheric"] .top .brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}
body[data-theme="etheric"] .top .brand-user {
  color: var(--pearl);
  letter-spacing: 0.04em;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
}
body[data-theme="etheric"] .top a:hover,
body[data-theme="etheric"] .top a:focus,
body[data-theme="etheric"].menu-side .page-body > nav.primary a:hover,
body[data-theme="etheric"].menu-side .page-body > nav.primary a:focus {
  color: var(--pearl);
}
body[data-theme="etheric"] .top .group-switch label,
body[data-theme="etheric"].menu-side nav.primary .group-switch label {
  color: #F6F4FB;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
}
body[data-theme="etheric"] .top .menu-toggle {
  background: transparent;
  color: #F6F4FB;
  border: 1px solid var(--pearl);
  box-shadow: none;
}
body[data-theme="etheric"] .top .menu-toggle:hover {
  background: transparent;
  color: var(--pearl);
}
body[data-theme="etheric"] .top a:focus,
body[data-theme="etheric"] .top button:focus,
body[data-theme="etheric"] .top select:focus,
body[data-theme="etheric"].menu-side nav.primary a:focus,
body[data-theme="etheric"] .site-footer a:focus {
  outline-color: var(--pearl);
}
body[data-theme="etheric"].menu-side .page-body > nav.primary {
  background: var(--dusk);
  color: #F6F4FB;
}
body[data-theme="etheric"] .menu-pop > .panel {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brand);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  min-width: 16.5rem;
  box-shadow: var(--shadow);
}
body[data-theme="etheric"] .top .menu-pop > .panel {
  right: 0;
  left: auto;
}
body[data-theme="etheric"] .top .menu-pop > .panel .menu-pop > .panel {
  left: 100%;
  right: auto;
}
body[data-theme="etheric"] .top .menu-pop > .panel a,
body[data-theme="etheric"].menu-side .page-body > nav.primary .menu-pop > .panel a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
body[data-theme="etheric"] .top .menu-pop > .panel a:hover,
body[data-theme="etheric"] .top .menu-pop > .panel a:focus,
body[data-theme="etheric"].menu-side .page-body > nav.primary .menu-pop > .panel a:hover,
body[data-theme="etheric"].menu-side .page-body > nav.primary .menu-pop > .panel a:focus {
  color: var(--link);
  outline-color: var(--dusk);
}
body[data-theme="etheric"] .top nav.primary a[aria-current="page"],
body[data-theme="etheric"].menu-side .page-body > nav.primary a[aria-current="page"] {
  color: var(--pearl);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
body[data-theme="etheric"] .top .menu-pop > .panel a[aria-current="page"],
body[data-theme="etheric"].menu-side .page-body > nav.primary .menu-pop > .panel a[aria-current="page"] {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
body[data-theme="etheric"] .subnav { gap: 0.45rem; margin: 0 0 1.15rem; }
body[data-theme="etheric"] .subnav a {
  color: var(--ink);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--wash);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}
body[data-theme="etheric"] .subnav a:hover,
body[data-theme="etheric"] .subnav a[aria-current="page"] {
  background: var(--brand);
  color: #fff;
}

body[data-theme="etheric"] .page-main { display: flex; flex-direction: column; min-height: calc(100vh - 5rem); }
body[data-theme="etheric"] main { flex: 1 0 auto; }
body[data-theme="etheric"] .site-footer {
  flex: none;
  max-width: none;
  margin: 0;
  background: var(--dusk);
  color: #F6F4FB;
  border-top: 1px solid var(--pearl);
  padding: 2.4rem 1.75rem 2.8rem;
}
body[data-theme="etheric"] .site-footer a {
  color: var(--pearl);
  letter-spacing: 0.08em;
  font-weight: 600;
  text-decoration: none;
}
body[data-theme="etheric"] .site-footer a:hover { color: #fff; }
body[data-theme="etheric"] .site-footer .build-stamp a {
  letter-spacing: normal;
  font-size: inherit;
}

body[data-theme="etheric"] table {
  background: var(--card);
  box-shadow: var(--shadow);
}
body[data-theme="etheric"] th {
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--wash);
}
body[data-theme="etheric"] dialog,
body[data-theme="etheric"] .cal-dialog,
body[data-theme="etheric"] dialog.member-card,
body[data-theme="etheric"] dialog.message-dialog {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(62, 53, 92, 0.16);
}
body[data-theme="etheric"] .message-list { list-style: none; padding: 0; }
body[data-theme="etheric"] .message-list li.message-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.65rem 0;
  box-shadow: var(--shadow);
}
body[data-theme="etheric"] .message-list li.message-item:hover,
body[data-theme="etheric"] .message-list li.message-item:focus {
  background: var(--wash);
}
body[data-theme="etheric"] .message-list li.message-item.unread {
  border-left: 3px solid var(--brand);
  padding-left: 0.85rem;
}
body[data-theme="etheric"] .cal-head div { letter-spacing: 0.12em; }
body[data-theme="etheric"] .cal-period {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-size: 1.7rem;
}
body[data-theme="etheric"] .cal-day {
  background: var(--card);
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(62, 53, 92, 0.05);
}
body[data-theme="etheric"] .cal-day.today { outline: 2px solid var(--link); }
body[data-theme="etheric"] a.cal-icon {
  color: var(--ink);
  background: #fff;
  border-color: var(--edge);
  border-radius: 12px;
  text-decoration: none;
  letter-spacing: normal;
}
body[data-theme="etheric"] a.cal-icon:hover { color: var(--link); }
body[data-theme="etheric"] a.cal-icon[aria-current="page"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
body[data-theme="etheric"] button.cal-event {
  margin-top: 0.15rem;
  padding: 0.12rem 0.4rem;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  line-height: 1.35;
  box-shadow: none;
}
body[data-theme="etheric"] button.cal-event:hover {
  background: var(--brand-hover);
  color: #fff;
}
body[data-theme="etheric"] .group-who h1,
body[data-theme="etheric"] .member-profile h1 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0.3rem;
}
body[data-theme="etheric"] .group-who h1 { font-size: 2.6rem; }
body[data-theme="etheric"] .top .muted,
body[data-theme="etheric"] .site-footer .muted,
body[data-theme="etheric"].menu-side nav.primary .muted {
  color: #E4DCEC;
}
body[data-theme="etheric"] .profile-photo,
body[data-theme="etheric"] .member-profile .side img,
body[data-theme="etheric"] .group-who img {
  border-radius: 18px;
}
body[data-theme="etheric"] .drop {
  border-radius: 16px;
  background: var(--wash);
}
.member-name { margin-right: .15em; }
.mod-label {
  display: inline-block;
  margin-left: .25em;
  padding: 0 .35em;
  border: 1px solid var(--line);
  border-radius: .7em;
  font-size: .72em;
  line-height: 1.5;
  vertical-align: middle;
  color: var(--ink);
  background: var(--card);
}
.badge-tip { position: relative; display: inline-block; vertical-align: middle; }
.badge-icon { width: 1.15em; height: 1.15em; vertical-align: text-bottom; margin-left: .15em; border-radius: 50%; }
.badge-preview { width: 32px; height: 32px; border-radius: 50%; vertical-align: middle; }
.badge-more { margin-left: .2em; font-size: .85em; }
.badge-tip-text {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + .25em);
  transform: translateX(-50%);
  z-index: 8;
  max-width: 16rem;
  white-space: normal;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: .35em;
  padding: .25em .45em;
  font-size: .75rem;
  line-height: 1.3;
}
.badge-tip:hover .badge-tip-text,
.badge-tip:focus .badge-tip-text,
.badge-tip:focus-within .badge-tip-text { display: block; }
