.home-agenda > h2 { font-size:18px; font-weight:700; margin:0 0 12px; color:var(--site-accent,#AF8058); }
.home-agenda { box-sizing:border-box; min-width:0; border:1px solid var(--site-accent,#AF8058); padding:16px; }
#home-agenda[data-agenda-pending] { visibility:hidden; }
.agenda-scroll { max-height:580px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:var(--site-accent,#AF8058) transparent; overflow-wrap:anywhere; }
#home-agenda .agenda-scroll { scrollbar-color:gray transparent; padding-right:16px; }
.agenda-event { border-top:1px solid gray; padding:8px 0; }
#home-agenda .agenda-event:not(.agenda-month-transition) { border-top:0; }
.agenda-event-type { font-size:12px; line-height:1.25; color:var(--site-accent,#AF8058); margin:0 0 5px; }
.agenda-event h4 { font-size:16px; line-height:1.25; font-weight:400; margin:0 0 4px; }
.agenda-event time { font-size:13px; line-height:1.25; display:block; }
.agenda-event small { font-size:12px; color:gray; display:block; margin:4px 0; }
.agenda-event .agenda-tentative { color:darkgoldenrod; }
.agenda-location { margin:4px 0; font-size:14px; }
.agenda-event-links { display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:4px; font-size:14px; }
.agenda-event a { color:inherit; text-decoration:underline; text-decoration-color:var(--site-accent,#AF8058); text-underline-offset:3px; }
.agenda-empty, .history-empty { color:gray; font-size:16px; }

.agenda-event-type { text-transform:uppercase; font-weight:700; }
.agenda-event h4 > a { color:inherit; text-decoration:none; }
.agenda-event h4 > a:hover { text-decoration:underline; text-decoration-color:var(--site-accent,#AF8058); }

/* Event dates and metadata share only the lines their content needs. */
.agenda-event { text-align:right; }
.agenda-event-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:3px 12px; margin-bottom:4px; }
.agenda-event-heading time { flex:0 1 auto; max-width:100%; margin:0; text-align:left; }
.agenda-event-heading .agenda-event-type { flex:1 1 100px; min-width:0; margin:0; text-align:right; }
.agenda-event-links { justify-content:flex-end; }

.agenda-event-territory { color:gray; font-weight:400; text-transform:none; }

.agenda-event.agenda-month-transition { position:relative; border-top:5px solid transparent; }
.agenda-event.agenda-month-transition::before {
    content:"";
    position:absolute;
    top:-5px;
    left:0;
    right:0;
    height:5px;
    box-sizing:border-box;
    border-top:1px solid var(--site-accent,#AF8058);
    border-bottom:1px solid var(--site-accent,#AF8058);
    pointer-events:none;
}

.agenda-event { display:grid; grid-template-columns:max-content minmax(0,1fr); column-gap:12px; align-items:baseline; }
.agenda-event > :not(h4):not(time) { grid-column:1 / -1; }
.agenda-event > h4 { grid-column:2; grid-row:2; font-weight:700; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.agenda-event > time { grid-column:1; grid-row:2; text-align:left; white-space:nowrap; font-weight:700; }

#home-agenda .agenda-event > h4 { font-size:14px; }
#home-agenda .agenda-event > time { font-size:14px; color:gray; }

/* Multiple titles share one date and metadata block. */
.agenda-event.agenda-event-group{background:rgb(255 255 255 / .065);padding:8px;margin:4px 0}
body.light-mode .agenda-event.agenda-event-group{background:rgb(0 0 0 / .045)}
.agenda-event > .agenda-event-titles{grid-column:2;grid-row:2;min-width:0;margin:0 0 4px;padding-left:16px;text-align:left;list-style:disc;font-size:16px;font-weight:700;line-height:1.25}
.agenda-event-titles li+li{margin-top:5px}
.agenda-event-titles li{min-width:0}
.agenda-event-titles li>a,.agenda-event-titles li>span{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:inherit;text-decoration:none}
.agenda-event-titles li>a:hover{text-decoration:underline;text-decoration-color:var(--site-accent,#AF8058)}
#home-agenda .agenda-event-titles{font-size:14px}
/* Keep the accessible name without a visible heading in the home calendar. */
#home-agenda > h2 { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(min-width:601px){
    /* Only Latest contributes to the row height; the agenda fills that row. */
    #home-agenda { align-self:stretch; contain:size; display:flex; flex-direction:column; height:auto; min-height:0; overflow:hidden; }
    #home-agenda .agenda-scroll { flex:1; height:auto; max-height:none; min-height:0; box-sizing:border-box; }
}
#home-agenda .agenda-event-type { font-size:12px; }
#home-agenda .agenda-event small, #home-agenda .agenda-location, #home-agenda .agenda-event-links { font-size:14px; }

/* Category controls belong only to the public home calendar. */
#home-agenda .agenda-tabs{display:flex;flex:none;gap:18px;margin:0 0 10px}
#home-agenda .agenda-tabs button{font:inherit;font-size:14px;font-weight:700;color:gray;background:transparent;border:0;border-bottom:1px solid transparent;padding:0 0 4px;cursor:pointer}
#home-agenda .agenda-tabs button[aria-selected="true"]{color:var(--site-accent,#AF8058);border-bottom-color:currentColor}
#home-agenda .agenda-tabs button:focus-visible{outline:2px solid var(--site-accent,#AF8058);outline-offset:3px}

/* Public home: neutral frame and one line between months. */
#home-agenda{border:1px solid #FF2400}
#mobile-agenda > #home-agenda{border:0}
#home-agenda .agenda-event.agenda-month-transition{border-top:0}
#home-agenda .agenda-month-heading{border-bottom:1px solid var(--site-accent,#AF8058);margin:8px 0 6px;padding-bottom:6px;font-size:18px;font-weight:400;line-height:1.25;color:var(--site-accent,#AF8058);text-align:left;text-transform:capitalize}
#home-agenda .agenda-event.agenda-month-transition::before{display:none}

/* Relative dates follow the normal text colour in either theme. */
#home-agenda .agenda-event > time.agenda-date-today,
#home-agenda .agenda-event > time.agenda-date-tomorrow { color:inherit; }

/* All home tabs use the same left-aligned bulleted event layout. */
#home-agenda .agenda-event { text-align:left; padding:8px; }
#home-agenda .agenda-event > .agenda-event-heading { grid-column:2; grid-row:1; padding-left:16px; }
#home-agenda .agenda-event-heading .agenda-event-type { text-align:left; }
#home-agenda .agenda-event-links { justify-content:flex-start; }
