/* ORDO v2.82 · unified calendar grid + reliable month overflow */
#agendaModule{--ordo-calendar-grid-line:var(--line,#e5e7eb);--ordo-calendar-grid-surface:var(--ordo-surface,#fff);--ordo-calendar-grid-soft:color-mix(in srgb,var(--ordo-surface,#fff) 94%,#dbeafe)}
html[data-theme="dark"] #agendaModule,html.ordo-dark #agendaModule{--ordo-calendar-grid-line:#29374b;--ordo-calendar-grid-surface:#111827;--ordo-calendar-grid-soft:#172235}
#agendaModule .ordo-calendar-viewbar{display:flex;align-items:center;justify-content:flex-end;margin:0 0 12px;gap:10px}
#agendaModule .ordo-view-switch{display:inline-flex;align-items:center;padding:3px;border:1px solid var(--ordo-border);border-radius:12px;background:color-mix(in srgb,var(--ordo-surface) 92%,transparent);box-shadow:0 4px 18px rgba(0,0,0,.05)}
#agendaModule .ordo-view-switch button{appearance:none;border:0;background:transparent;color:var(--ordo-muted);font:inherit;font-size:12px;font-weight:750;line-height:1;padding:9px 14px;border-radius:9px;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
#agendaModule .ordo-view-switch button:hover{color:var(--ordo-text)}
#agendaModule .ordo-view-switch button.active{background:var(--ordo-surface);color:var(--ordo-text);box-shadow:0 2px 9px rgba(0,0,0,.10)}
html[data-theme="dark"] #agendaModule .ordo-view-switch button.active,html.ordo-dark #agendaModule .ordo-view-switch button.active{background:rgba(255,255,255,.09)}
#agendaModule .calendar-grid .day{padding-top:4px!important;gap:0!important}
#agendaModule .calendar-grid .day .day-num{height:18px!important;min-height:18px!important;line-height:18px!important;margin:0 0 2px!important;padding:0 6px!important}
#agendaModule .calendar-grid .day .event-chip{margin-top:2px!important;min-height:17px!important;height:var(--ordo-event-bar-height,22px)!important;max-height:30px!important;padding:2px 7px!important;line-height:1!important}
#agendaModule .calendar-grid .day .event-chip.ordo-month-hidden{display:none!important}
#agendaModule .calendar-grid .day .more-events{display:none!important}
#agendaModule .calendar-grid .day .ordo-more-events{display:block!important;position:relative!important;z-index:7!important;pointer-events:auto!important;flex:0 0 auto!important;margin:2px 0 0!important;padding:1px 6px!important;border:0!important;background:transparent!important;color:var(--ordo-primary,#6C5CE7)!important;text-align:left!important;font-size:11px!important;font-weight:800!important;line-height:16px!important;cursor:pointer!important;border-radius:6px!important}
#agendaModule .calendar-grid .day .ordo-more-events:hover,#agendaModule .calendar-grid .day .ordo-more-events[aria-expanded="true"]{background:color-mix(in srgb,var(--ordo-primary,#6C5CE7) 12%,transparent)!important}
#agendaModule .calendar-grid .day{cursor:pointer}
#agendaModule .calendar-grid .day .event-chip{cursor:grab}
#agendaModule .ordo-alt-calendar{display:none;border:1px solid var(--ordo-calendar-grid-line);border-radius:14px;overflow:hidden;background:var(--ordo-calendar-grid-surface)}
#agendaModule .calendar-wrap.ordo-nonmonth .weekdays,#agendaModule .calendar-wrap.ordo-nonmonth .calendar-grid{display:none!important}
#agendaModule .calendar-wrap.ordo-nonmonth .ordo-alt-calendar{display:block}
#agendaModule .ordo-time-calendar{background:var(--ordo-calendar-grid-surface);color:var(--ordo-text)}
#agendaModule .ordo-time-scroll{overflow:auto;max-height:690px;scrollbar-gutter:stable}
#agendaModule .ordo-time-grid{position:relative;display:grid;grid-template-columns:62px minmax(0,1fr);min-width:0;background:var(--ordo-calendar-grid-surface)}
#agendaModule .ordo-time-axis{position:relative;border-right:1px solid var(--ordo-calendar-grid-line);background:var(--ordo-calendar-grid-soft)}
#agendaModule .ordo-hour-label{position:absolute;right:8px;transform:translateY(-50%);font-size:10px;font-weight:750;color:var(--ordo-muted);white-space:nowrap}
#agendaModule .ordo-hour-line{position:absolute;left:0;right:0;height:1px;background:var(--ordo-calendar-grid-line);pointer-events:none;z-index:0}
#agendaModule .ordo-day-event-layer{position:absolute;inset:0;z-index:1}
#agendaModule .ordo-time-day-column{position:relative;min-width:0;border-right:1px solid var(--ordo-calendar-grid-line);background:var(--ordo-calendar-grid-surface);overflow:hidden}
#agendaModule .ordo-time-day-column:last-child{border-right:0}
#agendaModule .ordo-time-day-column.is-today{background:color-mix(in srgb,var(--ordo-primary,#6C5CE7) 4%,var(--ordo-calendar-grid-surface))}
#agendaModule .ordo-week-time-head{display:grid;grid-template-columns:62px repeat(7,minmax(0,1fr));position:sticky;top:0;z-index:5;background:var(--ordo-calendar-grid-surface);border-bottom:1px solid var(--ordo-calendar-grid-line)}
#agendaModule .ordo-time-gutter{border-right:1px solid var(--ordo-calendar-grid-line);background:var(--ordo-calendar-grid-soft)}
#agendaModule .ordo-week-head-day{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:64px;padding:8px 4px;border:0;border-right:1px solid var(--ordo-calendar-grid-line);background:var(--ordo-calendar-grid-surface);color:var(--ordo-text);cursor:pointer}
#agendaModule .ordo-week-head-day:last-child{border-right:0}
#agendaModule .ordo-week-head-day span{font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.06em;color:var(--ordo-muted)}
#agendaModule .ordo-week-head-day strong{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;font-size:14px}
#agendaModule .ordo-week-head-day.is-today strong{background:var(--ordo-primary,#6C5CE7);color:#fff}
#agendaModule .ordo-week-columns{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));position:relative;min-width:760px;background:var(--ordo-calendar-grid-surface)}
#agendaModule .ordo-timeline-event{position:absolute;box-sizing:border-box;z-index:2;min-height:28px;border:1px solid color-mix(in srgb,var(--event-color) 34%,var(--ordo-calendar-grid-line));border-left:4px solid var(--event-color);border-radius:9px;background:color-mix(in srgb,var(--event-color) 12%,var(--ordo-calendar-grid-surface));box-shadow:0 2px 8px rgba(0,0,0,.06);overflow:hidden;display:flex;align-items:stretch;transition:filter .14s ease,box-shadow .14s ease,transform .14s ease,opacity .14s ease}
#agendaModule .ordo-timeline-event:hover{z-index:8;filter:brightness(1.06);box-shadow:0 8px 20px rgba(0,0,0,.12);transform:translateY(-1px)}
#agendaModule .ordo-timeline-event.is-done{opacity:.52;filter:saturate(.65)}
#agendaModule .ordo-timeline-event.is-done .ordo-timeline-event-body strong{text-decoration:line-through}
#agendaModule .ordo-timeline-event-body{appearance:none;border:0;background:transparent;color:inherit;min-width:0;flex:1;padding:5px 6px;text-align:left;cursor:pointer;overflow:hidden}
#agendaModule .ordo-timeline-time{display:block;font-size:9px;font-weight:850;color:var(--ordo-muted);margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#agendaModule .ordo-timeline-event-body strong{display:block;font-size:11px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#agendaModule .ordo-timeline-event-body small{display:block;margin-top:2px;font-size:9px;line-height:1.15;color:var(--ordo-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#agendaModule .ordo-day-view{min-height:560px;padding:0;background:var(--ordo-calendar-grid-surface)}
#agendaModule .ordo-day-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid var(--ordo-calendar-grid-line);background:var(--ordo-calendar-grid-surface)}
#agendaModule .ordo-day-heading h3{margin:0;font-size:18px;text-transform:capitalize}
#agendaModule .ordo-day-heading span{font-size:12px;color:var(--ordo-muted)}
#agendaModule .ordo-day-time-calendar .ordo-time-grid{grid-template-columns:70px minmax(0,1fr)}
#agendaModule .ordo-single-day-column{border-right:0}
#agendaModule .ordo-event-check{appearance:none;flex:0 0 26px;width:26px;border:0;border-right:1px solid color-mix(in srgb,var(--event-color) 24%,var(--ordo-calendar-grid-line));background:color-mix(in srgb,var(--event-color) 9%,transparent);color:#fff;font-size:13px;font-weight:900;cursor:pointer;display:grid;place-items:center}
#agendaModule .ordo-event-check::before{content:"";width:14px;height:14px;border:1.5px solid color-mix(in srgb,var(--event-color) 58%,var(--ordo-muted));border-radius:5px;box-sizing:border-box}
#agendaModule .ordo-event-check.checked{background:var(--event-color)}
#agendaModule .ordo-event-check.checked::before{display:none}

