:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
  color: var(--text);
  background: var(--canvas);
  --text: light-dark(#24372d, #e7ece9);
  --canvas: light-dark(#f8f7f0, #111513);
  --paper: light-dark(#fffefa, #1a201d);
  --muted: light-dark(#56665c, #abbab0);
  --line: light-dark(#dfe3d9, #3b4841);
  --control-line: light-dark(#a8b6aa, #6a7c71);
  --forest: color-mix(in srgb, var(--stall-accent, #224636) 38%, #121714);
  --forest-dark: light-dark(
    color-mix(in srgb, var(--stall-accent, #275942) 38%, #101613),
    color-mix(in srgb, var(--stall-accent, #275942) 23%, #0d110f)
  );
  --sidebar-hover: color-mix(in srgb, var(--forest-dark) 79%, white);
  --primary-hover: color-mix(in srgb, var(--forest) 94%, white);
  --focus: light-dark(#35608a, #9ac8f4);
  --tint: color-mix(in srgb, var(--stall-accent, #668568) 8%, var(--paper));
  --accent: color-mix(in srgb, var(--stall-accent, #668568) 19%, var(--paper));
  --accent-line: color-mix(in srgb, var(--stall-accent, #668568) 40%, var(--control-line));
  --accent-ink: color-mix(in srgb, var(--stall-accent, #668568) 14%, var(--text));
  --success-fill: light-dark(#e6f0e1, #263d2b);
  --success-ink: light-dark(#204931, #bee4c4);
  --inactive-fill: light-dark(#f4efe9, #36302c);
  --inactive-ink: light-dark(#6a6159, #d9cabc);
  --danger-fill: light-dark(#faece6, #46272a);
  --danger-ink: light-dark(#8a362d, #ffb8b6);
  --radius: 14px;
  font-synthesis: none;
}
:root[data-appearance="light"] { color-scheme: light; }
:root[data-appearance="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Georgia, serif; font-weight: 600; font-size: clamp(2rem, 3.25vw, 3.05rem); letter-spacing: -.045em; line-height: 1.06; }
h2 { font-size: 1.13rem; letter-spacing: -.02em; }
small, .small { font-size: .81rem; }
.muted { color: var(--muted); }
.loading { padding: 2rem; color: var(--muted); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; align-self: start; position: sticky; top: 0; min-height: 100vh; background: var(--forest-dark); color: #f1f5eb; padding: 29px 17px 21px; }
.sidebar-menu { display: flex; flex: 1; flex-direction: column; }
.sidebar .menu-toggle { display: none; }
.brand { display: flex; gap: 10px; align-items: center; margin: 0 8px 36px; font: 600 1.8rem Georgia, serif; text-decoration: none; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 41px; height: 41px; font: 1.55rem Georgia, serif; border: 1px solid #769487; border-radius: 12px; color: #e6e8c7; }
.sidebar nav, .stall-menu-items { display: grid; gap: 5px; }
.stall-menu { grid-column: 1 / -1; min-width: 0; }
.stall-menu > summary { display: list-item; cursor: pointer; font-weight: 650; }
.stall-menu > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stall-menu-items { margin: 4px 0 5px 14px; padding-left: 6px; border-left: 1px solid var(--sidebar-hover); }
.nav-button, .sidebar-action { text-align: left; color: #e3ede4; border: 0; background: transparent; padding: 11px 10px; border-radius: 9px; font-weight: 550; }
.nav-button { display: flex; gap: 10px; align-items: center; }
.nav-button span { color: #b8d1c0; width: 20px; text-align: center; }
.nav-button:hover, .nav-button[aria-current="page"], .sidebar-action:hover { background: var(--sidebar-hover); }
.nav-button[aria-current="page"] { color: #fff; }
.sidebar-footer { margin-top: auto; padding: 28px 6px 0; display: grid; gap: 7px; }
.sidebar-footer > span { padding: 4px 4px 0; overflow-wrap: anywhere; }
.sidebar-footer small { color: #bfd2c5; padding: 0 4px; }
.sidebar-action { justify-self: start; padding: 5px 4px; }
.main { min-width: 0; }
.topbar { min-height: 66px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(16px, 3vw, 44px); color: var(--muted); background: var(--tint); }
.content { margin: 0 auto; padding: 30px clamp(16px, 3vw, 44px) 40px; max-width: 1550px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.page-heading p { margin-top: 7px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, 24%); gap: 16px; align-items: start; }
.calendar-toolbar {
  padding: 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 9px;
}
.week-nav, .calendar-modes, .filters { display: flex; align-items: center; gap: 5px; }
.calendar-modes { grid-column: 2; justify-self: end; }
.calendar-period { grid-column: 1 / -1; padding-inline: 4px; font-size: .9rem; }
.filters { grid-column: 1 / -1; flex-wrap: wrap; }
.button, .icon-button, .chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.2; }
.button:hover, .icon-button:hover, .chip:hover { background: var(--tint); }
.button.primary { background: var(--forest); border-color: var(--forest); color: white; }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: var(--danger-ink); }
.icon-button { min-width: 35px; padding: 6px 8px; font-size: 1.16rem; }
.chip { font-size: .79rem; padding: 7px 8px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent-line); color: var(--accent-ink); }
.week-scroll { overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(82px, 1fr)); min-height: 405px; border-top: 1px solid var(--line); }
.month-grid .day { min-height: 90px; border-bottom: 1px solid var(--line); }
.month-grid .day:nth-child(7n) { border-right: 0; }
.month-grid .adjacent-day { background: var(--tint); }
.month-weekday { padding: 8px 4px; text-align: center; font-size: .82rem; font-weight: 650; background: var(--tint); }
.month-date-mobile { display: none !important; }
.day { border-right: 1px solid var(--line); min-width: 0; }
.day:last-child { border-right: 0; }
.day.weekend { background: var(--tint); }
.day h3 { padding: 9px 5px; border-bottom: 1px solid var(--line); text-align: center; font-size: .84rem; }
.day h3 span { display: block; font-weight: 500; color: var(--muted); margin-top: 3px; }
.day.today h3 { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 2px var(--accent-line); }
.day-items { display: grid; gap: 6px; padding: 7px 5px; align-content: start; }
.event { --event-padding-end: 5px; text-align: left; min-width: 0; padding: 7px var(--event-padding-end) 7px 7px; border: 0; border-left: 3px solid var(--accent-line); border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
[data-duty-color="0"] { --calendar-fill: light-dark(#ebe8e2, color-mix(in srgb, #71685b 31%, var(--paper))); --calendar-accent: light-dark(#71685b, color-mix(in srgb, #71685b 58%, white)); }
[data-duty-color="1"] { --calendar-fill: light-dark(#e2edf8, color-mix(in srgb, #4d7599 31%, var(--paper))); --calendar-accent: light-dark(#4d7599, color-mix(in srgb, #4d7599 58%, white)); }
[data-duty-color="2"] { --calendar-fill: light-dark(#f8ebcf, color-mix(in srgb, #916a24 31%, var(--paper))); --calendar-accent: light-dark(#916a24, color-mix(in srgb, #916a24 58%, white)); }
[data-duty-color="3"] { --calendar-fill: light-dark(#e9e0f4, color-mix(in srgb, #72558d 31%, var(--paper))); --calendar-accent: light-dark(#72558d, color-mix(in srgb, #72558d 58%, white)); }
[data-duty-color="4"] { --calendar-fill: light-dark(#f9e1e7, color-mix(in srgb, #9a5167 31%, var(--paper))); --calendar-accent: light-dark(#9a5167, color-mix(in srgb, #9a5167 58%, white)); }
[data-duty-color="5"] { --calendar-fill: light-dark(#f8e3d7, color-mix(in srgb, #a05c34 31%, var(--paper))); --calendar-accent: light-dark(#a05c34, color-mix(in srgb, #a05c34 58%, white)); }
[data-duty-color="6"] { --calendar-fill: light-dark(#e3e6fa, color-mix(in srgb, #555e9f 31%, var(--paper))); --calendar-accent: light-dark(#555e9f, color-mix(in srgb, #555e9f 58%, white)); }
[data-duty-color="7"] { --calendar-fill: light-dark(#e2eff1, color-mix(in srgb, #497c83 31%, var(--paper))); --calendar-accent: light-dark(#497c83, color-mix(in srgb, #497c83 58%, white)); }
[data-duty-color="8"] { --calendar-fill: light-dark(#f2e6f2, color-mix(in srgb, #8c537f 31%, var(--paper))); --calendar-accent: light-dark(#8c537f, color-mix(in srgb, #8c537f 58%, white)); }
.reservation { --calendar-fill: light-dark(#e1eedf, color-mix(in srgb, #49744f 31%, var(--paper))); --calendar-accent: light-dark(#49744f, color-mix(in srgb, #49744f 58%, white)); }
.event[data-duty-color], .event.reservation, .calendar-legend span {
  background: var(--calendar-fill);
  border-color: var(--calendar-accent);
}
.event .own-task-label { font-weight: 750; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 13px; border-top: 1px solid var(--line); font-size: .79rem; }
.calendar-legend span { border-left: 3px solid var(--calendar-accent); border-radius: 5px; padding: 4px 7px; }
.facility-calendar { margin-top: 12px; }
.facility-calendar .day h3 { padding: 0; }
.facility-day-button { width: 100%; min-height: 36px; background: transparent; color: inherit; border: 0; font: inherit; }
.event:hover { filter: brightness(.96); }
.event strong, .event small { display: block; overflow-wrap: anywhere; }
.event strong { font-size: .79rem; line-height: 1.25; margin: 3px 0; }
.event small { font-size: .71rem; }
.calendar-empty { padding: 10px 13px; border-top: 1px solid var(--line); text-align: center; font-size: .85rem; }
.aside-panels { display: grid; gap: 12px; }
.summary { padding: 14px; }
.summary h2 { margin-bottom: 10px; }
.summary-item { border: 0; border-left: 3px solid var(--accent-line); border-radius: 6px; background: var(--tint); color: var(--text); display: block; padding: 9px; width: 100%; text-align: left; margin-top: 6px; overflow-wrap: anywhere; }
.summary-item:hover { background: var(--accent); }
.summary-item strong, .summary-item small { display: block; }
.summary-item small { margin-top: 3px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; color: var(--muted); background: var(--tint); }
tr:last-child td { border-bottom: 0; }
td:last-child { text-align: right; }
td strong, td small { display: block; }
td small { margin-top: 4px; }
.empty { padding: 25px; color: var(--muted); }
.status { display: inline-block; white-space: nowrap; font-size: .77rem; border-radius: 999px; border: 1px solid var(--line); color: var(--success-ink); background: var(--success-fill); padding: 3px 8px; }
.status.off { color: var(--inactive-ink); border-color: var(--line); background: var(--inactive-fill); }
.notice, #notice { padding: 10px 12px; margin-bottom: 12px; background: var(--success-fill); color: var(--success-ink); border-radius: 8px; }
.notice.error, #notice.error { background: var(--danger-fill); color: var(--danger-ink); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); width: min(590px, calc(100% - 22px)); padding: 19px; color: inherit; background: var(--paper); max-height: min(88vh, 820px); }
dialog::backdrop { background: #000a; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dialog-header h2 { font: 600 1.5rem Georgia, serif; }
.stack { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; padding: 8px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--paper); color: var(--text); }
.field textarea { resize: vertical; min-height: 72px; }
.check { display: flex; align-items: center; gap: 7px; font-size: .88rem; }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.weekdays { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.issued-code { margin: 12px 0; padding: 12px; background: var(--accent); border-radius: 8px; font-size: 1.15rem; overflow-wrap: anywhere; }
.invitation-qr { width: 225px; max-width: 100%; height: auto; background: #fff; }
.release-panel { padding: 18px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-wide { grid-column: 1 / -1; }
.admin-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 18px; }
.admin-card-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-card-action { margin-top: auto; padding-top: 4px; }
.admin-category-list { margin: 0; padding-inline-start: 20px; overflow-wrap: anywhere; }
.admin-history summary { padding: 14px 18px; cursor: pointer; font-size: 1.13rem; font-weight: 650; }
.admin-history summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius); }
.admin-history summary .status { margin-inline-start: 6px; font-weight: 400; }
.admin-history-body { padding-inline: 18px; overflow-wrap: anywhere; }
.admin-history .release:first-of-type { margin-top: 0; }
.profile-details { margin: 0; display: grid; gap: 8px; }
.profile-details dt { font-weight: 600; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.profile-photo { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; }
.photo-crop-preview {
  display: block; width: auto; height: auto; max-width: 100%; max-height: min(35vh, 300px);
  margin-inline: auto; border-radius: 8px; cursor: grab; touch-action: none;
}
.photo-crop-preview:active { cursor: grabbing; }
.photo-crop-avatar { border-radius: 50%; }
.facility-picker { margin-bottom: 12px; }
.facility-picker .field { max-width: 32rem; }
.release { padding-block: 15px; border-top: 1px solid var(--line); }
.release:first-of-type { margin-top: 14px; }
.release ul { margin-bottom: 0; padding-inline-start: 23px; }
.release li + li { margin-top: 5px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 72px 20px 20px; background: radial-gradient(ellipse at top left, var(--accent), var(--canvas) 62%); }
.auth-info { position: absolute; top: 16px; right: 20px; }
.legal-page { width: min(790px, 100%); margin: 0 auto; padding: 24px clamp(14px, 4vw, 30px) 48px; }
.legal-panel { padding: clamp(16px, 4vw, 28px); overflow-wrap: anywhere; }
.legal-panel h3 { margin-bottom: 5px; font-size: .98rem; }
.legal-panel p { line-height: 1.55; }
.legal-panel .errorlist { color: var(--danger-ink); margin-block: 0; }
.auth-card { width: min(415px, 100%); padding: 26px; }
.auth-card .brand { color: var(--accent-ink); margin: 0 0 17px; }
.auth-card .brand-mark { color: var(--accent-ink); }
.auth-card h1 { font-size: 2.12rem; margin-bottom: 13px; }
.auth-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
[hidden] { display: none !important; }
@media (min-width: 1050px) {
  .event { --event-padding-end: 8px; padding: 8px; }
}
@media (max-width: 1050px) {
  .shell { grid-template-columns: 187px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .shell { display: block; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-height: auto; padding: 12px; }
  .sidebar-header { display: flex; align-items: center; gap: 10px; }
  .sidebar .brand { margin: 0; min-width: 0; }
  .sidebar .menu-toggle {
    position: relative; display: inline-flex; flex: 0 0 44px; min-height: 44px;
    color: inherit; background: transparent; padding: 0; border-color: #ffffff52;
  }
  .menu-toggle:hover { background: var(--sidebar-hover); }
  .menu-toggle .unread-badge { position: absolute; top: -4px; right: -5px; }
  .sidebar > .sidebar-menu { display: none; }
  #mobile-menu {
    position: fixed; inset: 0 auto 0 0; margin: 0; padding: 16px;
    width: min(84vw, 320px); height: 100dvh; max-height: none; max-width: none;
    border: 0; border-radius: 0; background: var(--paper); color: var(--text);
  }
  .mobile-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  }
  #mobile-menu .nav-button { min-height: 44px; color: var(--text); overflow-wrap: anywhere; }
  #mobile-menu .nav-button span:not(.unread-badge) { color: var(--muted); }
  #mobile-menu .nav-button:hover, #mobile-menu .nav-button[aria-current="page"] { background: var(--tint); }
  #mobile-menu .sidebar-footer { padding: 16px 4px 0; border-top: 1px solid var(--line); margin-top: 12px; }
  #mobile-menu .sidebar-action, #mobile-menu .sidebar-footer small { color: var(--muted); }
  .topbar { min-height: 54px; padding-block: 5px; gap: 8px; }
  .calendar-toolbar { padding-inline: 9px; column-gap: 4px; }
  .week-nav, .calendar-modes { gap: 4px; }
  .week-nav .icon-button { min-width: 44px; }
  .week-nav .chip, .calendar-modes .chip { padding-inline: 6px; }
  #breadcrumb { min-width: 0; overflow-wrap: anywhere; }
  .content { padding-top: 20px; }
  .week-grid { display: block; min-height: 0; }
  .week-grid .day { min-height: 0; border: 0; border-bottom: 1px solid var(--line); }
  .week-grid .day h3 { display: flex; gap: 8px; padding: 8px 12px; text-align: left; }
  .week-grid .day h3 span { margin-top: 0; }
  .week-grid .day-items { padding: 5px 8px 8px; }
  .week-grid .day.no-events .day-items, .month-grid .adjacent-day, .month-weekday,
  .month-grid .day.no-events:not(.today), .month-date-desktop { display: none !important; }
  .month-date-mobile { display: inline !important; }
  .event { --event-padding-end: 8px; min-height: 44px; padding: 8px; }
  .facility-day-button { min-height: 44px; text-align: left; }
  .event strong { font-size: .87rem; }
  .button, .icon-button, .chip { min-height: 44px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .field input, .field select { min-height: 44px; }
  dialog { max-height: 88dvh; }
  .availability-table table, .availability-table tbody { display: block; }
  .availability-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .availability-table tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .availability-table td { padding: 4px 0; border: 0; }
  .availability-table td:first-child { grid-column: 1 / -1; }
  .availability-table td:last-child { grid-column: 2; grid-row: 2 / 4; align-self: center; }
}
@media (max-width: 430px) {
  .page-heading { align-items: start; flex-direction: column; }
  .aside-panels { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
}

.work-month {
  border-top: 1px solid var(--line, #d9dfd3);
  padding: .65rem 0;
}
.work-month summary {
  cursor: pointer;
  min-height: 44px;
  padding: .55rem 0;
}
.work-month summary span {
  display: inline-block;
  margin-inline-start: .65rem;
}
.work-month .profile-details {
  margin-block: .75rem;
}


.event-chat { border-top: 1px solid var(--line); padding-top: 12px; }
.chat-messages {
  max-height: min(35vh, 18rem);
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chat-messages li { padding: 8px; border-bottom: 1px solid var(--line); }
.chat-messages header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.chat-messages time { font-size: .76rem; color: var(--muted); }
.chat-messages p { white-space: pre-wrap; overflow-wrap: anywhere; }

#membership-notice p { margin-bottom: 8px; }

.event:has(.chat-badge) {
  --avatar-extra-width: calc(28px - var(--event-padding-end));
  position: relative; padding-right: 28px;
}
.chat-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--text);
  font-size: .9rem;
  line-height: 1;
}
.chat-badge.unread { color: var(--danger-ink); background: var(--danger-fill); box-shadow: inset 0 0 0 1px currentColor; }

.horse-photo { display: block; width: min(100%, 19rem); height: auto; border-radius: 8px; }

.reservation-mine { --calendar-fill: light-dark(#d6eddd, color-mix(in srgb, #256343 31%, var(--paper))); --calendar-accent: light-dark(#256343, color-mix(in srgb, #256343 58%, white)); }
.reservation-shared { --calendar-fill: light-dark(#edf1f8, color-mix(in srgb, #536983 31%, var(--paper))); --calendar-accent: light-dark(#536983, color-mix(in srgb, #536983 58%, white)); }
.reservation-full { --calendar-fill: light-dark(#fce2e1, color-mix(in srgb, #9d3032 31%, var(--paper))); --calendar-accent: light-dark(#9d3032, color-mix(in srgb, #9d3032 58%, white)); }
.reservation-closed { --calendar-fill: light-dark(#e5e7ea, color-mix(in srgb, #4a5059 31%, var(--paper))); --calendar-accent: light-dark(#4a5059, color-mix(in srgb, #4a5059 58%, white)); }
.facility-calendar .facility-bookable { cursor: pointer; }
.facility-calendar .facility-bookable:hover h3 { background: var(--tint); }
.facility-calendar .facility-bookable:focus-within h3 { background: var(--tint); }
.facility-calendar .event:is(.reservation-full, .reservation-closed) { color: var(--text); }
.facility-calendar .event.reservation-full { cursor: default; }
.facility-calendar span.facility-day-button { display: grid; place-items: center; }
.facility-daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.facility-daily article { padding: 12px; border: 1px solid var(--line); min-width: 0; }
.facility-daily h3 { margin: 0 0 8px; }
.facility-picker .button { margin-top: 8px; }
.board-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.facility-calendar .facility-bookable .day-items:empty { min-height: 32px; }

.chat-read-status { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.board-calendar-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

.help-toggle { min-width: 36px; min-height: 36px; padding: 6px 10px; }
.help-toggle[aria-pressed="true"] { color: #fff; background: var(--forest); border-color: var(--forest); }
.control-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(320px, calc(100vw - 16px));
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--forest-dark);
  color: #fff;
  box-shadow: 0 3px 12px #10271b4d;
  font-size: .85rem;
  line-height: 1.4;
}
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.help-steps { margin: 0; padding-left: 1.4rem; }
.help-steps li + li { margin-top: 6px; }
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .help-toggle { min-width: 44px; min-height: 44px; }
}

.auth-card form[action="/web/google/start/"] { margin-top: 12px; }
.auth-card [data-google-login] { width: 100%; }
.password-rules { margin: 0; padding-inline-start: 1.25rem; }

.control-tooltip.sidebar-inline-tip {
  position: static;
  max-width: none;
  margin-top: 12px;
  border: 1px solid #4b7462;
}
.create-button { min-height: 42px; }
.member-name { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%;
  object-fit: cover; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: .85rem; font-weight: 700;
}
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .page-heading .create-button { margin-left: auto; }
  .create-button { min-height: 44px; }
}

.account-menu { position: relative; flex: none; }
.account-profile { gap: 7px; padding: 4px 8px 4px 5px; white-space: nowrap; cursor: pointer; list-style: none; }
.account-profile::-webkit-details-marker { display: none; }
.account-profile[aria-current="page"], .account-menu[open] .account-profile { background: var(--accent); border-color: var(--accent-line); }
.account-dropdown {
  position: absolute; z-index: 20; inset: calc(100% + 6px) 0 auto auto;
  width: 184px; padding: 5px; display: grid; gap: 2px; color: var(--text);
  box-shadow: 0 8px 20px #0002;
}
.account-dropdown .button { border-color: transparent; justify-content: flex-start; }
.account-dropdown .button[aria-pressed="true"] { background: var(--accent); }
.member-avatar.account-avatar {
  position: relative; overflow: hidden; width: 30px; height: 30px; flex-basis: 30px;
}
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.message-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.message-views { display: flex; flex-wrap: wrap; gap: 6px; }
.message-search { margin-inline-start: auto; padding-inline: 8px; font-size: .79rem; white-space: nowrap; }
.board-card-header, .board-card-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.board-card-header h2 { min-width: 0; overflow-wrap: anywhere; }
.board-card-footer:empty { display: none; }
.board-card-footer .button { margin-left: auto; }
.board-expiry { flex: none; padding: 4px 8px; border-radius: 6px; background: var(--tint); color: var(--muted); font-size: .8rem; }
.calendar-avatars {
  --avatar-size: 20px;
  --avatar-gap: 3px;
  display: grid; direction: rtl; justify-items: start;
  grid-template-columns: var(--avatar-size);
  width: calc(var(--avatar-size) + var(--avatar-steps) * (var(--avatar-size) + var(--avatar-gap)));
  max-width: calc(100% + var(--avatar-extra-width, 0px));
  margin: 5px calc(0px - var(--avatar-extra-width, 0px)) 0 auto;
}
.calendar-avatars:has(.calendar-avatar + .calendar-avatar) {
  grid-template-columns: repeat(var(--avatar-steps), minmax(0, 1fr)) var(--avatar-size);
}
.calendar-avatar {
  display: inline-grid; place-items: center; width: var(--avatar-size); height: var(--avatar-size);
  border: 1px solid var(--accent-line); border-radius: 50%; overflow: hidden;
  background: var(--tint); color: var(--accent-ink); font-size: .7rem; font-weight: 700;
}
.calendar-avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .board-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .board-expiry { padding: 0; background: none; }
}
.calendar-avatar { position: relative; }
.calendar-avatar img { position: absolute; inset: 0; }

.unread-badge, .nav-button .unread-badge {
  display: inline-flex; justify-content: center; align-items: center;
  min-width: 1.35em; width: auto; padding: 1px 5px; margin-left: 4px;
  color: #fff; background: #a52e35; border-radius: 1em;
  font-size: .77rem; font-weight: 700;
}
.nav-button .unread-badge { margin-left: auto; }

.stall-color-picker { display: flex; align-items: center; gap: 10px; }
.stall-color-picker input[type="color"] { width: 58px; height: 44px; }

.mail-link-target { outline: 2px solid var(--accent-line); outline-offset: -2px; }
dialog .control-tooltip { pointer-events: none; }

.member-directory-table .member-name strong { min-width: 0; overflow-wrap: anywhere; }
.directory-horse {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%; min-height: 36px;
  padding: 2px 0; background: none; border: 0; text-align: left; text-decoration: underline;
  overflow-wrap: anywhere;
}
.directory-horse span { min-width: 0; }
.directory-message svg { display: none; }
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .member-directory-table :is(th, td) { padding: 8px; }
  .member-directory-table .member-name { gap: 6px; }
  .directory-horse { min-height: 44px; }
  .directory-message { min-width: 44px; padding-inline: 8px; }
  .directory-message span { display: none; }
  .directory-message svg { display: block; }
}

.horse-overview { display: grid; align-items: start; gap: 14px; }
.horse-portrait {
  margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--tint);
}
.horse-portrait .horse-photo { width: 100%; max-height: 340px; object-fit: contain; border-radius: 0; }
.horse-identity {
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0;
}
.horse-identity li {
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  overflow-wrap: anywhere; font-weight: 650;
}
.horse-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.horse-facts > div {
  padding: 8px 10px; border-radius: 8px; background: var(--tint); overflow-wrap: anywhere;
}
.horse-facts dt { color: var(--muted); font-size: .79rem; }
.horse-facts dd { margin: 0; font-weight: 600; }
.horse-note { border-inline-start: 3px solid var(--accent-line); border-radius: 6px; background: var(--tint); padding: 10px 12px; }
.horse-note h3 { font-size: .9rem; margin-bottom: 4px; }
.horse-note p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 550px) {
  .horse-overview.has-portrait { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}

.chat-messages .direct-message-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.direct-message-header > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.direct-receipt { color: var(--muted); line-height: 0; }
.direct-receipt.is-read { color: var(--success-ink); }
.board-card-header:has(.board-readers) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.board-card-header:has(.board-readers) .board-expiry { grid-column: 1; justify-self: start; white-space: normal; }
.board-readers { grid-column: 2; grid-row: 1 / span 2; min-width: 44px; min-height: 44px; }
.board-reader-list { margin: 0; list-style: none; padding: 0; }
.board-reader-list li { padding: 8px 0; border-top: 1px solid var(--line); }

.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start; gap: 14px;
}
.profile-wide { grid-column: 1 / -1; }
.profile-tile { padding: 16px; }
.profile-context { display: grid; min-width: 0; gap: 14px; }
.profile-tile-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.profile-tile .button { font-size: .85rem; max-width: 100%; overflow-wrap: anywhere; }
.profile-tile > .field { margin: 0; }
.profile-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
.profile-identity .profile-photo { width: 64px; height: 64px; }
.profile-placeholder { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.profile-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.profile-contact dt { color: var(--muted); font-size: .8rem; }
.profile-options { padding-top: 7px; border-top: 1px solid var(--line); }
.profile-options summary { cursor: pointer; font-size: .85rem; font-weight: 600; padding-block: 4px; }
.profile-options[open] > :not(summary) { margin-top: 8px; }
.profile-sound { border-block: 1px solid var(--line); padding-block: 8px; }
.profile-horse-list :is(th, td) { padding: 6px 10px; }
.profile-horse-list :is(th, td):last-child { text-align: right; white-space: nowrap; font-size: .85rem; }
.profile-horse {
  display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px;
  padding: 3px 4px; text-align: left; background: transparent; border: 0; border-radius: 6px;
  color: var(--text); overflow-wrap: anywhere;
}
.profile-horse:hover { background: var(--tint); }
.profile-horse-thumb {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 8px; object-fit: cover; background: var(--accent); color: var(--accent-ink);
}
.profile-horse small:empty { display: none; }
@media (max-width: 760px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 390px) {
  .profile-contact { grid-template-columns: minmax(0, 1fr); }
  .profile-identity { gap: 10px; }
  .profile-identity .profile-photo { width: 52px; height: 52px; }
}

.avatar-photo { padding: 0; border: 0; overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.directory-horse-row, .profile-horse-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
img[data-avatar-photo], #account-photo { cursor: zoom-in; }
.avatar-preview {
  position: fixed; z-index: 35; width: min(216px, calc(100vw - 16px)); height: min(216px, calc(100vh - 16px));
  pointer-events: none; overflow: hidden; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); box-shadow: 0 8px 26px #0005;
}
.avatar-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.avatar-full-photo { display: block; width: 100%; max-height: min(70vh, 500px); object-fit: contain; border-radius: 8px; }
