@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./icons/fonts/cormorant-garamond-regular-latin-ext-v1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./icons/fonts/cormorant-garamond-regular-latin-v1.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #1b1813;
  --ink-soft: #5e564b;
  --ink-faint: #847a6d;
  --plum: #1b1813;
  --plum-2: #3a342b;
  --purple: #8a6a47;
  --lavender: #ede5d6;
  --lilac: #d8c6ad;
  --yellow: #d8b67e;
  --yellow-soft: #f8eedc;
  --coral: #8d3c4a;
  --coral-soft: #f4e1e3;
  --mint: #d8e4d7;
  --mint-deep: #52725d;
  --sky: #e2e7e2;
  --canvas: #f4efe6;
  --paper: #fbf8f2;
  --line: #e0d7c2;
  --line-dark: #c9bfa7;
  --shadow: 0 14px 32px rgb(44 35 22 / 7%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", "EB Garamond", Garamond, Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgb(115 86 168 / 42%);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 254px;
  height: 100vh;
  padding: 30px 15px 18px;
  overflow-y: auto;
  color: #f5f1fb;
  background: var(--plum);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 34px;
  color: #fff;
  font-family: var(--serif);
  letter-spacing: .02em;
  font-size: 22px;
  font-weight: 400;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: var(--plum);
  background: var(--yellow);
}

.brand-mark svg { width: 19px; height: 19px; }
.brand-logo-surface { display: block; width: 100%; max-width: 260px; padding: 10px; border-radius: 8px; background: var(--canvas); isolation: isolate; }
.brand-logo { display: block; width: 100%; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.brand:has(.inemotion-mark) { margin-bottom: 26px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--canvas); box-shadow: 0 4px 12px rgb(0 0 0 / 12%); isolation: isolate; }
.brand-mark.inemotion-mark { display: flex; align-items: center; justify-content: center; flex: 0 0 31px; border-radius: 0; background: transparent; }
.inemotion-mark img { display: block; width: 31px; height: 44px; object-fit: contain; object-position: center; mix-blend-mode: multiply; }
.auth-brand:has(.brand-logo) { justify-content: center; }
.brand-logo-surface.is-transparent { background: transparent; }
.brand-logo-surface.is-transparent .brand-logo { mix-blend-mode: normal; }

.studio-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 22px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 14px;
  color: #f9f7fc;
  background: rgb(255 255 255 / 6%);
}

.studio-avatar, .avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
}

.studio-avatar { width: 31px; height: 31px; color: var(--plum); background: var(--yellow); }