/* Month overflow: rendered outside fixed-height day cells so it can never be clipped. */
.ordo-month-overflow-popover{position:fixed;z-index:100500;box-sizing:border-box;max-height:min(420px,calc(100vh - 20px));overflow:hidden;border:1px solid var(--theme-line,#29374b);border-radius:14px;background:var(--theme-surface,#111827);color:var(--theme-text,#eef2f7);box-shadow:0 20px 46px rgba(0,0,0,.30);padding:10px;display:flex;flex-direction:column;gap:8px}
.ordo-month-overflow-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:4px 4px 7px;border-bottom:1px solid var(--theme-line,#29374b)}
.ordo-month-overflow-head>div{min-width:0;display:flex;flex-direction:column;gap:2px}.ordo-month-overflow-head strong{font-size:13px;line-height:1.2;text-transform:capitalize}.ordo-month-overflow-head span{font-size:10px;color:var(--theme-muted,#94a3b8)}
.ordo-month-overflow-close{appearance:none;border:0;background:transparent;color:var(--theme-muted,#94a3b8);font-size:20px;line-height:1;width:28px;height:28px;padding:0;border-radius:7px}.ordo-month-overflow-close:hover{background:var(--theme-hover,#1b2738);color:var(--theme-text,#eef2f7)}
.ordo-month-overflow-list{display:flex;flex-direction:column;gap:5px;overflow:auto;min-height:0}
.ordo-month-overflow-event{appearance:none;width:100%;display:flex;align-items:center;gap:8px;border:1px solid transparent;border-radius:9px;background:transparent;color:inherit;text-align:left;padding:7px 8px;min-height:44px}.ordo-month-overflow-event:hover{background:var(--theme-hover,#1b2738);border-color:var(--theme-line,#29374b)}
.ordo-month-overflow-event>i{display:block;width:4px;align-self:stretch;min-height:28px;border-radius:999px;background:var(--event-color)}.ordo-month-overflow-event>span{display:block;min-width:0}.ordo-month-overflow-event strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ordo-month-overflow-event small{display:block;margin-top:3px;font-size:10px;color:var(--theme-muted,#94a3b8);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ordo-month-overflow-week{appearance:none;border:1px solid var(--theme-line,#29374b);border-radius:9px;background:var(--theme-surface-2,#172235);color:var(--theme-text,#eef2f7);font-size:10px;font-weight:800;padding:8px 10px}.ordo-month-overflow-week:hover{background:var(--theme-hover,#1b2738)}

@media(max-width:900px){#agendaModule .ordo-calendar-viewbar{justify-content:center}#agendaModule .ordo-alt-calendar{overflow:hidden}#agendaModule .ordo-week-time-head{min-width:822px}#agendaModule .ordo-time-scroll{overflow:auto}#agendaModule .ordo-timeline-event-body strong{font-size:10px}}
@media(max-width:640px){#agendaModule .ordo-view-switch{width:100%}#agendaModule .ordo-view-switch button{flex:1;padding:10px 8px}#agendaModule .ordo-time-scroll{max-height:620px}#agendaModule .ordo-day-heading{padding:12px 14px}#agendaModule .ordo-day-heading h3{font-size:16px}#agendaModule .ordo-day-time-calendar .ordo-time-grid{grid-template-columns:56px minmax(0,1fr)}#agendaModule .ordo-time-grid{grid-template-columns:56px minmax(0,1fr)}#agendaModule .ordo-week-time-head{grid-template-columns:56px repeat(7,minmax(104px,1fr));min-width:784px}#agendaModule .ordo-week-columns{grid-template-columns:repeat(7,minmax(104px,1fr));min-width:728px}#agendaModule .ordo-event-check{flex-basis:22px;width:22px}#agendaModule .ordo-timeline-event-body{padding:4px}.ordo-month-overflow-popover{max-width:calc(100vw - 20px)}}
