.agenda-page {
  --agenda-ink: var(--ink);
  --agenda-muted: var(--muted);
  --agenda-line: var(--line);
  --agenda-surface: #fff;
  --agenda-soft: #f5f8fc;
  --agenda-accent: #135651;
  --agenda-accent-soft: #e5f4ef;
  container-type: inline-size;
}
.agenda-masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.agenda-masthead h1 {
  color: var(--agenda-ink);
  font-size: clamp(1.65rem,3vw,2.35rem);
  line-height: 1.1;
}
.agenda-masthead p { margin: 6px 0 0 }
.agenda-control {
  display: grid;
  gap: 0;
  margin-bottom: 15px;
  overflow: hidden;
}
.agenda-tools, .agenda-context, .agenda-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 16px;
}
.agenda-tools { border-bottom: 1px solid var(--agenda-line) }
.agenda-range, .agenda-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.agenda-range h2 {
  color: var(--agenda-ink);
  font-size: clamp(1rem,2vw,1.24rem);
  font-weight: 750;
  margin: 0 0 0 6px;
  text-transform: none;
}
.agenda-arrow, .agenda-today { min-height: 38px }
.agenda-arrow {
  min-width: 38px;
  padding: 0 8px;
  font-size: 1.34rem;
  line-height: 1;
}
.agenda-segment {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--agenda-line);
  border-radius: 9px;
  background: var(--agenda-soft);
}
.agenda-segment a {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--agenda-muted);
  font-size: .84rem;
  font-weight: 700;
}
.agenda-segment a[aria-current] {
  background: var(--agenda-surface);
  color: var(--agenda-ink);
  box-shadow: 0 1px 4px #2436561c;
}
.agenda-filters {
  justify-content: flex-start;
  align-items: end;
}
.agenda-filters label:first-child { width: min(100%,240px) }
.agenda-filters label:nth-child(2) { width: min(100%,160px) }
.agenda-filters label { min-width: 0 }
.agenda-text-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .83rem;
  font-weight: 700;
}
.agenda-filters .agenda-text-link { padding: 11px 0 }
.agenda-context {
  background: var(--agenda-soft);
  border-top: 1px solid var(--agenda-line);
  font-size: .82rem;
}
.agenda-context p, .agenda-context div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  align-items: center;
  margin: 0;
}
.agenda-context p span { color: var(--agenda-muted) }
.agenda-pill {
  color: #2e4b69;
  background: #e3edf8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 100vmax;
  padding: 4px 9px;
  font-size: .75rem;
  font-weight: 700;
}
.agenda-pill:hover { background: #d6e7f6 }
.agenda-readonly {
  color: #27435e;
  background: #e9f1f8;
  font-size: .81rem;
  margin: 0;
  padding: 9px 16px;
}
.agenda-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  border: 1px solid var(--agenda-line);
  border-radius: var(--radius);
  background: var(--agenda-surface);
}
.agenda-day { min-width: 0; border-bottom: 1px solid var(--agenda-line) }
.agenda-day:last-child { border-bottom: 0 }
.agenda-day-header {
  min-height: 57px;
  background: var(--agenda-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--agenda-line);
}
.agenda-day:first-child .agenda-day-header { border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px) }
.agenda-day-header h3 { margin: 0; min-width: 0 }
.agenda-day-header h3 a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 3px;
  border-radius: 4px;
}
.agenda-day-header h3 a:hover { text-decoration: underline }
.agenda-day-header h3 span {
  color: var(--agenda-muted);
  font-size: .75rem;
  line-height: 1.3;
  font-weight: 750;
  text-transform: uppercase;
}
.agenda-day-header h3 time { font-variant-numeric: tabular-nums }
.agenda-day-header h3 a time {
  font-size: 1.38rem;
  font-weight: 760;
  line-height: 1.17;
}
.agenda-day.is-today .agenda-day-header {
  background: var(--agenda-accent-soft);
  color: var(--agenda-accent);
}
.agenda-day.is-today h3 span { color: var(--agenda-accent) }
.agenda-add-day {
  border: 1px solid var(--agenda-line);
  background: var(--agenda-surface);
  min-width: 34px;
  min-height: 34px;
  color: var(--blue);
  font-size: 1.18rem;
  font-weight: 650;
  border-radius: 6px;
  padding: 0 5px;
  flex: 0 0 auto;
}
.agenda-add-day:hover { background: #eaf3fc }
.agenda-day-body {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 8px;
}
.agenda-event, .agenda-deadline {
  appearance: none;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 3px;
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  color: #19334d;
  padding: 8px 7px;
  overflow-wrap: anywhere;
}
.agenda-event {
  --agenda-event-tint: #edf4fd;
  --agenda-event-stroke: #3769a4;
  --agenda-event-border: #d9e8f8;
  min-height: 72px;
  border: 1px solid var(--agenda-event-border);
  border-inline-start: 3px solid var(--agenda-event-stroke);
  background: var(--agenda-event-tint);
}
.agenda-event:hover { box-shadow: 0 0 0 1px var(--agenda-event-stroke) }
.agenda-task { --agenda-event-tint: #e8f6f1; --agenda-event-stroke: #287565; --agenda-event-border: #cee9dd }
.agenda-focus { --agenda-event-tint: #f2eefe; --agenda-event-stroke: #6753a0; --agenda-event-border: #e5dbf8 }
.agenda-visit { --agenda-event-tint: #faf2de; --agenda-event-stroke: #8c641e; --agenda-event-border: #efe4c5 }
.agenda-event.is-cancelled {
  --agenda-event-tint: #f4f5f7;
  --agenda-event-stroke: #68737d;
  --agenda-event-border: #dce0e5;
}
.agenda-event-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  color: #2a4765;
  font-size: .71rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}
.agenda-event-meta > span { color: #525b67; font-size: .70rem }
.agenda-event-title { font-weight: 750; font-size: .84rem; line-height: 1.28 }
.agenda-event-owner { color: #304a64; font-size: .75rem; line-height: 1.3 }
.agenda-event-link, .agenda-event-actor { color: #39526b; font-size: .7rem; line-height: 1.3 }
.agenda-overlap {
  justify-self: start;
  padding: 2px 5px;
  border-radius: 3px;
  background: #ffe7b8;
  color: #5e3900;
  font-size: .69rem;
  font-weight: 750;
  line-height: 1.3;
}
.agenda-deadline {
  gap: 2px;
  border: 1px dashed #aebdcb;
  background: #f7faff;
}
.agenda-due-group { display: grid; gap: 6px }
.agenda-due-group > p, .agenda-empty {
  margin: 2px 0;
  color: var(--agenda-muted);
  font-size: .76rem;
}
.agenda-due-group > p { font-weight: 720 }
.agenda-grid.is-day .agenda-day-body { gap: 8px; padding: 12px }
.agenda-grid.is-day .agenda-event, .agenda-grid.is-day .agenda-deadline { min-height: 0; padding: 12px }
.agenda-grid.is-day .agenda-day-header { padding-inline: 13px }
.agenda-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 10px;
  color: var(--agenda-muted);
  padding: 12px 2px;
  font-size: .77rem;
}
.agenda-editor {
  display: grid;
  gap: 10px;
}
.agenda-editor-intro, .agenda-form-caption, .agenda-inline-status, .agenda-optional {
  color: var(--muted);
  font-size: .80rem;
}
.agenda-editor p { margin: 0 }
.agenda-inline-status:empty { display: none }
.agenda-optional { display: inline; font-weight: 500 }
.agenda-form-grid, .agenda-relation {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px 12px;
}
.agenda-form-times { grid-template-columns: minmax(0,1.3fr) repeat(2,minmax(0,1fr)) }
.agenda-grants { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 10px }
.agenda-grants legend { padding: 0 4px; font-weight: 720; font-size: .89rem }
.agenda-grants-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 4px 10px;
  max-height: min(45svh,270px);
  overflow: auto;
}
.agenda-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  line-height: 1.2;
  padding: 4px 0;
}
.agenda-check input { width: 16px; height: 16px; flex: 0 0 16px }
.agenda-check span { overflow-wrap: anywhere }
.agenda-detail-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  color: var(--blue);
  font-weight: 740;
  margin-bottom: 10px;
}
.agenda-detail dl {
  display: grid;
  grid-template-columns: minmax(90px,auto) 1fr;
  gap: 6px 12px;
  margin: 0;
}
.agenda-detail dt { color: var(--muted); font-size: .81rem; font-weight: 720 }
.agenda-detail dd { margin: 0; overflow-wrap: anywhere; font-size: .87rem }
.agenda-detail-note {
  margin-top: 13px;
  padding: 9px;
  background: #f3f7fb;
  border-radius: 7px;
}
.agenda-detail-note h3 { margin: 0 0 4px; font-size: .86rem }
.agenda-detail-note p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .85rem }
.agenda-linked-actions, .agenda-record-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px }
@container (min-width: 780px) {
  .agenda-grid.is-week { grid-template-columns: repeat(7,minmax(0,1fr)); min-height: 300px }
  .agenda-grid.is-week .agenda-day { border-bottom: 0; border-inline-end: 1px solid var(--agenda-line) }
  .agenda-grid.is-week .agenda-day:last-child { border-inline-end: 0 }
  .agenda-grid.is-week .agenda-day:first-child .agenda-day-header { border-top-right-radius: 0 }
  .agenda-grid.is-week .agenda-day:last-child .agenda-day-header { border-top-right-radius: calc(var(--radius) - 1px) }
}
@media (max-width: 570px) {
  .agenda-masthead { align-items: flex-start; flex-direction: column; gap: 9px }
  .agenda-tools, .agenda-context, .agenda-filters { padding: 9px 10px }
  .agenda-range h2 { flex: 1 0 100%; margin: 3px 0 0 }
  .agenda-filters label:first-child { width: 100% }
  .agenda-filters label:nth-child(2) { width: min(100%,153px) }
  .agenda-form-times label:first-child { grid-column: 1 / -1 }
  .agenda-form-times, .agenda-grants-list { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .agenda-form-grid:not(.agenda-form-times), .agenda-relation { grid-template-columns: minmax(0,1fr) }
}