.studio-pill strong, .studio-pill span { display: block; }
.studio-pill strong { font-size: 12px; line-height: 1.2; }
.studio-pill span { margin-top: 2px; color: #cfc6dc; font-size: 10px; }

.nav-group { display: grid; gap: 4px; }
.portal-context-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.portal-context-switch .button { min-height: 44px; }
.portal-context-switch [aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

.nav-caption {
  margin: 0 12px 8px;
  color: #a99db8;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  position: relative;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  color: #d9d2e2;
  background: transparent;
  text-align: left;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.is-more-mobile { display: none; }

.nav-item:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.nav-item.is-active { color: #fff; background: #3a342b; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-item-label { font-size: 13px; font-weight: 600; }

.nav-badge {
  min-width: 19px;
  height: 19px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 10px;
  color: var(--plum);
  background: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}

.sidebar-spacer { flex: 1 1 auto; min-height: 26px; }

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 18px 6px 12px;
  padding: 3px;
  border-radius: 10px;
  background: rgb(255 255 255 / 10%);
}

.mode-switch button {
  border: 0;
  border-radius: 8px;
  padding: 7px 4px;
  color: #cfc6dc;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}
.mode-switch button.is-active { color: var(--plum); background: var(--yellow); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-top: 1px solid rgb(255 255 255 / 12%);
}
.user-card .avatar { width: 31px; height: 31px; color: #1b1813; background: #a6845f; }
.user-card strong, .user-card > div > span { display: block; }
.user-card strong { color: #fff; font-size: 12px; }
.user-card span { color: #bdb2ca; font-size: 10px; }
.user-card .more-button { margin-left: auto; color: #d8cfe3; }

/* Keep absolute form labels inside the workspace scroll container. */
.workspace { position: relative; min-width: 0; padding: 25px 32px 40px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto 27px;
}

.breadcrumb { color: var(--ink-faint); font-size: 12px; font-weight: 650; }
.breadcrumb span { padding: 0 7px; color: #b5afba; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-button {
  display: grid;
  position: relative;
  width: 37px;
  height: 37px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--paper);
  transition: border .16s ease, transform .16s ease;
}
.icon-button:hover { border-color: var(--lilac); transform: translateY(-1px); }
.icon-button svg { width: 18px; height: 18px; }
.notification-dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border: 1px solid var(--paper); border-radius: 50%; background: var(--coral); }

.view { max-width: 1540px; margin: 0 auto; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-intro h1 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(32px, 3.2vw, 44px); font-weight: 400; letter-spacing: -.025em; line-height: .98; }
.page-intro p:not(.eyebrow) { max-width: 530px; margin: 9px 0 0; color: var(--ink-soft); font-size: 14px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--plum); box-shadow: 0 7px 15px rgb(49 36 67 / 15%); }
.button-primary:hover { background: var(--plum-2); }
.button-yellow { color: var(--plum); background: var(--yellow); }
.button-secondary { border-color: var(--line-dark); color: var(--ink); background: var(--paper); }
.button-quiet { color: #765831; background: #f4ead8; }
.button-danger { color: #b1483d; background: var(--coral-soft); }
.button-small { min-height: 31px; padding: 0 10px; border-radius: 9px; font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(285px, .75fr); gap: 20px; }
.dashboard-main { display: grid; gap: 20px; }
.dashboard-side { display: grid; align-content: start; gap: 20px; }

.welcome-card {
  position: relative;
  min-height: 192px;
  overflow: hidden;
  padding: 28px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(127deg, #29231d, #5c1f2c 74%);
}
.welcome-card::after, .welcome-card::before { position: absolute; border-radius: 50%; content: ""; pointer-events: none; }
.welcome-card::before { top: -99px; right: 24px; width: 244px; height: 244px; border: 34px solid rgb(247 202 101 / 18%); }
.welcome-card::after { right: -29px; bottom: -68px; width: 185px; height: 185px; border: 1px solid rgb(255 255 255 / 14%); }
.welcome-card .eyebrow { position: relative; color: #e3c291; }
.welcome-card h2 { position: relative; z-index: 1; max-width: 465px; margin: 0; font-family: var(--serif); font-size: clamp(28px, 3vw, 39px); font-weight: 400; letter-spacing: -.025em; line-height: .98; }
.welcome-card p:not(.eyebrow) { position: relative; z-index: 1; max-width: 500px; margin: 12px 0 0; color: #e3dae9; font-size: 13px; }
.welcome-card .button { position: relative; z-index: 1; margin-top: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.stat-card { min-height: 127px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow); }
.stat-card .stat-icon { display: grid; width: 31px; height: 31px; margin-bottom: 13px; place-items: center; border-radius: 10px; }
.stat-card .stat-icon svg { width: 16px; height: 16px; }
.stat-icon.yellow { color: #90620f; background: var(--yellow-soft); }
.stat-icon.coral { color: #bd5146; background: var(--coral-soft); }
.stat-icon.mint { color: #317561; background: #e4f5ef; }
.stat-value { margin: 0; font-size: 25px; font-weight: 760; letter-spacing: -.045em; line-height: 1; }
.stat-label { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; font-weight: 600; }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 21px 15px; }
.panel-header h2, .panel-header h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: -.015em; }
.panel-header .subtle-link { padding: 4px 0; border: 0; color: var(--purple); background: transparent; font-size: 11px; font-weight: 750; }
.panel-header p { margin: 3px 0 0; color: var(--ink-faint); font-size: 11px; }

.agenda-list { padding: 0 21px 11px; }
.agenda-row { display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.agenda-row:first-child { border-top: 0; }
.agenda-row[type="button"] { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; color: inherit; background: transparent; text-align: left; }
.agenda-row[type="button"]:hover { background: #f7f0e5; }
.agenda-time { color: var(--ink); font-size: 12px; font-weight: 780; white-space: nowrap; }
.agenda-time span { display: block; margin-top: 1px; color: var(--ink-faint); font-size: 10px; font-weight: 550; }
.agenda-main strong, .agenda-main span { display: block; }
.agenda-main strong { font-size: 12px; line-height: 1.25; }
.agenda-main span { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.course-dot { display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0; border-radius: 50%; }
.agenda-count { min-width: 32px; padding: 5px 8px; border-radius: 8px; color: var(--ink-soft); background: #f2eff4; font-size: 10px; font-weight: 700; text-align: center; }
.agenda-row > svg { width: 16px; height: 16px; color: var(--ink-faint); }
.today-agenda .agenda-row { grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) auto auto; }
.today-agenda .agenda-main { min-width: 0; overflow-wrap: anywhere; }
.today-agenda .agenda-event-link { width: 100%; padding: 0; border: 0; border-radius: 4px; color: inherit; background: transparent; text-align: left; }
.today-agenda .agenda-event-link:hover strong { text-decoration: underline; }
.today-agenda .agenda-count { grid-column: 4; }
.today-course-cancel { min-height: 36px; padding: 7px 10px; white-space: nowrap; }
.agenda-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 230px; }
.agenda-actions .button { min-height: 36px; }
.course-attendance-action { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.course-participant-list { margin: 0; padding: 0; list-style: none; }
.course-participant-list > li + li { border-top: 1px solid var(--line); }
.course-participant-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 12px; width: 100%; padding: 14px 4px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; }
.course-participant-row:hover { background: var(--canvas); }
.course-participant-row > svg { width: 18px; height: 18px; color: var(--ink-soft); }
.course-participant-copy strong, .course-participant-copy small { display: block; overflow-wrap: anywhere; }
.course-participant-copy strong { font-size: 14px; }
.course-participant-copy small { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.course-participant-copy .status-pill { margin-top: 6px; }
.attendance-export-link { padding: 14px 21px 20px; }
.view > .attendance-export-link { padding: 0 0 20px; }
.attendance-modal { width: min(100%, 900px); }
.attendance-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.attendance-summary { margin: 18px 0 7px; font-weight: 750; }
.attendance-help { color: var(--ink-soft); font-size: 12px; }
.attendance-roster { list-style: none; margin: 15px 0 0; padding: 0; }
.attendance-roster-header, .attendance-student { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(320px, 2fr) 155px; align-items: center; gap: 12px; }
.attendance-roster-header { margin-top: 16px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.attendance-student { padding: 14px 0; border-top: 1px solid var(--line); }
.attendance-student-name { min-width: 0; overflow-wrap: anywhere; }
.attendance-rsvp { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.attendance-statuses { display: flex; min-width: 0; gap: 5px; }
.attendance-status { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: transparent; font-size: 12px; }
.attendance-status.is-selected { border-color: var(--line-dark); background: var(--lavender); font-weight: 750; }
.attendance-status.status-present.is-selected { border-color: var(--mint-deep); background: var(--mint); }
.attendance-status.status-absent.is-selected { border-color: var(--coral); background: var(--coral-soft); }
.attendance-status:disabled { cursor: default; }
.attendance-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.attendance-photo-choice { min-height: 44px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
.attendance-photo-choice::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 5px; border: 1px solid var(--line-dark); border-radius: 3px; vertical-align: -3px; }
.attendance-photo-choice.is-selected { background: var(--lavender); border-color: var(--line-dark); font-weight: 750; }
.attendance-photo-choice.is-selected::before { content: "✓"; text-align: center; line-height: 13px; }
.attendance-photo-choice:disabled, .attendance-photo-clear:disabled { cursor: default; }
.attendance-photo small { color: var(--ink-soft); font-size: 11px; }
.attendance-photo-clear { padding: 0; border: 0; background: transparent; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 11px; }
@media (max-width: 840px) {
  .attendance-roster-header { display: none; }
  .attendance-student { display: flex; align-items: flex-start; flex-direction: column; }
  .attendance-statuses { width: 100%; }
  .attendance-status { flex: 1; }
  .attendance-photo { width: 100%; }
  .attendance-photo::before { content: "Fotografieren?"; width: 100%; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
}
.attendance-save-status { min-height: 20px; margin-bottom: 0; color: var(--mint-deep); font-size: 12px; }
.today-agenda .is-cancelled .agenda-main strong { text-decoration: line-through; }
.today-agenda .is-cancelled .agenda-count { color: #7b3030; background: #f7e8e1; }
.week-agenda-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 0 21px 16px; }
.week-agenda-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 0 21px 16px; }
.agenda-actions .agenda-absence { color: #7b3030; border-color: #d8b5a6; background: #f7e8e1; }
.week-agenda-day { display: grid; min-width: 0; min-height: 66px; align-content: center; gap: 5px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: transparent; text-align: center; }
.week-agenda-day strong { font-size: 10px; }
.week-agenda-day span { font-size: 10px; }
.week-agenda-day:hover { background: #eeeedf; }
.week-agenda-day.is-today { border-color: #abaf6a; }
.week-agenda-day.is-selected { border-color: #abaf6a; color: var(--ink); background: #e8e9d4; box-shadow: inset 0 0 0 1px #abaf6a; }
.week-agenda-date { margin: 0 21px; padding: 14px 0 5px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }

.response-card { padding: 0 21px 20px; }
.event-feature { padding: 17px; border-radius: 15px; background: #ede5d6; }
.event-feature-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-date { min-width: 43px; padding: 6px 5px; border-radius: 10px; color: var(--plum); background: var(--yellow); font-size: 10px; font-weight: 800; line-height: 1.1; text-align: center; text-transform: uppercase; }
.event-date strong { display: block; margin-top: 2px; font-size: 18px; letter-spacing: -.06em; }
.event-feature h3 { margin: 1px 0 0; font-size: 13px; letter-spacing: -.025em; }
.event-feature p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.response-value { margin-top: 16px; color: var(--ink); font-size: 11px; font-weight: 750; }
.response-value span { color: var(--ink-faint); font-weight: 600; }
.response-bar { display: grid; grid-template-columns: 16fr 6fr 4fr; gap: 3px; height: 7px; margin-top: 7px; overflow: hidden; border-radius: 5px; }
.response-bar span { display: block; border-radius: 4px; }
.response-yes { background: var(--mint-deep); }
.response-no { background: var(--coral); }
.response-open { background: #cfc8d7; }
.response-legend { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; color: var(--ink-soft); font-size: 10px; }
.response-legend i { display: inline-block; width: 6px; height: 6px; margin: 0 3px 1px 0; border-radius: 50%; }

.inbox-list { padding: 0 20px 7px; }
.inbox-row { display: flex; width: 100%; gap: 10px; align-items: flex-start; padding: 13px 0; border: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; text-align: left; }
.inbox-row:first-child { border-top: 0; }
.avatar { width: 34px; height: 34px; color: #3e3051; background: var(--lilac); }
.avatar.yellow { background: #fde4a5; }
.avatar.mint { background: var(--mint); }
.avatar.coral { background: #f8c4bd; }
.inbox-copy { min-width: 0; flex: 1; }
.inbox-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.inbox-copy p { display: -webkit-box; margin: 3px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inbox-meta { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.unread { width: 7px; height: 7px; margin: 5px 0 0 5px; border-radius: 50%; background: var(--coral); }

.activity-list { padding: 0 20px 17px; }
.activity-item { display: grid; grid-template-columns: 22px 1fr; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-symbol { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; color: var(--purple); background: var(--lavender); }
.activity-symbol svg { width: 12px; height: 12px; }
.activity-copy strong, .activity-copy span { display: block; }
.activity-copy strong { font-size: 10px; font-weight: 720; }
.activity-copy span { margin-top: 1px; color: var(--ink-faint); font-size: 10px; }

.quick-card { padding: 20px; border: 1px solid #efdca8; border-radius: var(--radius-lg); background: #fff8e6; }
.quick-card h3 { margin: 0; font-size: 15px; letter-spacing: -.03em; }
.quick-card p { margin: 5px 0 14px; color: #736345; font-size: 11px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.empty-state { display: grid; min-height: 255px; padding: 35px; place-items: center; color: var(--ink-soft); text-align: center; }
.empty-state svg { width: 35px; height: 35px; color: var(--purple); }
.empty-state h2 { margin: 14px 0 5px; color: var(--ink); font-size: 17px; }
.empty-state p { max-width: 350px; margin: 0; font-size: 12px; }

/* Message area */
.messages-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 190px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.conversation-sidebar { padding: 19px 13px 12px; border-right: 1px solid var(--line); }
.conversation-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 7px 14px; }
.conversation-title-row h2 { margin: 0; font-size: 16px; letter-spacing: -.03em; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-faint); background: #fbfafb; }
.search-field svg { width: 15px; height: 15px; flex: 0 0 auto; }
.search-field input { min-width: 0; width: 100%; height: 35px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.conversation-section { padding: 18px 7px 7px; color: var(--ink-faint); font-size: 10px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.conversation-group-title { display: flex; align-items: center; gap: 7px; margin: 0; padding: 18px 7px 7px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.conversation-group:not([data-conversation-group="general"]) .conversation-group-title::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 2px; background: #78977f; }
.conversation-group[data-conversation-group="unread"] .conversation-group-title::before { background: var(--yellow); }
.conversation-group[data-conversation-group="flexible"] .conversation-group-title::before { background: var(--purple); }
.conversation-item { display: grid; position: relative; grid-template-columns: 35px minmax(0, 1fr) auto; gap: 9px; width: 100%; padding: 10px 7px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; }
.conversation-item:hover { background: #f7f0e5; }
.conversation-item.is-selected { background: var(--lavender); }
.conversation-item .avatar { width: 35px; height: 35px; font-size: 10px; }
.conversation-copy { min-width: 0; }
.conversation-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy span { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-info { color: var(--ink-faint); font-size: 9px; text-align: right; }
.conversation-info .unread-count { display: block; min-width: 16px; height: 16px; margin: 4px 0 0 auto; padding: 0 3px; border-radius: 8px; color: var(--plum); background: var(--yellow); font-size: 9px; font-weight: 800; line-height: 16px; text-align: center; }
.conversation-mobile-label, .conversation-mobile-unread { display: none; }
.message-recipients { display: grid; gap: 10px; }
.message-recipient { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--canvas); text-align: left; }
.message-recipient:hover:not(:disabled) { border-color: var(--brand-accent); }
.message-recipient strong, .message-recipient small { display: block; overflow-wrap: anywhere; }
.message-recipient strong { font-size: 14px; }
.message-recipient small { margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.message-recipient > svg { width: 18px; height: 18px; }
.private-message-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

.chat-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 76px; padding: 16px 23px; border-bottom: 1px solid var(--line); }
.chat-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-person .avatar { width: 38px; height: 38px; }
.chat-person h2 { margin: 0; font-size: 14px; letter-spacing: -.025em; }
.chat-person p { margin: 2px 0 0; color: var(--mint-deep); font-size: 10px; font-weight: 650; }
.chat-participants-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 4px; padding: 3px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chat-course-links { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; }
.chat-course-links .chat-participants-trigger { line-height: 20px; }
.chat-participants-trigger svg { width: 16px; height: 16px; flex: 0 0 16px; }
.chat-participant-count { color: var(--ink-soft); font-size: 12px; }
.chat-participant-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.chat-participant-list li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.chat-participant-list li:last-child { border-bottom: 0; }
.chat-participant-list .avatar { flex-shrink: 0; }
.chat-participant-list strong { overflow-wrap: anywhere; }
@media (max-width: 840px) { .chat-participants-trigger { min-height: 36px; } }
.chat-actions { display: flex; gap: 7px; }
.chat-actions .icon-button { width: 33px; height: 33px; }
.chat-log { display: flex; flex-direction: column; gap: 11px; min-height: 350px; padding: 22px 23px; background: linear-gradient(180deg, #fffefa, #faf8fa); overflow-y: auto; }
.chat-date { align-self: center; margin: 4px 0 7px; padding: 4px 9px; border-radius: 8px; color: var(--ink-faint); background: #f0edf1; font-size: 9px; font-weight: 700; }
.bubble { max-width: min(73%, 530px); padding: 10px 12px; border-radius: 14px 14px 14px 4px; color: var(--ink); background: #eee9f5; font-size: 12px; line-height: 1.45; }
.bubble p { margin: 0; }
.bubble .bubble-time { display: block; margin-top: 4px; color: #65586f; font-size: 9px; text-align: right; }
.bubble.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; color: #fff; background: var(--plum-2); }
.bubble.me .bubble-time { color: #d9cce8; }
.message-composer { display: flex; align-items: flex-end; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--line); }
.message-composer .icon-button { flex: 0 0 auto; width: 36px; height: 36px; }
.message-composer textarea { flex: 1; height: 40px; max-height: 120px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-dark); border-radius: 11px; outline: none; color: var(--ink); background: #fff; font-size: 12px; }
.message-composer textarea:focus { border-color: var(--purple); }
.send-button { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; }

/* Calendar */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 20px; }
.calendar-layout.month-calendar-layout { grid-template-columns: minmax(0, 1fr); }
.month-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.month-navigation .button { min-height: 42px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.month-weekday { padding: 10px 4px; text-align: center; color: var(--ink-soft); background: var(--paper); font-size: 12px; font-weight: 700; }
.month-day { position: relative; min-width: 0; min-height: 150px; padding: 5px; background: var(--paper); }
.month-day.is-outside { background: var(--canvas); }
.month-day.is-selected { background: #f0efdf; box-shadow: inset 0 0 0 2px #abaf6a; }
.month-day.is-today .month-day-select > span { color: #1d1913; background: #d9ddb0; border-radius: 50%; }
.month-day-select { display: flex; min-height: 36px; width: 100%; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.month-day-select > span { display: inline-grid; min-width: 30px; height: 30px; place-items: center; font-size: 13px; font-weight: 700; }
.month-day-select small { color: var(--ink-soft); font-size: 10px; }
.month-day:has(.month-day-add) .month-day-select { width: calc(100% - 28px); }
.month-day-add { position: absolute; top: 7px; right: 5px; display: grid; width: 28px; height: 30px; padding: 5px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); }
.month-day-add:hover { background: #e8e7cf; }
.month-day-add svg { width: 15px; height: 15px; }
.month-day-entries { display: grid; gap: 4px; }
.month-entry { display: flex; min-width: 0; align-items: flex-start; gap: 4px; width: 100%; padding: 5px 3px; border: 0; border-radius: 5px; color: var(--ink); background: rgb(171 175 106 / 9%); text-align: left; font-size: 11px; line-height: 1.4; }
.month-entry:hover { background: rgb(171 175 106 / 24%); }
.month-entry .course-dot { flex: 0 0 6px; margin: 4px 0 0; }
.month-entry > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.month-entry.is-cancelled { opacity: .65; text-decoration: line-through; }
.month-more { border: 0; padding: 4px; color: var(--ink-soft); background: transparent; font-size: 11px; text-align: left; }
.month-loading { color: var(--ink-soft); font-size: 12px; }
.month-selected-day { margin-top: 18px; border-top: 1px solid var(--line); }
.month-selected-day .panel-header { padding-left: 5px; padding-right: 5px; }
.month-selected-day h3 { margin: 0; font-size: 16px; scroll-margin-top: 20px; }
.month-selected-day .upcoming-row { grid-template-columns: max-content minmax(0, 1fr) auto; }
.month-row-time { min-width: 45px; color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.month-selected-day .upcoming-copy > strong .course-dot { margin-right: 6px; }
@media (max-width: 840px) {
  .month-selected-day h3 { scroll-margin-top: calc(80px + env(safe-area-inset-top)); }
}
@media (max-width: 600px) {
  .month-calendar-layout .calendar-panel { padding: 10px; }
  .month-navigation { width: 100%; justify-content: space-between; }
  .month-navigation .button { flex: 1; padding: 8px; }
  .month-grid { border-radius: 10px; }
  .month-weekday { padding: 7px 1px; font-size: 11px; }
  .month-day { min-height: 79px; padding: 2px; }
  .month-day-select, .month-day:has(.month-day-add) .month-day-select { flex-direction: column; width: 100%; min-height: 49px; gap: 0; text-align: center; }
  .month-day-select > span { height: 27px; min-width: 27px; font-size: 12px; }
  .month-day-select small { font-size: 8px; }
  .month-day-add { position: static; margin: 1px auto 0; width: 28px; height: 25px; padding: 3px; }
  .month-day-entries { display: none; }
  .month-selected-day .panel-header { flex-wrap: wrap; gap: 8px; }
  .month-selected-day h3 { font-size: 14px; }
  .month-selected-day .upcoming-row { gap: 8px; }
}
.calendar-panel { padding: 19px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.calendar-title { display: flex; align-items: center; gap: 7px; }
.calendar-title h2 { margin: 0; font-size: 16px; letter-spacing: -.03em; }
.calendar-title button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: #fff; }
.calendar-title button svg { width: 14px; height: 14px; }
.calendar-tabs { display: flex; padding: 3px; border-radius: 9px; background: #f1eef3; }
.calendar-tabs button { padding: 5px 8px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 700; }
.calendar-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgb(34 21 50 / 7%); }
.week-grid { display: grid; grid-template-columns: 48px repeat(5, minmax(97px, 1fr)); min-width: 650px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-scroll { overflow-x: auto; }
.week-day, .time-cell, .calendar-cell { min-height: 65px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.week-day { display: grid; min-height: 49px; place-items: center; color: var(--ink-soft); font-size: 10px; font-weight: 750; text-align: center; }
.week-day strong { display: block; color: var(--ink); font-size: 13px; }
.week-day.today strong { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--plum); background: var(--yellow); }
.time-cell { min-height: 66px; padding: 7px 5px; color: var(--ink-faint); font-size: 9px; font-weight: 650; text-align: right; }
.calendar-cell { padding: 4px; background: #fffefa; }
.event-block { min-height: 45px; padding: 6px 7px; border-left: 3px solid; border-radius: 6px; font-size: 9px; line-height: 1.25; }
.event-block strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.event-block span { display: block; margin-top: 2px; opacity: .75; }
.event-purple { border-color: #a6845f; color: #695137; background: #f3e8d8; }
.event-yellow { border-color: #edb23e; color: #805913; background: #fff1cd; }
.event-mint { border-color: #5ea58f; color: #2c6c59; background: #def2e9; }
.event-coral { border-color: #e77c6f; color: #a64940; background: #ffebe7; }
.upcoming-list { padding: 0 20px 15px; }
.upcoming-row { display: grid; width: 100%; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 12px 0; border: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; text-align: left; }
.upcoming-row:first-child { border-top: 0; }
.upcoming-row > svg { width: 16px; height: 16px; color: var(--ink-faint); }
.calendar-day-entry { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.calendar-day-entry:first-child { border-top: 0; }
.calendar-day-entry > .upcoming-row { min-width: 0; flex: 1; border-top: 0; cursor: pointer; }
.calendar-course-edit { flex: 0 0 auto; margin-right: 10px; white-space: nowrap; }
@media (max-width: 640px) {
  .calendar-day-entry { flex-wrap: wrap; gap: 0; padding-bottom: 10px; }
  .calendar-day-entry > .upcoming-row { flex-basis: 100%; }
  .calendar-course-edit { margin-left: 10px; }
}
.upcoming-row.is-deep-linked { width: calc(100% + 16px); margin: 0 -8px; padding-right: 8px; padding-left: 8px; border-radius: 12px; background: var(--yellow-soft); box-shadow: inset 0 0 0 2px rgb(143 107 82 / 35%); }
.mini-date { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: var(--plum); background: var(--yellow-soft); font-size: 10px; font-weight: 800; line-height: 1; text-align: center; }
.mini-date strong { display: block; font-size: 14px; }
.upcoming-copy strong, .upcoming-copy span { display: block; }
.upcoming-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy span { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }

/* People & courses */
.people-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
.people-list-panel { min-width: 0; }
.people-mobile-list { display: none; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 19px 16px; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; }
.filter-chip { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 10px; font-weight: 700; }
.filter-chip.is-active { border-color: #d6c6ed; color: var(--purple); background: #f0eafa; }
.people-table { width: 100%; border-collapse: collapse; }
.people-table th { padding: 10px 19px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-faint); background: #fbfafb; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.people-table td { padding: 12px 19px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.people-table tr[data-action] { cursor: pointer; }
.people-table tbody tr:hover { background: #fbf9fd; }
.people-layout--owner .people-table .is-selected,
.people-layout--owner .people-mobile-card.is-selected { background: var(--mint); }
.people-layout--owner .people-table .is-selected td:first-child,
.people-layout--owner .people-mobile-card.is-selected { box-shadow: inset 4px 0 #abaf6a; }
.people-layout--owner .is-selected .table-person strong,
.people-layout--owner .is-selected .people-mobile-copy strong { color: #35523e; }
.people-layout .people-table th,
.people-layout .people-table td { padding-right: 8px; padding-left: 8px; }
.people-layout .people-table th:first-child, .people-layout .people-table td:first-child { width: 40%; }
.people-layout .people-table th:nth-child(2), .people-layout .people-table td:nth-child(2) { width: 28%; }
.people-layout .people-table th:last-child, .people-layout .people-table td:last-child { width: 32%; }
.people-layout .people-table .status-pill { white-space: normal; }
.people-layout .table-person .avatar { flex-shrink: 0; }
.people-layout .filter-row { flex-wrap: wrap; }
.people-layout .filter-row .search-field { width: 100%; }
.table-person { display: flex; align-items: center; gap: 9px; min-width: 180px; color: var(--ink); }
.table-person .avatar { width: 31px; height: 31px; font-size: 13px; line-height: 1; }
.table-person strong, .table-person span:not(.avatar) { display: block; }
.table-person strong { font-size: 11px; }
.table-person span:not(.avatar) { margin-top: 1px; color: var(--ink-faint); font-size: 10px; }
.course-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.course-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; color: #695137; background: #f3e8d8; font-size: 9px; font-weight: 650; }
.course-pill i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 7px; color: #387763; background: #e3f3ed; font-size: 9px; font-weight: 750; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.is-muted { color: #7c7384; background: #f0eef1; }

.person-detail { position: sticky; top: 21px; max-height: calc(100dvh - 42px); padding: 20px; overflow-y: auto; scrollbar-gutter: stable; }
.person-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.person-detail-header .avatar { width: 50px; height: 50px; font-size: 16px; line-height: 1; }
.person-detail h2 { margin: 11px 0 2px; font-size: 18px; letter-spacing: -.04em; }
.person-detail .person-meta { margin: 0; color: var(--ink-soft); font-size: 11px; }
.photo-permission-summary { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.participant-photo-permission { margin: 0 0 20px; }
.photo-permission-choices { display: flex; gap: 8px; margin-top: 10px; }
.photo-permission-choices .attendance-photo-choice { min-width: 70px; }
.photo-permission-help { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.participant-pause > details { margin-top: 14px; }
.participant-pause > details > summary { display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--ink-soft); font-size: 11px; font-weight: 400; line-height: 1.5; list-style: none; cursor: pointer; }
.participant-pause > details > summary::-webkit-details-marker { display: none; }
.participant-pause > details > summary::marker { content: ""; }
.participant-pause > details > summary svg { flex: 0 0 16px; width: 16px; height: 16px; }
.participant-pause > details > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.detail-divider { height: 1px; margin: 18px 0; background: var(--line); }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.detail-section-title h3 { margin: 0; font-size: 12px; }
.detail-section-title button { border: 0; color: var(--purple); background: transparent; font-size: 10px; font-weight: 750; }
.contact-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; color: var(--ink-soft); font-size: 10px; }
.contact-row svg { width: 14px; height: 14px; color: var(--purple); }
.assignment-groups { display: grid; gap: 20px; }
.person-detail > .assignment-groups { max-height: min(420px, 45dvh); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-color: var(--ink-faint) var(--paper); padding-right: 8px; }
.person-detail > .assignment-groups:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }
.assignment-group { min-width: 0; }
.assignment-group h4 { margin: 0 0 9px; font-size: 13px; line-height: 1.4; }
.assign-list { display: grid; gap: 7px; }
.assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.assignment-row strong, .assignment-row span { display: block; }
.assignment-row strong { font-size: 10px; }
.assignment-row span { margin-top: 1px; color: var(--ink-faint); font-size: 9px; }
.toggle { position: relative; width: 32px; height: 18px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 10px; background: #d7d0db; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 18%); content: ""; transition: transform .15s ease; }
.toggle.is-on { background: var(--mint-deep); }
.toggle.is-on::after { transform: translateX(14px); }
.course-sections { display: grid; gap: 32px; }
.course-category { min-width: 0; }
.course-category-title { margin: 0 0 14px; font-size: 20px; line-height: 1.3; letter-spacing: -.035em; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.course-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.course-card h2, .course-card h3 { margin: 12px 0 3px; font-size: 16px; letter-spacing: -.04em; }
.course-card p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.course-color { display: block; width: 12px; height: 12px; border-radius: 4px; }
.tone-gold { background: #c69b64; }
.tone-brown { background: #8f6b52; }
.tone-oxblood { background: #5c1f2c; }
.tone-sage { background: #78977f; }
.tone-bronze { background: #a6845f; }
.tone-stone { background: #78706d; }
.course-category[aria-labelledby="courses-children"] .course-card-top .course-color,
.today-agenda .course-dot.category-children { background: #abaf6a; }
.course-category[aria-labelledby="courses-adults"] .course-card-top .course-color,
.today-agenda .course-dot.category-adults { background: #8f6b52; }
.course-category[aria-labelledby="courses-other"] .course-card-top .course-color,
.today-agenda .course-dot.category-other { background: #78977f; }

.guardian-contact {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.guardian-contact:last-of-type { border-bottom: 0; }
.guardian-contact .contact-row { min-height: 34px; }
.guardian-contact .contact-row > span:not(.chat-actions, .avatar) { display: grid; gap: 2px; flex: 1; }
.guardian-contact .contact-row > .avatar { width: 34px; height: 34px; flex: 0 0 34px; aspect-ratio: 1; border-radius: 50%; }
.guardian-contact small { color: var(--ink-faint); font-size: 0.72rem; font-weight: 500; }
.account-children { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.account-children > strong { font-size: 11px; }
.account-children > .button { justify-self: start; }
.account-child-list { display: flex; flex-wrap: wrap; gap: 8px; }
.account-child { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.account-child.is-selected { border-color: #abaf6a; background: #ececd8; box-shadow: inset 0 0 0 1px #abaf6a; }
.account-child:hover { border-color: #abaf6a; }
.load-older { align-self: center; margin: 2px auto 12px; }
.bubble-sender { display: block; margin-bottom: 4px; font-size: 0.74rem; color: var(--ink-faint); }
.upcoming-row.is-cancelled { opacity: 0.68; }
.upcoming-row.is-cancelled .upcoming-copy > strong { text-decoration: line-through; }
.upcoming-copy em { color: var(--coral); font-size: 0.72rem; font-style: normal; text-decoration: none; }
.response-summary { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 20px; }
.response-summary .stat-card { min-height: 90px; box-shadow: none; }
.modal.responses-modal { width: min(100%, 740px); }
.response-event-button { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.responses-filters, .responses-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.responses-filters { margin-bottom: 16px; }
.responses-filters [aria-pressed="true"] { border-color: #abaf6a; background: #eeefdc; color: #1b1813; box-shadow: inset 0 0 0 1px #abaf6a; }
.responses-overview-summary, .responses-owner-hint { font-size: 12px; color: var(--ink-soft); }
.responses-event-list { display: grid; gap: 10px; }
.responses-event-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.responses-event-item > span:first-child { flex: 1; min-width: 0; }
.responses-event-item strong, .responses-event-item small { display: block; overflow-wrap: anywhere; }
.responses-event-item small { margin-top: 5px; color: var(--ink-soft); line-height: 1.5; }
.responses-event-item > .status-pill { flex-shrink: 0; }
.responses-event-item > svg { flex: 0 0 18px; width: 18px; height: 18px; }
.responses-modal .response-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.responses-modal .response-summary .stat-card { padding: 14px; min-height: 76px; }
.responses-event-item:hover, .response-event-button:hover { background: #eeefdc; }
.responses-person-section + .responses-person-section { margin-top: 26px; }
.responses-person-section h3 { margin: 0 0 8px; font-size: 15px; }
.responses-person { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.responses-person-info { display: flex; gap: 12px; align-items: center; flex: 1 1 260px; min-width: 0; }
.responses-person-info > div { min-width: 0; overflow-wrap: anywhere; }
.responses-person-info .avatar { flex-shrink: 0; }
.responses-person-info strong { display: block; }
.responses-person-info p { margin: 5px 0; white-space: pre-wrap; font-size: 13px; }
.responses-person-info small { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.responses-person-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-response-form { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.staff-response-form h3 { margin-top: 0; overflow-wrap: anywhere; }
.staff-response-form p { font-size: 13px; line-height: 1.5; }
.staff-response-form .form-field { margin: 14px 0; }
.responses-edit-actions { justify-content: flex-end; }
@media (max-width: 540px) {
  .responses-event-item { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .responses-event-item > span:first-child { flex-basis: 100%; }
  .responses-event-item > svg { margin-left: auto; }
  .responses-person-actions { width: 100%; justify-content: space-between; }
}
.course-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.course-card-footer > span { color: #000; font-size: 11px; font-weight: 700; }
.course-card-footer strong { flex-shrink: 0; white-space: nowrap; color: var(--ink); font-size: 12px; }

/* Team & settings */
.team-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.team-list { padding: 0 20px 16px; }
.team-row { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto auto auto; align-items: center; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }
.team-row:first-child { border-top: 0; }
.team-row .avatar { width: 39px; height: 39px; }
.team-row-copy strong, .team-row-copy span { display: block; }
.team-row-copy strong { font-size: 12px; }
.team-row-copy span { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
.team-management-list .team-row { grid-template-columns: 39px minmax(0, 1fr) auto; }
.team-management-list .team-row-copy { min-width: 0; overflow-wrap: anywhere; }
.team-row-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-tag { padding: 4px 7px; border-radius: 7px; color: #695137; background: var(--lavender); font-size: 9px; font-weight: 750; }
.role-tag.owner { color: #865c0d; background: var(--yellow-soft); }
.role-tag.teacher { color: #307463; background: #e0f2eb; }
.permissions-card { padding: 20px; }
.permissions-card h2 { margin: 0; font-size: 15px; letter-spacing: -.03em; }
.permissions-card > p { margin: 5px 0 15px; color: var(--ink-soft); font-size: 11px; }
.permission-row { display: flex; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); }
.permission-row svg { width: 16px; height: 16px; color: var(--purple); }
.permission-row strong, .permission-row span { display: block; }
.permission-row strong { font-size: 11px; }
.permission-row span { margin-top: 1px; color: var(--ink-soft); font-size: 10px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; }
.settings-form { padding: 21px; }
.privacy-panel { margin-top: 20px; }
.event-cancellation-message { white-space: pre-line; overflow-wrap: anywhere; }
.auth-card:has(.initial-privacy) .auth-brand { margin-bottom: 20px; }
.auth-card .auth-push-note { margin-top: 18px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.auth-card .auth-install-button { width: 100%; min-height: 44px; margin-top: 14px; }
.auth-card .install-desktop { margin: 13px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.auth-card .install-now { width: 100%; min-height: 46px; margin-top: 18px; }
.install-guides { display: grid; gap: 10px; margin-top: 20px; }
.install-guide { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.install-guide summary { display: flex; min-height: 44px; align-items: center; padding: 10px 14px; color: var(--ink); font-size: 13px; font-weight: 750; list-style: none; cursor: pointer; }
.install-guide summary::-webkit-details-marker { display: none; }
.install-guide summary::after { width: 7px; height: 7px; margin: -3px 2px 0 auto; border-right: 1.7px solid var(--ink-soft); border-bottom: 1.7px solid var(--ink-soft); transform: rotate(45deg); content: ""; }
.install-guide[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.install-guide summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 12px; }
.install-steps { display: grid; gap: 11px; margin: 0; padding: 2px 14px 14px; list-style: none; }
.install-steps li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.install-steps b { color: var(--ink); }
.install-steps svg { width: 15px; height: 15px; margin-left: 1px; vertical-align: -3px; color: var(--ink); }
.install-step-number { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--line-dark); border-radius: 999px; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.install-push-note { display: flex; gap: 9px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; color: var(--ink-soft); background: #f4ead8; font-size: 12px; line-height: 1.5; }
.install-push-note svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: #765831; }
.install-push-note strong { color: var(--ink); }
.auth-card:has(.initial-privacy) .brand-logo-surface { max-width: 180px; }
.auth-card .initial-privacy h1 { font-size: 30px; line-height: 1.1; }
.initial-privacy h2 { margin: 8px 0 0; font-size: 20px; }
.initial-privacy p { margin: 0; font-size: 13px; line-height: 1.5; }
.initial-privacy .auth-form { gap: 12px; }
.initial-privacy .auth-form > a { font-size: 13px; }
.initial-privacy-choices { border: 1px solid var(--line); border-radius: 12px; }
.initial-privacy .privacy-choice { gap: 9px; padding: 12px; border: 0; border-radius: 0; }
.initial-privacy .privacy-choice > span { line-height: 1.45; }
.initial-privacy .privacy-choice strong { margin-bottom: 3px; }
.initial-privacy .initial-push-choice { border-top: 1px solid var(--line); }
.initial-app-required { padding: 14px 12px; border-top: 1px solid var(--line); background: var(--paper); border-radius: 0 0 12px 12px; }
.initial-app-required strong { display: block; margin-bottom: 6px; font-size: 13px; }
.participant-setup .setup-progress { margin-bottom: 14px; color: var(--ink-soft); font-size: 12px; }
.participant-setup .auth-brand { margin-bottom: 20px; }
.participant-setup .brand-logo-surface { max-width: 180px; }
.participant-setup .auth-card > .button-primary { width: 100%; min-height: 46px; margin-top: 16px; }
.participant-setup .auth-card > .auth-back { margin-top: 20px; }
.initial-push-choice:has(input:disabled) { cursor: default; }
.initial-privacy-points { display: grid; gap: 10px; }
.initial-privacy-points > span { position: relative; padding-left: 12px; }
.initial-privacy-points > span::before { position: absolute; left: 0; content: "•"; }
.initial-privacy .initial-group-choice { border-top: 1px solid var(--line); }
.initial-privacy-details summary { padding-block: 6px; font-size: 13px; cursor: pointer; }
.initial-privacy-details p { margin-top: 10px; }
.initial-privacy-details h2 { margin-top: 14px; }
.initial-privacy-details .button { margin-top: 10px; }
.initial-privacy-details summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.privacy-panel fieldset, #membership-erasure-form fieldset { display: grid; gap: 18px; border: 0; padding: 0; margin: 0; min-width: 0; }
.privacy-panel p, .privacy-panel li { font-size: 13px; line-height: 1.6; }
.privacy-choice { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.privacy-choice input { flex: 0 0 22px; width: 22px; height: 22px; margin: 2px 0 0; accent-color: #757b34; }
.privacy-choice > span { font-size: 13px; line-height: 1.6; }
.privacy-choice strong, .privacy-choice span span { display: block; }
.privacy-choice strong { margin-bottom: 5px; }
.privacy-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.privacy-panel button { justify-self: start; }
.privacy-note:empty { display: none; }
.retention-preview { margin-block: 20px; }
.retention-preview dl { max-width: 650px; }
.retention-preview dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.retention-preview dd { margin: 0; font-weight: 700; }
.retention-rules { padding-left: 20px; }
.settings-form h2 { margin: 0; font-size: 16px; letter-spacing: -.03em; }
.settings-form > p { margin: 5px 0 19px; color: var(--ink-soft); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line-dark); border-radius: 10px; outline: none; color: var(--ink); background: #fff; font-size: 11px; }
.form-field textarea { min-height: 78px; resize: vertical; }
.course-schedule-hint { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.course-schedule-hint.is-warning { color: #8a5a0b; }
.course-schedule-hint.is-error { color: #a3322b; font-weight: 700; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--purple); }
.form-field .compose-recipient-search { min-width: 0; border-color: var(--line-dark); background: #fff; }
.form-field .compose-recipient-search:focus-within { border-color: var(--purple); }
.form-field .compose-recipient-search input { min-height: 40px; height: auto; border: 0; padding: 10px 0; background: transparent; }
.recipient-search-status { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.push-setup { padding: 21px; border: 1px solid #c9bfa7; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(140deg, #28221c, #5c1f2c); }
.push-setup .push-symbol { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; color: var(--plum); background: var(--yellow); }
.push-setup .push-symbol svg { width: 18px; height: 18px; }
.push-setup h2 { margin: 14px 0 4px; font-size: 17px; letter-spacing: -.03em; }
.push-setup p { margin: 0; color: #e7dff0; font-size: 11px; }
.push-setup .button { margin-top: 16px; }

/* Participant */
.participant-hero { position: relative; overflow: hidden; padding: 20px 24px; border-radius: var(--radius-lg); color: #fff; background: #2b251f; }
.participant-hero::after { position: absolute; right: -47px; bottom: -69px; width: 250px; height: 250px; border: 35px solid rgb(247 202 101 / 20%); border-radius: 50%; content: ""; }
.participant-hero > * { position: relative; z-index: 1; }
.participant-hero .eyebrow { color: #e3c291; }
.participant-hero h1 { max-width: 480px; margin: 0; font-family: var(--serif); font-size: clamp(31px, 3.2vw, 43px); font-weight: 400; letter-spacing: -.025em; line-height: .98; }
.participant-hero p:not(.eyebrow) { max-width: 440px; margin: 9px 0 0; color: #ddd2e7; font-size: 13px; }
.participant-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .67fr); gap: 20px; margin-top: 20px; }
.next-class { padding: 21px; }
.next-class-head { display: flex; align-items: flex-start; gap: 13px; }
.next-class .event-date { min-width: 48px; }
.next-class h2 { margin: 0; font-size: 17px; letter-spacing: -.04em; }
.next-class p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.class-detail-row { display: flex; flex-wrap: wrap; gap: 11px; margin: 19px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.class-detail-row span { display: inline-flex; align-items: center; gap: 5px; }
.class-detail-row svg { width: 13px; height: 13px; color: var(--purple); }
.rsvp-actions { display: flex; gap: 8px; }
.rsvp-actions .button { flex: 1; }
.rsvp-status { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--mint-deep); font-size: 10px; font-weight: 700; }
.rsvp-status.is-no { color: #bb5044; }
.rsvp-status svg { width: 14px; height: 14px; }
.participant-info-list { padding: 0 20px 16px; }
.participant-info-row { display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.participant-info-row:first-child { border-top: 0; }
.participant-info-row > svg { width: 15px; height: 15px; color: var(--purple); }
.participant-info-row strong, .participant-info-row span { display: block; }
.participant-info-row strong { font-size: 11px; }
.participant-info-row span { margin-top: 1px; color: var(--ink-soft); font-size: 10px; }
.participant-updates { margin-top: 20px; }

/* Modals and toast */
.modal-layer { --dialog-gap: 18px; position: fixed; z-index: 20; inset: var(--dialog-viewport-top, 0px) auto auto var(--dialog-viewport-left, 0px); width: var(--dialog-viewport-width, 100%); height: var(--dialog-viewport-height, 100dvh); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: calc(var(--dialog-gap) + var(--safe-area-top)) calc(var(--dialog-gap) + var(--safe-area-right)) calc(var(--dialog-gap) + var(--dialog-safe-bottom, var(--safe-area-bottom))) calc(var(--dialog-gap) + var(--safe-area-left)); place-items: center; overflow: hidden; overscroll-behavior: none; background: rgb(31 23 42 / 45%); backdrop-filter: blur(3px); }
.modal { width: min(100%, 510px); max-height: min(720px, calc(100vh - 36px)); overflow: auto; border: 1px solid rgb(255 255 255 / 65%); border-radius: 20px; background: var(--paper); box-shadow: 0 24px 60px rgb(29 18 42 / 24%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 21px 21px 13px; }
.modal-header h2 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.modal-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.modal-header .icon-button { width: 44px; height: 44px; flex: 0 0 auto; }
.dialog-keyboard-done { display: none; }
.dialog-back-icon { display: none; }
.modal-body { padding: 4px 21px 21px; }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 13px 21px 20px; }
.recipient-summary { display: flex; align-items: center; gap: 8px; margin: 13px 0 0; padding: 10px; border-radius: 10px; color: #5b4776; background: var(--lavender); font-size: 11px; }
.recipient-summary svg { width: 16px; height: 16px; }
.modal .form-grid { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 11px; }
.modal .form-field { min-width: 0; grid-template-columns: minmax(0, 1fr); overflow-x: clip; }
.modal input, .modal select, .modal textarea { min-width: 0; max-width: 100%; }

.toast-region { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid #cfbfeb; border-radius: 13px; color: #fff; background: var(--plum); box-shadow: 0 13px 30px rgb(43 29 59 / 23%); animation: toast-in .24s ease both; }
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--yellow); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 1px; color: #d9cfdf; font-size: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

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

/* Authentication, loading and recoverable application states */
.standalone-page { min-height: 100vh; min-height: 100svh; }

.auth-shell,
.state-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  place-items: center;
  background:
    radial-gradient(circle at 15% 12%, rgb(216 182 126 / 26%), transparent 29rem),
    radial-gradient(circle at 86% 88%, rgb(141 60 74 / 13%), transparent 34rem),
    var(--canvas);
}

.auth-shell { grid-template-columns: minmax(320px, 460px) minmax(360px, 560px); gap: clamp(28px, 6vw, 86px); }
.auth-shell > .auth-card:only-child { grid-column: 1 / -1; justify-self: center; }

.auth-shell::before,
.state-screen::before {
  position: fixed;
  inset: 0;
  opacity: .42;
  background-image: linear-gradient(rgb(91 75 53 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(91 75 53 / 4%) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  pointer-events: none;
}

.auth-card,
.state-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgb(201 191 167 / 86%);
  border-radius: 28px;
  background: rgb(251 248 242 / 96%);
  box-shadow: 0 28px 80px rgb(44 35 22 / 14%);
  backdrop-filter: blur(18px);
}

.auth-card.offline-card { text-align: center; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 31px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .02em;
}

.offline-card .auth-brand { justify-content: center; }
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; color: var(--yellow); background: var(--plum); }
.auth-brand .brand-mark svg { width: 21px; height: 21px; }
.auth-brand em { color: #8d3c4a; font-style: italic; }

.auth-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--yellow);
  background: var(--plum);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 500;
}

.auth-card h1,
.state-card h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(31px, 6vw, 43px);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .98;
}

.auth-card h1 + p,
.auth-copy,
.state-card h1 + p {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.auth-audiences {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.auth-audiences span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #f7f1e7;
  font-size: 10px;
  font-weight: 750;
}

.auth-audiences svg { width: 13px; height: 13px; }

.auth-form { display: grid; gap: 14px; margin-top: 27px; }
.auth-form .form-field { gap: 7px; }
.auth-form .form-field label { font-size: 11px; }
.auth-form .form-field input { min-height: 46px; padding: 11px 13px; font-size: 16px; }
.auth-form .form-field > span { color: var(--ink-faint); font-size: 9px; }
.auth-form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-link { padding: 2px; border: 0; color: #765831; background: transparent; font-size: 11px; font-weight: 750; text-decoration: underline; text-decoration-color: rgb(118 88 49 / 34%); text-underline-offset: 3px; }
.auth-link:hover { text-decoration-color: currentColor; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 4px; }
.offline-card .auth-submit { margin-top: 25px; text-decoration: none; }
.auth-footnote { margin: 24px 0 0; color: var(--ink-faint); font-size: 10px; text-align: center; }
.auth-back { display: block; margin: 18px auto 0; }

.auth-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 29px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
}

.auth-card footer span { display: inline-flex; align-items: center; gap: 5px; }
.auth-card footer svg { width: 12px; height: 12px; }
.auth-card footer a { color: #765831; font-weight: 700; text-decoration: none; }
.auth-card footer a:hover { text-decoration: underline; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 11px; }
.auth-card .legal-links { justify-content: flex-start; gap: 8px 20px; font-size: 12px; }
.auth-card .legal-links a { display: inline-flex; min-height: 32px; align-items: center; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 12px 18px; border-radius: 8px; background: #1b1813; color: white; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

.auth-visual {
  position: relative;
  display: flex;
  width: min(100%, 560px);
  min-height: min(680px, calc(100svh - 64px));
  align-items: flex-end;
  overflow: hidden;
  padding: 48px;
  border-radius: 36px;
  color: #fff;
  background: linear-gradient(145deg, #27221b 8%, #5c1f2c 78%);
  box-shadow: 0 30px 90px rgb(44 35 22 / 18%);
}

.auth-visual::after {
  position: absolute;
  top: 11%;
  right: -20%;
  width: 82%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  content: "";
}

.auth-orbit {
  position: absolute;
  top: 9%;
  right: -5%;
  width: 74%;
  aspect-ratio: 1;
  border: 54px solid rgb(216 182 126 / 17%);
  border-radius: 50%;
}

.auth-visual > div { position: relative; z-index: 1; }
.auth-visual p { margin: 0 0 13px; color: #e3c291; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.auth-visual h2 { margin: 0; font-family: var(--serif); font-size: clamp(39px, 5vw, 61px); font-weight: 400; letter-spacing: -.035em; line-height: .9; }

.auth-alert,
.app-alert,
.error-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #e5b8bd;
  border-radius: 11px;
  color: #873643;
  background: #f9e9eb;
  font-size: 11px;
}

.auth-alert.is-success,
.auth-alert[data-variant="success"],
.app-alert.is-success {
  border-color: #b7d2c3;
  color: #315e49;
  background: #e9f3ed;
}

.auth-alert svg,
.app-alert svg { width: 15px; height: 15px; flex: 0 0 auto; }

.app-loading,
.app-error {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: 38px 20px;
  place-items: center;
  align-content: center;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 42%, rgb(216 182 126 / 22%), transparent 24rem), var(--canvas);
  box-shadow: none;
  text-align: center;
}

.app-loading .auth-brand,
.app-error .auth-brand { margin-bottom: 22px; }
.app-loading h1 { margin: 15px 0 0; font-family: var(--serif); font-size: 29px; font-weight: 400; }
.app-loading p,
.app-error p { max-width: 340px; margin: 12px 0 0; color: var(--ink-soft); font-size: 12px; }
.app-error h1 { margin: 16px 0 0; font-family: var(--serif); font-size: 29px; font-weight: 400; }
.app-error .button { margin-top: 20px; }
.app-error > .stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #a43e4b; background: var(--coral-soft); }
.app-error > .stat-icon svg { width: 18px; height: 18px; }

.start-guide {
  display: grid;
  width: min(100%, 390px);
  gap: 6px;
  margin-top: 19px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 11px;
  text-align: left;
}

.start-guide strong { color: var(--ink); font-size: 12px; }
.start-guide code { padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--plum); font-size: 10px; }
.direct-file-help .auth-brand { justify-content: center; }

.loading-spinner,
.loading-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: loading-spin .78s linear infinite;
}

.chat-loading { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 10px; color: var(--ink-soft); font-size: 10px; }
.chat-loading .loading-ring { width: 27px; height: 27px; }

@keyframes loading-spin { to { transform: rotate(360deg); } }

button:disabled,
.button:disabled,
[aria-disabled="true"] { cursor: not-allowed; opacity: .58; transform: none; }

.button[aria-busy="true"]::after {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin .7s linear infinite;
  content: "";
}

/* Multi-child family accounts */
.child-switcher {
  display: flex;
  gap: 7px;
  max-width: 100%;
  margin: 0 0 17px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  scrollbar-width: thin;
}

.child-switcher button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  min-height: 40px;
  padding: 5px 11px 5px 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.child-switcher button:hover { background: var(--yellow-soft); }
.child-switcher button.is-active { border-color: rgb(216 182 126 / 54%); color: var(--ink); background: var(--yellow); }
.child-switcher .avatar { width: 28px; height: 28px; color: var(--ink); font-size: 8px; }

/* Message attachments and upload feedback */
.attachment-list,
.attachment-preview-list,
.bubble-attachments,
.composer-files,
.file-preview-list { display: flex; flex-wrap: wrap; gap: 7px; }

.composer-files,
.file-preview-list,
.attachment-preview-list { padding: 0 18px 11px; }

.attachment-chip,
.attachment-link,
.file-preview,
.message-attachment {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.attachment-link:hover,
.message-attachment:hover { border-color: var(--lilac); color: var(--ink); }
.attachment-chip svg,
.attachment-link svg,
.file-preview svg,
.message-attachment svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--purple); }
.attachment-name { overflow: hidden; max-width: 230px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { color: var(--ink-faint); font-size: 9px; font-weight: 500; white-space: nowrap; }
.attachment-remove { display: grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--ink-faint); background: #f3f0eb; }
.attachment-remove:hover { color: #a43e4b; background: var(--coral-soft); }
.attachment-chip > span,
.file-preview > span { min-width: 0; }
.attachment-chip strong,
.attachment-chip small,
.file-preview strong,
.file-preview small { display: block; }
.attachment-chip strong,
.file-preview strong { overflow: hidden; max-width: 210px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip small,
.file-preview small { margin-top: 1px; color: var(--ink-faint); font-size: 8px; font-weight: 500; }
.attachment-chip > svg:last-child { margin-left: 3px; }

.bubble-attachments { margin-top: 8px; }
.bubble .attachment-list { margin-top: 8px; }
.bubble.me .attachment-link,
.bubble.me .message-attachment { border-color: rgb(255 255 255 / 18%); color: #fff; background: rgb(255 255 255 / 9%); }
.bubble.me .attachment-link svg,
.bubble.me .message-attachment svg { color: var(--yellow); }
.bubble.me .attachment-chip { border-color: rgb(255 255 255 / 18%); color: #fff; background: rgb(255 255 255 / 9%); }
.bubble.me .attachment-chip svg { color: var(--yellow); }
.bubble.me .attachment-chip small { color: #d9cce8; }
.bubble-sender { display: block; margin-bottom: 3px; color: #765831; font-size: 9px; }

.message-composer { flex-wrap: wrap; }
.message-composer .file-preview { width: 100%; flex: 1 0 100%; }
.message-composer .file-preview .icon-button { width: 25px; height: 25px; margin-left: auto; }
.moderated-note { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 62px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-soft); background: #f8f5ef; font-size: 10px; text-align: center; }
.moderated-note svg { width: 14px; height: 14px; color: var(--purple); }

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-progress { width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 4px; color: var(--purple); background: var(--line); }
.upload-progress::-webkit-progress-bar { border-radius: 4px; background: var(--line); }
.upload-progress::-webkit-progress-value { border-radius: 4px; background: var(--purple); }
.upload-progress::-moz-progress-bar { border-radius: 4px; background: var(--purple); }
.upload-error { width: 100%; color: #a43e4b; font-size: 10px; }

.empty-inline { padding: 17px 0; color: var(--ink-faint); font-size: 11px; text-align: center; }

/* Connectivity and non-blocking loading feedback */
.offline-banner {
  position: sticky;
  z-index: 14;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 15px;
  color: #fff;
  background: #873643;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.offline-banner svg { width: 14px; height: 14px; }
.offline-banner[hidden] { display: none; }

.skeleton { position: relative; overflow: hidden; border-radius: 8px; color: transparent; background: #e8e1d5; }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 60%), transparent); animation: skeleton-wave 1.35s ease-in-out infinite; content: ""; transform: translateX(-100%); }
@keyframes skeleton-wave { to { transform: translateX(100%); } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 214px minmax(0, 1fr); }
  .sidebar { width: 214px; }
  .workspace { padding: 23px 23px 35px; }
  .dashboard-grid, .calendar-layout, .people-layout, .team-layout, .settings-layout { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: minmax(0, 1fr) minmax(235px, .78fr); align-items: start; }
  .dashboard-side .quick-card { grid-column: 1 / -1; }
  .person-detail { position: static; max-height: none; overflow: hidden; scrollbar-gutter: auto; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-layout > .panel:last-child, .team-layout > .panel:last-child, .settings-layout > .push-setup { max-width: 680px; }
}

@media (max-width: 840px) {
  .auth-shell { grid-template-columns: minmax(0, 480px); }
  .auth-visual { display: none; }
  .app-shell { display: block; }
  .sidebar { --mobile-nav-height: calc(68px + var(--safe-area-bottom)); position: fixed; z-index: 15; top: calc(var(--navigation-viewport-bottom, 100dvh) - var(--mobile-nav-height)); bottom: auto; left: 0; display: var(--mobile-navigation-display, flex); width: 100%; height: var(--mobile-nav-height); padding: 5px max(7px, var(--safe-area-right)) calc(5px + var(--safe-area-bottom)) max(7px, var(--safe-area-left)); overflow: visible; background: rgb(27 24 19 / 97%); box-shadow: 0 -6px 20px rgb(35 25 48 / 18%); backdrop-filter: blur(12px); }
  .brand, .studio-pill, .nav-caption, .mode-switch, .user-card, .sidebar-spacer { display: none; }
  .nav-group { display: flex; width: 100%; grid-template-columns: none; justify-content: space-around; gap: 2px; }
  .nav-item { flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 7px 3px; border-radius: 10px; text-align: center; }
  .sidebar:not(.role-teacher) .nav-item[data-view="courses"], .nav-item[data-view="team"], .nav-item[data-view="settings"] { display: none; }
  .nav-item.is-more-mobile { display: flex; }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-item-label { overflow: hidden; max-width: 68px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .nav-badge { position: absolute; top: 3px; right: calc(50% - 20px); min-width: 14px; height: 14px; padding: 0 3px; font-size: 8px; line-height: 14px; }
  .workspace { padding: calc(24px + var(--safe-area-top)) max(16px, env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .topbar { position: sticky; top: 0; z-index: 10; gap: 8px; min-height: 76px; margin-top: calc(-24px - var(--safe-area-top)); margin-bottom: 22px; padding-top: calc(24px + var(--safe-area-top)); padding-bottom: 8px; background: var(--canvas); }
  .topbar .breadcrumb { min-width: 0; overflow-wrap: anywhere; }
  .topbar .top-actions { flex-shrink: 0; }
  .top-actions { gap: 6px; }
  .icon-button, .chat-actions .icon-button, .modal-header .icon-button, .message-composer .icon-button, .message-composer .file-preview .icon-button, .send-button { width: 44px; height: 44px; }
  .button, .button-small { min-height: 44px; }
  .auth-back { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 12px; }
  .form-field input:not([type="checkbox"]):not([type="color"]), .form-field select, .form-field textarea, .search-field input, .message-composer textarea, .auth-form .form-field input { min-height: 44px; font-size: 16px; }
  .message-composer textarea { height: 44px; }
  .child-switcher button { min-height: 44px; }
  .toggle { width: 44px; height: 44px; border-radius: 12px; background: transparent; }
  .toggle::before { position: absolute; top: 13px; left: 6px; width: 32px; height: 18px; border-radius: 10px; background: #d7d0db; content: ""; }
  .toggle::after { top: 16px; left: 9px; }
  .toggle.is-on { background: transparent; }
  .toggle.is-on::before { background: var(--mint-deep); }
  .topbar .breadcrumb { font-size: 11px; }
  .page-intro { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-intro > .button { width: 100%; }
  .dashboard-side { grid-template-columns: 1fr; }
  .dashboard-side .quick-card { grid-column: auto; }
  .messages-layout { grid-template-columns: 230px minmax(0, 1fr); min-height: 570px; }
  .conversation-sidebar { padding: 15px 9px 10px; }
  .conversation-title-row { padding-left: 5px; padding-right: 5px; }
  .chat-header, .chat-log { padding-left: 15px; padding-right: 15px; }
  .chat-header .chat-actions { display: none; }
  .people-list-panel { overflow-x: auto; }
  .people-table { min-width: 650px; }
  .agenda-row:has(> .course-color) { grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 8px; }
  .agenda-row > .course-color { width: 12px; height: 12px; place-self: start; margin-top: 2px; }
  .course-card { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 8px; align-content: start; }
  .course-card-top { display: contents; }
  .course-card-top > .course-color { grid-column: 1; grid-row: 1; margin-top: 4px; }
  .course-card-top > .icon-button { grid-column: 3; grid-row: 1 / span 2; align-self: start; }
  .course-card > h2, .course-card > h3 { grid-column: 2; grid-row: 1; margin: 0 0 3px; line-height: 1.25; overflow-wrap: anywhere; }
  .course-card > p { grid-column: 2; grid-row: 2; overflow-wrap: anywhere; }
  .course-card > .course-card-footer, .course-card > .course-attendance-action { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .week-agenda-navigation { padding: 0 16px 13px; gap: 6px; }
  .week-agenda-navigation .button { min-height: 44px; padding: 8px; }
  .week-agenda-days { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 0 16px 13px; }
  .week-agenda-day { min-height: 60px; padding: 9px; }
  .week-agenda-day strong { font-size: 12px; }
  .week-agenda-date { margin: 0 16px; }
  .today-agenda .agenda-row { grid-template-columns: minmax(38px, max-content) minmax(0, 1fr) auto; }
  .today-agenda .agenda-main { grid-column: 2 / 4; }
  .today-agenda .agenda-actions { grid-row: 2; grid-column: 2; justify-self: start; justify-content: flex-start; max-width: none; }
  .today-agenda .agenda-actions .button { min-height: 44px; }
  .today-agenda .agenda-count { grid-row: 2; grid-column: 3; }
  .page-intro h1 { font-size: 29px; }
  .welcome-card { min-height: 205px; padding: 22px; }
  .participant-hero { padding: 18px; }
  .welcome-card h2 { font-size: 25px; }
  .stat-grid { gap: 8px; }
  .stat-card { min-height: 111px; padding: 13px; }
  .stat-card .stat-icon { width: 28px; height: 28px; margin-bottom: 11px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .panel-header { padding: 17px 16px 12px; }
  .agenda-list, .response-card, .inbox-list, .activity-list, .participant-info-list, .team-list { padding-left: 16px; padding-right: 16px; }
  .quick-card { padding: 17px; }
  .messages-layout { display: block; min-height: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .conversation-sidebar { margin-bottom: 13px; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
  .conversation-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .conversation-section { display: none; }
  .conversation-item { display: grid; flex: 0 0 auto; width: min(142px, 42vw); min-width: 106px; min-height: 52px; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 7px; padding: 7px 9px; scroll-snap-align: start; }
  .conversation-item .conversation-copy { display: none; }
  .conversation-info { display: none; }
  .conversation-item .avatar { width: 36px; height: 36px; }
  .conversation-mobile-label { display: block; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
  .conversation-mobile-unread { display: grid; position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; place-items: center; padding: 0 3px; border-radius: 9px; color: var(--plum); background: var(--yellow); font-size: 9px; }
  .chat-pane { min-height: 465px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
  .chat-log { min-height: 324px; }
  .bubble { max-width: 84%; }
  .calendar-panel { padding: 14px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-tabs { align-self: stretch; justify-content: space-around; }
  .calendar-tabs button { flex: 1; }
  .course-grid { grid-template-columns: 1fr; }
  .people-list-panel { overflow: visible; }
  .people-table { display: none; }
  .people-mobile-list { display: grid; border-top: 1px solid var(--line); }
  .filter-row { padding-right: 15px; padding-left: 15px; }
  .filter-row .search-field { min-width: 0; flex: 1; }
  .team-row { grid-template-columns: 39px minmax(0, 1fr) auto auto; }
  .team-row .role-tag { display: none; }
  .response-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .settings-form, .person-detail { padding: 17px; }
  .detail-section-title button { min-height: 44px; padding: 8px; }
  .guardian-contact .contact-row:first-child { align-items: flex-start; flex-wrap: wrap; }
  .guardian-contact .chat-actions { display: flex; width: 100%; align-items: center; flex-wrap: wrap; gap: 7px; padding-left: 22px; }
  .guardian-contact .chat-actions .subtle-link { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 10px; }
  .participant-grid { grid-template-columns: 1fr; }
  .modal-layer { --dialog-gap: 10px; }
  .modal-header { padding: 18px 18px 11px; }
  .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-footer { padding: 12px 18px 18px; }
  .toast-region { right: 12px; bottom: 80px; width: calc(100vw - 24px); }
  .auth-shell { padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .auth-card, .state-card { padding: 25px 20px; border-radius: 22px; }
  .auth-brand { margin-bottom: 25px; }
  .auth-card footer { align-items: flex-start; flex-direction: column; }
  .auth-form-row { align-items: flex-start; flex-direction: column; }
  .attachment-name { max-width: 160px; }
  .composer-files, .file-preview-list, .attachment-preview-list { padding-right: 13px; padding-left: 13px; }
}

/* Operational UI pass */
.auth-shell {
  grid-template-columns: minmax(0, 460px);
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-shell > .auth-card { grid-column: 1; justify-self: center; }

.operations-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.operations-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 24px 17px;
}

.operations-heading h2 { margin: 0; font-size: clamp(20px, 2.2vw, 27px); letter-spacing: -.035em; }
.operations-total { display: grid; min-width: 44px; height: 44px; place-items: center; padding: 0 10px; border-radius: 13px; color: #fff; background: var(--plum); font-size: 18px; font-weight: 800; }
.operations-list { padding: 0 24px 13px; }
.operations-list button { display: grid; width: 100%; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 11px; padding: 13px 0; border: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; text-align: left; }
.operations-list button:hover { color: var(--purple); }
.operations-list button > .stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; }
.operations-list button > .stat-icon svg, .operations-list button > svg { width: 17px; height: 17px; }
.operations-list button > svg { color: var(--ink-faint); }
.operations-list button > span:nth-child(2) { min-width: 0; }
.operations-list strong, .operations-list small { display: block; overflow-wrap: anywhere; }
.operations-list strong { color: var(--ink); font-size: 12px; }
.operations-list small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
.operations-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.operations-stats .stat-card { min-height: 96px; }
.operations-stats button.stat-card { color: inherit; text-align: left; transition: border-color .15s ease, background .15s ease; }
.operations-stats button.stat-card:hover { border-color: #abaf6a; background: #f2f0e3; }
.operations-stats button.stat-card > span { display: block; }
.operations-stats .stat-label { max-width: 130px; }

.upcoming-list { padding: 0 6px 6px; }
.upcoming-row { grid-template-columns: 56px minmax(0, 1fr) 18px; align-items: start; gap: 14px; min-height: 82px; padding: 13px 10px; border-radius: 13px; }
.upcoming-row:hover { background: #f7f2e9; }
.upcoming-row > svg { margin-top: 19px; }
.mini-date { display: flex; width: 56px; height: 58px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; border: 1px solid rgb(216 182 126 / 34%); border-radius: 13px; line-height: 1; }
.mini-date strong { order: 1; font-size: 21px; line-height: 1; letter-spacing: -.04em; }
.mini-date span { order: 2; font-size: 9px; line-height: 1; letter-spacing: .08em; }
.upcoming-copy { min-width: 0; padding-top: 3px; }
.upcoming-copy strong { overflow: visible; font-size: 13px; line-height: 1.25; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.upcoming-copy span { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.upcoming-copy .upcoming-response { margin-top: 6px; color: var(--purple); font-weight: 700; }
.event-feature-top { justify-content: flex-start; }
.event-feature-top > div:last-child { min-width: 0; }
.event-feature h3, .event-feature p, .response-value span { overflow-wrap: anywhere; }
.event-date { display: flex; width: 48px; min-width: 48px; min-height: 52px; flex-direction: column; align-items: center; justify-content: center; }
.event-date strong { order: 1; margin: 0; font-size: 19px; }
.event-date span { order: 2; margin-top: 3px; font-size: 9px; }

.people-table { table-layout: fixed; }
.people-table th:first-child, .people-table td:first-child { width: 35%; }
.people-table th:nth-child(2), .people-table td:nth-child(2) { width: 29%; }
.people-table th:nth-child(3), .people-table td:nth-child(3) { width: 20%; }
.people-table th:last-child, .people-table td:last-child { width: 16%; }
.people-table td { vertical-align: top; overflow-wrap: anywhere; }
.table-person { min-width: 0; align-items: flex-start; }
.table-person > span { min-width: 0; }
.table-person strong, .table-person > span > span { white-space: normal; overflow-wrap: anywhere; }
.person-detail, .guardian-contact, .contact-row { min-width: 0; }
.contact-row > span { min-width: 0; overflow-wrap: anywhere; }

.assignment-row { min-height: 46px; padding: 10px 11px; }
.assignment-row > span { min-width: 0; flex: 1 1 auto; margin: 0; }
.assignment-row > span > strong, .assignment-row > span > span { white-space: normal; overflow-wrap: anywhere; }
#course-form .check-row { display: flex; align-items: center; gap: 12px; }
.form-field input[type="checkbox"], .assignment-row input[type="checkbox"] { width: 20px; min-width: 20px; height: 20px; flex: 0 0 20px; margin: 0; padding: 0; accent-color: var(--plum); }
.field-label { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.form-field.is-disabled { opacity: .58; }

.family-fields { grid-column: 1 / -1; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f7f1e7; }
.family-fields-heading { margin-bottom: 13px; }
.family-fields-heading strong, .family-fields-heading span { display: block; }
.family-fields-heading strong { font-size: 12px; }
.family-fields-heading span { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.family-fields .form-grid { margin-top: 0; }
.account-type-row { border-color: #d5c09c; background: var(--yellow-soft); }

.modal { position: relative; display: flex; min-width: 0; min-height: 0; width: min(100%, 640px); max-height: min(760px, 100%); flex-direction: column; overflow: clip; }
.modal .form-field .sr-only { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }
.modal > form { display: flex; min-width: 0; max-width: 100%; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.modal-body { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; }
.modal-footer { position: relative; z-index: 1; flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--paper); box-shadow: 0 -8px 18px rgb(44 35 22 / 4%); }
.modal-header > div { min-width: 0; }
.modal-header { flex: 0 0 auto; }
.modal-header h2, .modal-header p { overflow-wrap: anywhere; }
@media screen {
  html:has(.modal-layer), body:has(.modal-layer) { overflow: hidden; overscroll-behavior: none; }
}
.modal-compose { width: min(100%, 680px); }
.modal > form > .modal-body { flex: 1 1 auto; overflow-anchor: none; scroll-padding-block: 8px; }
.modal-compose #message-body { min-height: 180px; }
.upload-dropzone { display: flex; min-height: 74px; align-items: center; gap: 12px; padding: 14px; border: 1px dashed var(--line-dark); border-radius: 13px; color: var(--ink-soft); background: #fff; cursor: pointer; }
.upload-dropzone:hover { border-color: var(--purple); background: var(--yellow-soft); }
.upload-dropzone > svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--purple); }
.upload-dropzone strong, .upload-dropzone small { display: block; }
.upload-dropzone strong { color: var(--ink); font-size: 11px; }
.upload-dropzone small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; }

.attachment-list { align-items: stretch; flex-direction: column; }
.attachment-image { display: block; width: min(280px, 100%); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: #fff; text-decoration: none; }
.attachment-image img { display: block; width: 100%; max-height: 220px; object-fit: cover; background: var(--canvas); }
.attachment-image > span { display: block; min-width: 0; padding: 8px 10px; }
.attachment-image strong, .attachment-image small, .attachment-file strong, .attachment-file small { display: block; overflow-wrap: anywhere; }
.attachment-image strong, .attachment-file strong { font-size: 10px; }
.attachment-image small, .attachment-file small { margin-top: 2px; color: var(--ink-faint); font-size: 8px; }
.attachment-file { display: grid; width: min(320px, 100%); min-height: 58px; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-decoration: none; }
.attachment-file > span:nth-child(2) { min-width: 0; }
.attachment-file > svg { width: 17px; height: 17px; color: var(--purple); }
.attachment-document { width: min(320px, 100%); min-width: 0; display: grid; gap: 6px; }
.attachment-document .attachment-file { width: 100%; }
.attachment-save { justify-self: start; min-height: 44px; }
.attachment-save-name { overflow-wrap: anywhere; font-weight: 600; }
.attachment-save-modal .modal-footer { flex-wrap: wrap; }
.attachment-save-modal .modal-footer .button { flex: 1 1 100%; }
.attachment-preview-modal { width: min(960px, 100%); height: min(900px, 90dvh); }
.attachment-preview-modal .modal-header { justify-content: flex-start; align-items: center; }
.attachment-preview-modal .modal-header h2 { min-width: 0; overflow-wrap: anywhere; }
.attachment-preview-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.attachment-preview-pages { display: flex; align-items: center; justify-content: center; gap: 16px; position: sticky; top: 0; background: var(--paper); padding: 4px; }
.attachment-preview-pages button { min-width: 44px; min-height: 44px; }
#attachment-preview-content { min-width: 0; width: 100%; }
.attachment-preview-image, .attachment-preview-pdf { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.attachment-preview-pdf { width: 100%; background: white; }
.file-type { display: grid; min-width: 36px; height: 36px; place-items: center; padding: 0 5px; border-radius: 9px; color: #fff; background: var(--coral); font-size: 8px; font-weight: 850; letter-spacing: .04em; }
.file-preview { width: 100%; min-height: 62px; }
.file-preview.has-image > img { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 9px; object-fit: cover; }
.file-preview > span { flex: 1 1 auto; }
.file-preview .icon-button { margin-left: auto; }
.message-kind-badge { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 7px; padding: 4px 7px; border-radius: 999px; color: #695137; background: #f3e8d8; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.message-kind-badge svg { width: 11px; height: 11px; }
.bubble-announcement { border: 1px solid #d8c39e; background: #f7eddd; }
.bubble-important { border: 1px solid #dfaeb4; background: #f8e5e7; }
.message-acknowledgement { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid currentColor; }
.message-acknowledgement > small { flex: 1 1 180px; font-size: 12px; line-height: 1.5; }
.message-acknowledgement > strong { flex: 1 1 auto; font-size: 12px; }
.message-acknowledgement .button { min-height: 38px; }
.acknowledgement-confirmed { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; color: #315445; background: #e4eee7; font-size: 12px; font-weight: 700; }
.acknowledgement-confirmed svg { width: 15px; height: 15px; flex: 0 0 15px; }
.acknowledgement-summary { margin: 0 0 14px; }
.acknowledgement-list { list-style: none; padding: 0; margin: 0; }
.acknowledgement-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.acknowledgement-list li > strong { flex: 1 1 160px; overflow-wrap: anywhere; }
.acknowledgement-list small { flex-basis: 100%; font-weight: 400; }
.acknowledgement-open { padding: 6px 9px; border-radius: 8px; color: var(--ink); background: var(--paper); font-size: 12px; }
.bubble.me.bubble-announcement, .bubble.me.bubble-important { border-color: rgb(255 255 255 / 28%); background: var(--plum-2); }
.bubble.me .message-kind-badge { color: var(--plum); background: var(--yellow); }
.message-event-link { display: grid; width: 100%; grid-template-columns: 17px minmax(0, 1fr) 15px; align-items: center; gap: 7px; margin-top: 9px; padding: 8px; border: 1px solid rgb(143 107 82 / 24%); border-radius: 9px; color: inherit; background: rgb(255 255 255 / 48%); text-align: left; }
.message-event-link > svg { width: 14px; height: 14px; }
.message-event-link span { min-width: 0; }
.message-event-link strong, .message-event-link small { display: block; overflow-wrap: anywhere; }
.message-event-link strong { font-size: 9px; }
.message-event-link small { margin-top: 2px; font-size: 8px; opacity: .72; }

.chat-event-card { position: sticky; z-index: 2; top: 0; display: grid; width: 100%; max-width: 820px; grid-template-columns: 48px minmax(150px, 1fr) auto; align-items: center; gap: 12px; margin: 0 auto 8px; padding: 12px; border: 1px solid #d7c39e; border-radius: 14px; background: #fff8e8; box-shadow: 0 8px 18px rgb(44 35 22 / 8%); }
.chat-event-date { display: flex; width: 48px; height: 50px; flex-direction: column; align-items: center; justify-content: center; border-radius: 11px; color: var(--plum); background: var(--yellow); line-height: 1; }
.chat-event-date strong { font-size: 18px; }
.chat-event-date small { margin-top: 3px; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.chat-event-copy { min-width: 0; }
.chat-event-copy > strong, .chat-event-copy > small { display: block; overflow-wrap: anywhere; }
.chat-event-copy > strong { font-size: 11px; }
.chat-event-copy > small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.chat-event-kicker { display: block; margin-bottom: 3px; color: var(--purple); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.chat-event-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chat-event-responses { display: grid; min-width: min(340px, 100%); gap: 7px; }
.chat-event-response-row { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.chat-event-response-row > span { min-width: 0; }
.chat-event-response-row strong, .chat-event-response-row small { display: block; text-align: right; }
.chat-event-response-row strong { font-size: 9px; }
.chat-event-response-row small { color: var(--ink-soft); font-size: 8px; }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main, .dashboard-side { display: contents; }
  .operations-card { grid-row: 1; grid-column: 1 / -1; }
  .operations-stats { grid-row: 2; grid-column: 1 / -1; }
  .dashboard-side > .quick-card { grid-row: 3; grid-column: 1 / -1; }
  .dashboard-side > .panel:first-child { grid-row: 4; grid-column: 1; }
  .dashboard-side > .panel:nth-child(2) { grid-row: 4; grid-column: 2; }
  .dashboard-main > .panel { grid-row: 5; grid-column: 1 / -1; }
}

@media (max-width: 840px) {
  .operations-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-list-panel { overflow: visible; }
  .people-table { display: none; }
  .people-mobile-list { display: grid; border-top: 1px solid var(--line); }
  .person-detail { order: -1; scroll-margin-top: 14px; }
  .people-layout:not(.is-detail-open) .person-detail { display: none; }
  .people-mobile-item { min-width: 0; }
  .people-mobile-card { display: grid; width: 100%; min-width: 0; min-height: 76px; grid-template-columns: 42px minmax(0, 1fr) auto 16px; align-items: center; gap: 9px; padding: 11px 15px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
  .people-mobile-card:hover, .people-mobile-card.is-selected { background: var(--yellow-soft); }
  .people-mobile-card .avatar { width: 42px; height: 42px; font-size: 14px; line-height: 1; }
  .people-mobile-card > svg { width: 16px; height: 16px; color: var(--ink-faint); }
  .people-mobile-copy { min-width: 0; }
  .people-mobile-copy strong, .people-mobile-copy span, .people-mobile-copy small, .people-mobile-meta small { display: block; }
  .people-mobile-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .people-mobile-copy span { overflow: hidden; margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .people-mobile-copy small { overflow: hidden; margin-top: 4px; color: var(--purple); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .people-mobile-meta { display: grid; justify-items: end; gap: 5px; }
  .people-mobile-meta small { color: var(--ink-faint); font-size: 9px; white-space: nowrap; }
  .chat-event-card { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
  .chat-event-card > .subtle-link { grid-column: 2; justify-self: start; max-width: 100%; padding-inline: 0; text-align: left; }
  .chat-event-card > .chat-event-actions, .chat-event-card > .chat-event-responses { grid-column: 1 / -1; width: 100%; }
  .chat-event-responses { min-width: 0; }
}

@media (max-width: 700px) {
  .modal-layer { --dialog-gap: 8px; }
  .modal { max-height: 100%; border-radius: 17px; }
  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal .form-field.full, .modal .family-fields { grid-column: auto; }
  .modal-footer { justify-content: stretch; }
  .modal-footer .button { flex: 1 1 160px; white-space: normal; }
  .family-fields .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .operations-card, .operations-stats, .dashboard-side > .quick-card, .dashboard-side > .panel:first-child, .dashboard-side > .panel:nth-child(2), .dashboard-main > .panel { grid-column: 1; }
  .operations-card { grid-row: 1; }
  .operations-stats { grid-row: 2; }
  .dashboard-side > .quick-card { grid-row: 3; }
  .dashboard-side > .panel:first-child { grid-row: 4; }
  .dashboard-side > .panel:nth-child(2) { grid-row: 5; }
  .dashboard-main > .panel { grid-row: 6; }
  .operations-heading { padding: 19px 17px 13px; }
  .operations-list { padding-right: 17px; padding-left: 17px; }
  .upcoming-row { grid-template-columns: 50px minmax(0, 1fr) 16px; gap: 10px; padding-right: 5px; padding-left: 5px; }
  .mini-date { width: 50px; }
  .people-mobile-card { grid-template-columns: 42px minmax(0, 1fr) 16px; grid-template-rows: auto auto; }
  .people-mobile-copy { grid-column: 2; }
  .people-mobile-meta { grid-row: 2; grid-column: 2; justify-items: start; }
  .people-mobile-card > svg { grid-row: 1 / 3; grid-column: 3; }
  .people-mobile-copy strong, .people-mobile-copy span, .people-mobile-copy small { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .chat-event-response-row { align-items: stretch; flex-direction: column; }
  .chat-event-response-row strong, .chat-event-response-row small { text-align: left; }
  .chat-event-actions { justify-content: stretch; }
  .chat-event-actions .button { flex: 1 1 120px; }
  .attachment-image, .attachment-file { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Sales-ready responsive and accessibility pass */
:root {
  --brand-accent: #8f6b52;
  --brand-on-accent: #fff;
  --ink-faint: #6f665a;
}

.brand-mark, .studio-avatar, .nav-badge, .button-yellow, .child-switcher button.is-active {
  color: var(--brand-on-accent);
  background: var(--brand-accent);
}

.nav-item.is-active { box-shadow: inset 3px 0 0 var(--brand-accent), inset 0 0 0 1px rgb(255 255 255 / 8%); }
.upload-dropzone:hover, .message-search-result { border-color: var(--brand-accent); }

.brand-mark.has-logo {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 18%);
  background: #fff;
}

.brand-mark.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.workspace { height: 100dvh; overflow-y: auto; }
.view { min-height: 0; }

.messages-page {
  display: grid;
  height: calc(100dvh - 125px);
  min-height: 560px;
  grid-template-rows: auto minmax(0, 1fr);
}

.messages-page > .page-intro { min-height: 0; }
.messages-layout { height: auto; min-height: 0; }
.conversation-sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.conversation-list { min-height: 0; }
.chat-pane { min-height: 0; overflow: hidden; }
.chat-log { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }

.chat-header {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, .72fr) auto;
}

.message-search { display: flex; min-width: 0; align-items: center; gap: 6px; }
.message-search .search-field { min-width: 0; flex: 1 1 auto; }
.message-search .icon-button { width: 34px; height: 34px; flex: 0 0 auto; }
.message-search-results { display: grid; gap: 7px; margin-bottom: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.message-search-result { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; border: 0; border-radius: 9px; color: var(--ink); background: var(--yellow-soft); text-align: left; }
.message-search-result strong, .message-search-result small { display: block; overflow-wrap: anywhere; }
.message-search-result strong { font-size: 12px; }
.message-search-result small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }

.message-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.message-actions button { padding: 2px 0; border: 0; color: currentColor; background: transparent; font-size: 11px; font-weight: 700; opacity: .72; }
.message-actions button:hover { text-decoration: underline; opacity: 1; }
.bubble-deleted { color: var(--ink-soft); background: #f0ece5; font-style: italic; }
.bubble.me.bubble-deleted { color: #efe9e1; background: var(--plum-2); }
.bubble.is-highlighted { outline: 3px solid rgb(216 182 126 / 62%); outline-offset: 2px; }
.search-result-heading { align-self: center; padding: 6px 10px; border-radius: 999px; color: var(--ink-soft); background: var(--yellow-soft); font-size: 12px; font-weight: 750; }

.message-composer > .file-preview-list,
.message-composer > .composer-files {
  width: 100%;
  max-height: 164px;
  flex: 1 0 100%;
  overflow-y: auto;
  padding: 0 0 5px;
}

.conversation-copy strong, .chat-person h2 { font-size: 13px; }
.conversation-copy span, .chat-person p, .conversation-info { font-size: 11px; }
.bubble { font-size: 15px; }
.bubble .bubble-time, .chat-date, .bubble-sender { font-size: 11px; }
.attachment-image strong, .attachment-file strong, .message-event-link strong { font-size: 12px; }
.attachment-image small, .attachment-file small, .message-event-link small { font-size: 10px; }
.message-kind-badge { font-size: 10px; }
.field-label, .upload-dropzone strong { font-size: 12px; }
.upload-dropzone small { font-size: 11px; }
.attachment-chip, .attachment-link, .file-preview, .message-attachment { font-size: 11px; }
.attachment-chip small, .file-preview small, .attachment-size { font-size: 10px; }
.eyebrow { color: #725431; font-size: 12px; }
.page-intro p:not(.eyebrow) { color: #554d43; }
.button-small, .subtle-link { font-size: 12px; }
.form-field label, .field-label { font-size: 12px; }
.form-field input, .form-field select, .form-field textarea { font-size: 13px; }
.people-table th { font-size: 11px; }
.people-table td, .table-person strong { font-size: 13px; }
.table-person span:not(.avatar), .contact-row, .assignment-row span, .team-row-copy span { font-size: 11px; }
.assignment-row strong, .permission-row strong, .participant-info-row strong { font-size: 12px; }
.course-pill, .status-pill, .role-tag { font-size: 10px; }
.chat-event-copy > strong { font-size: 13px; }
.chat-event-copy > small, .chat-event-response-row strong { font-size: 11px; }
.chat-event-kicker, .chat-event-response-row small { font-size: 10px; }

.event-month { padding: 4px 0 12px; }
.event-month + .event-month { margin-top: 7px; border-top: 1px solid var(--line); }
.event-month > h3 { margin: 0; padding: 15px 10px 8px; color: var(--ink); font-size: 17px; letter-spacing: -.025em; }
.calendar-title > div { min-width: 0; }
.calendar-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.event-description { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.event-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.event-tags i { padding: 2px 6px; border-radius: 999px; color: #695137; background: var(--yellow-soft); font-size: 9px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.calendar-more { display: flex; width: calc(100% - 20px); margin: 12px auto 4px; justify-content: center; }
.upcoming-row.is-cancelled { opacity: .72; }
.upcoming-row.is-deep-linked { outline: 3px solid rgb(216 182 126 / 48%); outline-offset: -3px; background: #fff8e8; }
.upcoming-copy strong { font-size: 14px; }
.upcoming-copy span { font-size: 12px; }
.mini-date span { font-size: 10px; }

.event-detail-list { display: grid; gap: 9px; }
.event-detail-list > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.event-detail-list > div > svg { width: 18px; height: 18px; color: var(--brand-accent); }
.event-detail-list strong, .event-detail-list small { display: block; overflow-wrap: anywhere; }
.event-detail-list strong { font-size: 12px; }
.event-detail-list small { margin-top: 2px; color: var(--ink-soft); font-size: 12px; }
.modal-event-detail .rsvp-actions { margin-top: 16px; }

.customer-operations { display: flex; flex-wrap: wrap; gap: 8px; }
.customer-operations .button { min-width: 0; white-space: normal; }
.customer-access-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; grid-column: 1 / -1; }
.customer-access-actions .button { width: 100%; justify-content: center; }
.notification-list, .audit-list { display: grid; align-content: start; grid-auto-rows: max-content; gap: 7px; }
.notification-row, .audit-row { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; }
.audit-row { grid-template-columns: 34px minmax(0, 1fr); }
.notification-row.is-unread { border-color: #d2b476; background: #fff8e8; }
.notification-row > svg { width: 16px; height: 16px; align-self: center; }
.notification-row > span:nth-child(2), .audit-row > span:nth-child(2) { min-width: 0; }
.notification-row strong, .notification-row small, .notification-row time,
.audit-row strong, .audit-row small, .audit-row time { display: block; overflow-wrap: anywhere; }
.notification-row strong, .audit-row strong { font-size: 12px; }
.notification-row small, .audit-row small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.notification-row time, .audit-row time { margin-top: 5px; color: var(--ink-faint); font-size: 10px; }

.form-busy-status { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.form-busy-status .loading-ring { width: 20px; height: 20px; border-width: 2px; }
.modal-footer .form-busy-status { flex: 1 0 100%; justify-content: flex-end; }
.message-composer > .form-busy-status { width: 100%; flex: 1 0 100%; order: -1; justify-content: flex-start; padding: 2px 4px; }
.search-more { align-self: center; margin: 4px auto 10px; }
.subtle-link { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 5px 8px; border: 0; border-radius: 8px; color: var(--brand-accent); background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.subtle-link:hover { background: color-mix(in srgb, var(--brand-accent) 9%, transparent); }
.subtle-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-accent) 28%, transparent); outline-offset: 2px; }

@media (max-width: 1180px) {
  .messages-page { height: calc(100dvh - 120px); }
  .chat-header { grid-template-columns: minmax(180px, 1fr) minmax(170px, .65fr) auto; padding-right: 15px; padding-left: 15px; }
}

@media (max-width: 840px) {
  .workspace { height: auto; min-height: 100dvh; overflow: visible; }
  .messages-page { height: calc(100dvh - 160px); min-height: 540px; }
  .messages-layout { height: auto; min-height: 0; }
  .chat-header { grid-template-columns: minmax(150px, 1fr) minmax(170px, .75fr) auto; }
  .chat-header .chat-actions { display: flex; }
  .conversation-sidebar { overflow-y: auto; }
}

@media (max-width: 700px) {
  .chat-header { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .message-search { grid-row: 2; grid-column: 1 / -1; }
  .chat-actions { grid-row: 1; grid-column: 2; }
  .chat-header .chat-actions .status-pill { display: none; }
  .event-month > h3 { padding-right: 5px; padding-left: 5px; }
}

@media (max-width: 600px) {
  .messages-page { height: calc(100dvh - 170px); min-height: 520px; }
  .messages-page > .page-intro { margin-bottom: 10px; }
  .messages-page > .page-intro > div > p:not(.eyebrow) { display: none; }
  .messages-layout {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 190px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  .conversation-sidebar { max-height: none; margin: 0; padding: 10px 9px 6px; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .conversation-title-row { padding-bottom: 8px; }
  .conversation-list { display: flex; max-height: 77px; gap: 7px; overflow-x: auto; overflow-y: hidden; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .conversation-list.conversation-groups { max-height: 103px; gap: 14px; align-items: flex-start; }
  .conversation-group { flex: 0 0 auto; min-width: 0; }
  .conversation-group-title { position: sticky; left: 0; width: max-content; padding: 5px 7px; font-size: 11px; }
  .conversation-group-items { display: flex; gap: 7px; }
  .conversation-item { min-width: 176px; scroll-snap-align: start; }
  .conversation-section { display: none; }
  .chat-pane { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat-log { min-height: 0; padding: 14px 12px; }
  .chat-header { min-height: 0; padding: 10px 11px; }
  .chat-person .avatar { width: 34px; height: 34px; }
  .message-search .icon-button { width: 44px; height: 44px; }
  .message-composer { gap: 7px; padding: 9px; padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .bubble { max-width: 88%; }
  .chat-event-card { position: relative; top: auto; padding: 10px; }
  .upcoming-row { min-height: 88px; }
  .upcoming-copy strong { font-size: 13px; }
  .upcoming-copy span { font-size: 11px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-toolbar > .button { width: 100%; justify-content: center; }
  .customer-operations { display: grid; grid-template-columns: 1fr; }
  .customer-operations .button { width: 100%; justify-content: center; }
}

.file-button:has(+ input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }

.chat-back, .chat-search-toggle { display: none; }

/* On phones, the conversation list and the selected chat each use one screen. */
@media (max-width: 700px) {
  .app-shell.is-messages { position: fixed; inset: var(--chat-viewport-top, 0px) 0 auto; height: var(--chat-viewport-height, 100dvh); min-height: 0; overflow: hidden; }
  .is-messages .workspace { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: calc(16px + var(--safe-area-top)) max(0px, env(safe-area-inset-right)) calc(68px + env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left)); overflow: hidden; }
  .is-messages .topbar { flex: 0 0 auto; position: static; min-height: 60px; margin: 0; padding: 8px 12px; }
  .is-messages .view { display: flex; flex: 1; width: 100%; max-width: none; min-height: 0; margin: 0; }
  .is-messages .messages-page { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
  .is-messages .messages-page > .page-intro { flex: 0 0 auto; margin: 0; padding: 0 12px 12px; }
  .is-messages .messages-page > .page-intro h1 { font-size: 30px; }
  .is-messages .messages-layout { display: flex; flex: 1; width: 100%; height: auto; min-height: 0; border-right: 0; border-left: 0; border-bottom: 0; border-radius: 0; box-shadow: none; }
  .is-messages .conversation-sidebar { flex: 1; width: 100%; min-height: 0; max-height: none; margin: 0; padding: 0 8px 12px; overflow-y: auto; overflow-x: hidden; border: 0; border-radius: 0; box-shadow: none; scrollbar-gutter: auto; }
  .is-messages .conversation-title-row { display: none; }
  .is-messages .conversation-sidebar > .search-field { margin: 10px 4px 0; }
  .is-messages .conversation-list.conversation-groups { display: block; max-height: none; padding: 0; overflow: visible; scroll-snap-type: none; }
  .is-messages .conversation-group-title { position: static; width: auto; padding: 17px 8px 7px; font-size: 12px; }
  .is-messages .conversation-group-items { display: block; }
  .is-messages .conversation-item { display: grid; width: 100%; min-width: 0; min-height: 76px; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 8px; scroll-snap-align: none; border-radius: 10px; }
  .is-messages .conversation-item + .conversation-item { border-top: 1px solid var(--line); }
  .is-messages .conversation-item:is(.is-selected, :hover) { background: transparent; }
  .is-messages .conversation-item .avatar { width: 44px; height: 44px; font-size: 12px; }
  .is-messages .conversation-copy, .is-messages .conversation-info { display: block; }
  .is-messages .conversation-copy strong { font-size: 15px; }
  .is-messages .conversation-copy span { margin-top: 5px; font-size: 13px; }
  .is-messages .conversation-info { align-self: start; padding-top: 3px; font-size: 11px; }
  .is-messages .conversation-mobile-label, .is-messages .conversation-mobile-unread { display: none; }
  .is-messages .chat-pane { display: none; }
  .is-messages.is-chat-open .sidebar, .is-messages.is-chat-open .topbar, .is-chat-open.messages-page > .page-intro, .is-chat-open.messages-page .conversation-sidebar { display: none; }
  .is-messages.is-chat-open .workspace { padding-bottom: 0; }
  .is-chat-open.messages-page .messages-layout { border-top: 0; }
  .is-chat-open.messages-page .chat-pane { display: grid; flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .is-messages .chat-header { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 7px; min-height: 68px; padding: 7px 8px; background: var(--paper); }
  .is-messages .chat-person { align-items: flex-start; gap: 7px; }
  /* Align the first title line with the 44 px controls; wrapping grows downward. */
  .is-messages .chat-person > div { min-width: 0; padding-top: 13px; }
  .is-messages .chat-person h2 { overflow-wrap: anywhere; font-size: 15px; line-height: 18px; }
  .is-messages .chat-person p { font-size: 11px; line-height: 1.3; }
  .is-messages .chat-person .avatar { width: 36px; height: 36px; flex: 0 0 36px; margin-top: 4px; }
  .is-messages .chat-participants-trigger { display: flex; align-items: flex-start; margin-top: 0; padding: 2px 0 0; line-height: 20px; }
  .is-messages .chat-back, .is-messages .chat-search-toggle { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .is-messages .chat-back { width: 34px; border: 0; background: transparent; }
  .is-messages .chat-actions { display: flex; gap: 4px; }
  .is-messages .chat-header .status-pill { display: none; }
  .is-messages .message-search { display: none; }
  .is-messages .is-chat-search-open .message-search { display: flex; grid-column: 1 / -1; grid-row: 2; }
  .is-messages .chat-header:has(.chat-course-links) {
    grid-template-columns: 34px 36px minmax(0, 1fr) auto;
    row-gap: 0;
  }
  .is-messages .chat-person:has(.chat-course-links),
  .is-messages .chat-person > div:has(.chat-course-links) { display: contents; }
  .chat-person:has(.chat-course-links) .chat-back { grid-area: 1 / 1; }
  .chat-person:has(.chat-course-links) .avatar { grid-area: 1 / 2; }
  .chat-person:has(.chat-course-links) h2 { grid-area: 1 / 3; padding-top: 13px; }
  .chat-person:has(.chat-course-links) p { grid-area: 2 / 3 / auto / -1; }
  .is-messages .chat-header:has(.chat-course-links) .chat-actions { grid-area: 1 / 4; }
  .is-messages .chat-course-links { grid-area: 3 / 2 / auto / -1; flex-wrap: nowrap; align-items: flex-start; }
  .is-messages .chat-header:has(.chat-course-links) .message-search { grid-row: 4; }
  .is-messages .chat-log { min-height: 0; padding: 14px 8px; scrollbar-gutter: auto; -webkit-overflow-scrolling: touch; }
  .is-messages .bubble { max-width: 92%; overflow-wrap: anywhere; }
  .is-messages .message-composer { gap: 6px; padding: 8px 6px max(8px, env(safe-area-inset-bottom)); background: var(--paper); }
  .is-messages .message-composer textarea { min-width: 0; min-height: 52px; height: 52px; max-height: min(160px, 28dvh); padding: 13px 10px; resize: none; font-size: 16px; line-height: 24px; }
  .is-messages .message-composer .file-preview-list { max-height: min(130px, 20dvh); }
  .is-messages .moderated-note { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
}

/* Authenticator setup uses only local markup; secrets never leave this page. */
.mfa-profile { margin-top: 20px; padding: 22px; }
.mfa-profile h2 { margin: 0 0 8px; font-size: 19px; }
.mfa-profile p, .mfa-modal p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.mfa-profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mfa-modal h1 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; }
.mfa-modal .auth-form { margin-top: 20px; }
.mfa-secret { display: grid; gap: 12px; margin: 20px 0 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f5f0e8; }
.mfa-secret > span { font-size: 12px; font-weight: 700; }
.mfa-secret code { overflow-wrap: anywhere; user-select: all; font-size: 16px; line-height: 1.6; color: #1b1813; }
.mfa-secret button { color: var(--ink); justify-self: start; min-height: 32px; }
.mfa-app-link { display: inline-flex; align-items: center; min-height: 44px; }
.mfa-help { margin-top: 14px; font-size: 12px; color: var(--ink-soft); }
.mfa-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 20px 0; padding: 14px; list-style: none; background: #f5f0e8; border-radius: 12px; }
.mfa-recovery-codes code { overflow-wrap: anywhere; user-select: all; font-size: 13px; color: #1b1813; }
.mfa-saved-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; }
.mfa-saved-check input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; }
@media (max-width: 480px) { .mfa-profile-actions { flex-direction: column; } .mfa-profile-actions .button { width: 100%; } }

.mfa-qr { display: block; width: min(100%, 232px); height: auto; margin: 18px auto; image-rendering: pixelated; }

.user-card .icon-button { color: var(--ink); }

.guardian-contact > [data-action="open-initial-password"] { margin-top: 12px; }
.initial-password-slip { padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.initial-password-slip h3 { margin: 0 0 10px; }
.initial-password-slip dt { margin-top: 14px; font-weight: 700; }
.initial-password-slip dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.initial-password-slip code { font-size: 16px; user-select: all; }
.initial-password-slip p { font-size: 13px; line-height: 1.6; }
.initial-password-owner-note { color: var(--ink-soft); font-size: 12px; }

@media print {
  body:has(.initial-password-modal) { background: #fff; }
  body:has(.initial-password-modal) .app-shell,
  body:has(.initial-password-modal) .skip-link,
  body:has(.initial-password-modal) #toast-region,
  .initial-password-modal .modal-header,
  .initial-password-modal .modal-footer,
  .initial-password-modal .initial-password-owner-note { display: none !important; }
  .modal-layer:has(.initial-password-modal) { position: static; display: block; width: auto; height: auto; padding: 0; background: none; backdrop-filter: none; }
  .initial-password-modal, .initial-password-modal .modal-body { display: block; width: 100%; max-height: none; padding: 0; overflow: visible; border: 0; background: #fff; box-shadow: none; }
  .initial-password-slip { break-inside: avoid; color: #000; border-color: #777; }
}

.occurrence-week { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.is-file-drop { outline: 2px dashed #abaf6a; outline-offset: -4px; background-color:#f2f1e6; }
button.agenda-row { width:100%; text-align:left; font:inherit; color:inherit; background:transparent; }

.course-occurrences-modal .agenda-row { grid-template-columns: minmax(0,1fr) auto; gap:16px; }
@media (max-width:540px) { .course-occurrences-modal .agenda-row { grid-template-columns:1fr; } .course-occurrences-modal .agenda-row > .button { width:100%; } .occurrence-week > span { order:-1; width:100%; text-align:center; } }

/* Error toasts, account status of contacts, message line breaks */
.toast span { white-space: pre-line; }
.toast.is-error { border-color: #e5b8bd; background: #5c2430; pointer-events: auto; }
.toast.is-error svg { color: #ffd2d7; }
.toast.is-error > div { flex: 1; min-width: 0; }
.toast.is-error span { color: #f5dfe2; }
.toast-close { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -7px -7px -7px 0; padding: 0; border: 0; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; }
.toast-close:focus-visible { outline: 2px solid #ffd2d7; outline-offset: 1px; }
.auth-alert, .app-alert, .error-message { white-space: pre-line; }
.status-pill.is-pending { color: #8a5a12; background: var(--yellow-soft); }
.filter-chip[aria-pressed="true"] { border-color: #d6c6ed; color: var(--purple); background: #f0eafa; }
.filter-chip b { margin-left: 3px; font-weight: 800; }
.people-list-panel > .empty-inline { margin: 0 19px 16px; }
.contact-access { display: grid; justify-items: start; gap: 7px; margin-top: 9px; }
.contact-access-hint { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.bubble p.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-subject { display: block; margin-bottom: 3px; font-weight: 800; }
@media (max-width: 840px) {
  .filter-row { flex-wrap: wrap; }
  .filter-row .search-field { flex: 1 1 100%; }
  .filter-chip { min-height: 40px; }
  .contact-access-hint { font-size: 12px; }
}

/* Phone: back from the participant details to the list */
.detail-back-to-list { display: none; }
@media (max-width: 840px) {
  .detail-back-to-list { display: inline-flex; gap: 4px; min-height: 44px; margin: -8px 0 6px -8px; }
  .detail-back-to-list svg { width: 16px; height: 16px; }
}
.chat-participant-hint { margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.home-pending-rsvp { display: flex; width: 100%; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--yellow-soft); text-align: left; cursor: pointer; }
.home-pending-rsvp > span { display: grid; flex: 1; gap: 2px; min-width: 0; }
.home-pending-rsvp small { color: var(--ink-soft); }
.home-pending-rsvp svg { width: 17px; height: 17px; flex: 0 0 auto; }
.field-hint { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.data-request { margin-top: 18px; padding: 20px; }
.data-request h2 { margin: 0 0 6px; font-size: 16px; }
.data-request p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.5; }
.data-request .quick-actions { align-items: center; }
.settings-log { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 18px 20px; }
.settings-log h2 { margin: 0 0 4px; font-size: 16px; }
.settings-log p { margin: 0; color: var(--ink-soft); }
.audit-more { width: 100%; margin-top: 12px; }
@media (max-width: 600px) { .settings-log { align-items: stretch; flex-direction: column; } }
.home-holiday { background: var(--sky); }

/* Links to the privacy notice in the app style instead of browser blue */
.privacy-notice-link, .privacy-note a { color: var(--brand-accent); font-weight: 750; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.privacy-notice-link:focus-visible, .privacy-note a:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 3px; }

/* Launch-Check Paket 5: Kontrast nach WCAG AA (mind. 4,5:1) */
.button-danger { color: #9e3a30; }
/* Abgesagte Termine: durchgestrichen statt verblasst (opacity senkte den Kontrast) */
.upcoming-row.is-cancelled { opacity: 1; }
.upcoming-copy em { color: #9b3a44; }
.is-selected .table-person span:not(.avatar), .people-mobile-card.is-selected .people-mobile-meta small { color: var(--ink-soft); }
.people-mobile-card.is-selected .people-mobile-copy small { color: #6b5236; }
.filter-chip.is-active, .filter-chip[aria-pressed="true"] { color: #6b5236; }

/* A phone keyboard leaves little room: reserve it for the form, not chrome. */
@media screen and (max-width: 840px), screen and (max-height: 500px) {
  .modal-layer { overflow: clip; -webkit-backdrop-filter: none; backdrop-filter: none; touch-action: pan-y pinch-zoom; }
  .modal-header { background: var(--paper); }
  .modal-body { touch-action: pan-y pinch-zoom; }
  .modal-layer:has(.modal > form) { --dialog-gap: 4px; }
  .modal:has(> form) { width: 100%; height: 100%; max-height: 100%; border-radius: 14px; }
  .modal:has(> form) .modal-header { align-items: center; gap: 8px; padding: 8px 12px; }
  .modal:has(> form) .modal-header h2 { font-size: 18px; line-height: 1.2; }
  .modal:has(> form) .modal-header p { font-size: 12px; line-height: 1.3; }
  .modal > form > .modal-body { padding: 8px 12px 16px; }
  .modal > form > .modal-body > .form-grid { margin-top: 0; gap: 12px; }
  .modal .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .modal .form-field select, .modal .form-field textarea, .modal .search-field input { font-size: 16px; line-height: 1.25; }
  .modal > form > .modal-footer { gap: 6px; padding: 8px 12px; }
  .modal > form > .modal-footer .button { flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 44px; padding: 8px; font-size: 13px; line-height: 1.3; white-space: normal; }
  .modal-compose > form > .modal-footer .button-secondary { flex: 0 0 auto; padding-inline: 12px; }
  .modal-compose > form > .modal-footer .button-primary { flex: 1 1 0; }
  .modal-compose #message-body { min-height: clamp(120px, calc(var(--dialog-viewport-height, 100dvh) * .42), 220px); }
}

/* Compact mobile forms; navigation and primary actions retain 44 px targets. */
@media screen and (max-width: 840px), screen and (max-height: 500px) and (pointer: coarse) {
  .modal-layer, .modal-layer:has(.modal > form) { --dialog-gap: 0px; padding: calc(var(--safe-area-top) + 16px) var(--safe-area-right) var(--dialog-safe-bottom, var(--safe-area-bottom)) var(--safe-area-left); background: var(--paper); }
  .agenda-row:has(> .activity-symbol) { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 10px; }
  .agenda-row > .activity-symbol { width: 32px; height: 32px; border-radius: 9px; }
  .agenda-row > .activity-symbol svg { width: 18px; height: 18px; }
  .modal, .modal:has(> form) { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .modal > .modal-body { flex: 1 1 auto; }
  .app-shell:has(~ .modal-layer) { visibility: hidden; }
  .app-shell:has(~ .modal-layer) > .sidebar { display: none; }
  body:has(.modal-layer) { background: var(--paper); }
  .dialog-back-button > svg { display: none; }
  .dialog-back-icon { display: grid; place-items: center; }
  .modal-header > div:first-child { flex: 1; }
  .modal-header .dialog-keyboard-done { display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 700; padding: 0; }
  .dialog-keyboard-done:disabled { opacity: .45; cursor: default; }
  .sidebar, .auth-card, .state-card, .modal-layer { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar { background: #1b1813; }
  .auth-card, .state-card { background: var(--paper); }
  .view .button { min-height: 44px; padding: 7px 10px; gap: 6px; font-size: 12px; }
  .page-intro { gap: 10px; margin-bottom: 12px; }
  .page-intro > .button { width: auto; max-width: 100%; }
  .customer-operations { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .customer-operations .button { min-width: 0; }
  .modal .modal-header, .modal:has(> form) .modal-header { gap: 8px; padding: 6px 10px; }
  .modal .modal-header:has(.dialog-back-button) { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: start; row-gap: 0; padding-block: 2px; }
  .modal.responses-modal .modal-header:has(.dialog-back-button) { padding-top: 14px; }
  .modal-header:has(.dialog-back-button) > div:first-child { display: contents; }
  .modal-header:has(.dialog-back-button) h2 { grid-column: 2; grid-row: 1; padding-top: 13px; overflow-wrap: anywhere; }
  .modal-header:has(.dialog-back-button) p { grid-column: 1 / -1; grid-row: auto; margin: 12px 0 0; overflow-wrap: anywhere; }
  .modal-header .dialog-keyboard-done { grid-column: 3; grid-row: 1; }
  .modal-header > .dialog-back-button { grid-column: 1; grid-row: 1; }
  .modal .modal-header h2, .modal:has(> form) .modal-header h2 { font-size: 14px; line-height: 18px; }
  .modal .modal-header p, .modal:has(> form) .modal-header p { font-size: 11px; line-height: 1.3; }
  .modal .modal-body, .modal > form > .modal-body { padding: 14px 10px 10px; }
  .modal .form-grid, .modal > form > .modal-body > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; }
  .modal .form-grid > .form-field, .modal .form-grid > .family-fields { grid-column: 1 / -1; }
  .modal .form-grid > .form-field:has(> input[type="date"], > input[type="time"], > #participant-first-name, > #participant-last-name, > #edit-member-role, > #edit-member-status) { grid-column: auto; }
  .modal .form-field { gap: 6px; }
  .modal .form-field > label, .modal .field-label { font-size: 11px; }
  .modal .field-hint, .modal .form-field > span { font-size: 11px; line-height: 1.3; }
  .modal .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not(.sr-only), .modal .form-field select, .modal .form-field textarea { min-height: 32px; padding: 5px 8px; border-radius: 8px; }
  .modal .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not(.sr-only), .modal .form-field select { height: 32px; }
  .modal .form-field select { appearance: none; -webkit-appearance: none; padding-right: 28px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%235b5c55' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 14px 14px; }
  .modal .form-field textarea { min-height: 64px; }
  .modal .search-field { border-radius: 8px; }
  .modal .search-field input { min-height: 32px; height: 32px; }
  .modal #event-audience, .modal #recipient { width: min(100%, 18rem); padding-block: 4px; }
  .modal input[type="date"], .modal input[type="time"] { display: block; appearance: none; -webkit-appearance: none; min-inline-size: 0; inline-size: 100%; max-inline-size: 100%; text-align: left; }
  .modal input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
  .modal .family-fields { padding: 10px; }
  .modal .assignment-row { min-height: 44px; padding: 7px 8px; }
  .modal .assignment-row strong, .modal .upload-dropzone strong { font-size: 11px; }
  .modal .upload-dropzone { min-height: 56px; gap: 8px; padding: 8px; }
  .modal .modal-footer, .modal > form > .modal-footer { gap: 6px; padding: 6px 10px; }
  .modal .modal-footer .button, .modal > form > .modal-footer .button { flex: 1 1 calc(50% - 6px); min-width: 0; min-height: 44px; padding: 7px 8px; font-size: 12px; line-height: 1.25; white-space: normal; }
  /* Keep native controls readable without focus zoom, including future forms. */
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea, [contenteditable="true"] { font-size: 16px !important; }
}

@media (max-width: 840px) {
  .subtle-link, .panel-header .subtle-link { min-width: 44px; min-height: 44px; padding: 8px 10px; }
  .auth-card .legal-links a { min-width: 44px; min-height: 44px; justify-content: center; }
  .privacy-notice-link, .privacy-note a { display: inline-flex; min-height: 44px; align-items: center; }
  .is-messages .chat-back { width: 44px; }
  /* Tag antippen, dann „Termin anlegen“ oben: kein 28-px-Plus direkt unter dem Tag */
  .month-day-add { display: none; }
  .month-day:has(.month-day-add) .month-day-select { width: 100%; }
  input[type="color"] { height: 44px; padding: 4px; }
  .message-actions button { min-height: 44px; padding: 0 8px; }
  .people-mobile-copy small, .people-mobile-meta small { font-size: 11px; }
  .filter-chip { min-width: 44px; min-height: 44px; }
}

/* Launch-Check Paket 5: Dateiname eigener Bildanhänge lesbar (vorher weiß auf weiß) */
.attachment-image { color: var(--ink); }
/* Toasts im offenen Dialog oben, damit sie „Speichern“ und „Abbrechen“ nicht verdecken */
body:has(.modal-layer) .toast-region { top: 12px; bottom: auto; }

/* Launch-Check Paket 5: Hinweistexte im Formular klein, Nachbarfelder nicht gestreckt */
.form-field .field-hint { display: block; margin-top: 5px; }
.form-grid { align-items: start; }
.course-card-footer .is-over-capacity { color: #9e3a30; }

.attendance-delete-section { display: grid; gap: 16px; margin-top: 20px; }
.attendance-delete-section .check-row { display: flex; align-items: flex-start; gap: 12px; }
.attendance-delete-section input[type="checkbox"] { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 3px; }
/* A native search cancel control is not consistently available on mobile. */
.customer-search { min-width: 0; padding-right: 0; overflow: hidden; }
.customer-search input { min-width: 0; flex: 1; }
.customer-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.customer-search [data-clear-participant-search] { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; }
.customer-search [data-clear-participant-search]:hover { transform: none; }
.customer-search [data-clear-participant-search][hidden] { display: none; }
.selected-recipients { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.selected-recipients:empty { display: none; }
.selected-recipients li { display: flex; align-items: center; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.selected-recipients li > span { min-width: 0; padding-left: 12px; overflow-wrap: anywhere; }
.selected-recipients button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; }
.selected-recipients button:hover { background: var(--lavender); }
.selected-recipients button svg { width: 18px; height: 18px; }

/* Disable mobile page zoom while retaining the normal page and dialog scrolling. */
@media (max-width: 840px), (max-height: 500px) and (pointer: coarse) {
  html, body, .modal-layer, .modal-body { touch-action: pan-x pan-y; }
}
/* Calendar subscriptions use the existing scrolling modal, including on iOS. */
.calendar-page-actions { flex-wrap: wrap; }
.subscription-body { display: grid; gap: 18px; }
.subscription-body > p, .subscription-warning p { margin: 0; }
.subscription-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.subscription-choices .button { white-space: normal; height: auto; }
.subscription-copy { display: flex; gap: 8px; align-items: stretch; }
.subscription-copy input { flex: 1; width: 0; min-width: 0; }
.subscription-links { display: grid; gap: 14px; }
.subscription-warning, .subscription-confirm { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.subscription-guide { overflow-wrap: anywhere; }
.subscription-guide h3 { margin-top: 0; }
.subscription-guide li + li { margin-top: 8px; }
.subscription-guide a:not(.button) { text-decoration: underline; }
.subscription-guide a.button[href^="webcal:"] { color: #fff; background: #237a43; box-shadow: 0 7px 15px rgb(35 122 67 / 18%); }
.subscription-guide a.button[href^="webcal:"]:is(:hover, :focus-visible) { background: #1b6336; }
@media (max-width: 600px) {
  .subscription-choices { grid-template-columns: 1fr; }
  .calendar-page-actions { width: 100%; }
  .calendar-page-actions .button { flex: 1; }
}

.choreography-page { max-width: 48rem; margin: 0 auto; padding: max(1.5rem, env(safe-area-inset-top)) 1rem 3rem; }
@media (max-width: 767px), (pointer: coarse) {
  .choreography-page { padding-top: calc(var(--safe-area-top) + 3.5rem); padding-left: max(1rem, var(--safe-area-left)); padding-right: max(1rem, var(--safe-area-right)); }
}
.choreography-page a { display: inline-block; padding: .7rem 0; color: var(--ink); text-decoration: underline; }
.choreography-page header { margin: 1.5rem 0; }
.choreography-page header p { color: var(--ink-soft); margin: 0 0 .35rem; }
.choreography-page h1 { font: 600 clamp(2rem, 7vw, 3rem)/1.1 var(--serif); margin: 0; }
.choreography-page section { margin: 1rem 0; border: 1px solid var(--line); background: var(--paper); padding: 1rem; border-radius: var(--radius-md); }
.choreography-page h2 { font-size: 1rem; overflow-wrap: anywhere; margin: 0 0 .75rem; }
.choreography-page video { display: block; width: 100%; max-height: 70vh; background: #111; border-radius: 8px; }

#video-upload { display: grid; justify-items: start; gap: .75rem; margin: 1rem 0; }
#video-upload input { max-width: 100%; }
#video-upload video[hidden] { display: none; }
#video-progress { display: block; width: min(100%, 24rem); margin: .25rem 0; accent-color: var(--brand, #6e7d42); }
#video-progress[hidden] { display: none; }
.choreography-page [data-trash] { margin-top: .75rem; }

/* Optional account thumbnails; no original image or enlargement action. */
.avatar { position: relative; overflow: hidden; }
.avatar > img[data-profile-picture] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.profile-settings-side { display: grid; align-content: start; gap: 16px; min-width: 0; }
.profile-picture-panel { padding: 18px; margin: 0; min-width: 0; }
.profile-picture-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.profile-picture-heading > .avatar { width: 48px; height: 48px; flex: 0 0 48px; }
.profile-picture-panel h2 { margin: 0 0 12px; text-align: left; }
.profile-picture-panel p { margin: 0; color: var(--ink-soft); line-height: 1.45; }
#profile-picture-hint { font-size: 10px; line-height: 1.4; }
#profile-picture-selection { font-size: 11px; overflow-wrap: anywhere; }
#profile-picture-form { display: grid; gap: 8px; }
#profile-picture-file { max-width: 100%; min-width: 0; }
.profile-picture-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-picture-status:empty, #profile-picture-selection:empty { display: none; }

.event-target-list { max-height: 17rem; overflow-y: auto; }
.event-target-list [hidden] { display: none; }
.event-target-summary { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.event-target-summary[hidden] { display: none; }
.event-target-summary h3 { margin: 0 0 8px; font-size: 14px; }
.event-target-summary > div + div { margin-top: 16px; }
.event-target-summary ul { margin: 0; padding: 0; list-style: none; }
.event-target-summary li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.event-target-summary li + li { border-top: 1px solid var(--line); }
.event-target-summary li > span { min-width: 0; overflow-wrap: anywhere; }
.event-target-summary li > button { flex-shrink: 0; }
