/* DFSC DASH Calendar
 * Widget selectors are written as ".dfsc-cal.dfsc-cal .x" (specificity 0,3,0) on purpose:
 * Nimble Builder injects rules like ".nb-loc [data-sek-level] button { font-size: 22px }" (0,2,1)
 * and the Customizr theme styles h2/h3/p inside sections, and both would otherwise win.
 */
.dfsc-cal {
	--dfsc-border: #e3e6ea;
	--dfsc-muted: #6b7280;
	--dfsc-text: #1f2937;
	--dfsc-bg: #fff;
	--dfsc-bg-alt: #f7f8fa;
	--dfsc-accent: #2f2f8f;
	--dfsc-radius: 8px;
	color: var(--dfsc-text);
	font-size: 15px;
	line-height: 1.4;
	max-width: 100%;
	box-sizing: border-box;
}
.dfsc-cal.dfsc-cal *, .dfsc-cal.dfsc-cal *::before, .dfsc-cal.dfsc-cal *::after { box-sizing: inherit; }
.dfsc-cal.dfsc-cal p, .dfsc-cal.dfsc-cal h2, .dfsc-cal.dfsc-cal h3, .dfsc-cal.dfsc-cal button, .dfsc-cal.dfsc-cal table, .dfsc-cal.dfsc-cal th, .dfsc-cal.dfsc-cal td { font-family: inherit; text-transform: none; letter-spacing: normal; }

.dfsc-cal.dfsc-cal .dfsc-cal__loading { padding: 2em 0; color: var(--dfsc-muted); text-align: center; }

/* Toolbar */
.dfsc-cal.dfsc-cal .dfsc-cal__toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75em; flex-wrap: wrap; margin: 0 0 .75em; }
.dfsc-cal.dfsc-cal .dfsc-cal__nav, .dfsc-cal.dfsc-cal .dfsc-cal__views { display: inline-flex; gap: .25em; }
.dfsc-cal.dfsc-cal .dfsc-cal__title { margin: 0; padding: 0; font-size: 20px; font-weight: 700; line-height: 1.2; flex: 1 1 auto; text-align: center; min-width: 12ch; color: var(--dfsc-text); }
.dfsc-cal.dfsc-cal .dfsc-cal__btn {
	appearance: none; -webkit-appearance: none; border: 1px solid var(--dfsc-border); background: var(--dfsc-bg); color: var(--dfsc-text);
	border-radius: 6px; padding: 6px 11px; margin: 0; font: inherit; font-size: 14px; font-weight: 500; line-height: 1; cursor: pointer; min-width: 34px; box-shadow: none; text-shadow: none;
}
.dfsc-cal.dfsc-cal .dfsc-cal__btn:hover { background: var(--dfsc-bg-alt); color: var(--dfsc-text); }
.dfsc-cal.dfsc-cal .dfsc-cal__btn:focus-visible { outline: 2px solid var(--dfsc-accent); outline-offset: 2px; }
.dfsc-cal.dfsc-cal .dfsc-cal__btn.is-active { background: var(--dfsc-accent); border-color: var(--dfsc-accent); color: #fff; }

/* Legend / filters */
.dfsc-cal.dfsc-cal .dfsc-cal__legend { display: flex; flex-wrap: wrap; gap: .4em; margin: 0 0 .75em; }
.dfsc-cal.dfsc-cal .dfsc-cal__chip {
	appearance: none; -webkit-appearance: none; border: 1px solid var(--dfsc-border); background: var(--dfsc-bg); color: var(--dfsc-text);
	border-radius: 999px; padding: 5px 11px 5px 8px; margin: 0; font: inherit; font-size: 13px; line-height: 1; cursor: pointer; box-shadow: none;
	display: inline-flex; align-items: center; gap: .4em;
}
.dfsc-cal.dfsc-cal .dfsc-cal__chip:hover { background: var(--dfsc-bg-alt); color: var(--dfsc-text); }
.dfsc-cal.dfsc-cal .dfsc-cal__chip.is-active { border-color: var(--dfsc-text); background: var(--dfsc-text); color: #fff; }
.dfsc-cal.dfsc-cal .dfsc-cal__chip:focus-visible { outline: 2px solid var(--dfsc-accent); outline-offset: 2px; }
.dfsc-cal.dfsc-cal .dfsc-cal__dot, .dfsc-cal__dialog .dfsc-cal__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); display: inline-block; flex: 0 0 auto; margin-right: 6px; }
.dfsc-cal.dfsc-cal .dfsc-cal__chip .dfsc-cal__dot { margin-right: 0; }

/* Status */
.dfsc-cal.dfsc-cal .dfsc-cal__status { color: var(--dfsc-muted); font-size: 14px; min-height: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__status.is-loading { padding: .25em 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__status.is-error { color: #9f1d1d; background: #fdf2f2; border: 1px solid #f5c2c2; padding: .75em 1em; border-radius: var(--dfsc-radius); }
.dfsc-cal.dfsc-cal .dfsc-cal__fallback { font-weight: 600; }
.dfsc-cal.dfsc-cal .dfsc-cal__body[aria-busy="true"] { opacity: .55; transition: opacity .15s; }

/* Month grid */
.dfsc-cal.dfsc-cal .dfsc-cal__grid { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--dfsc-border); border-radius: var(--dfsc-radius); overflow: hidden; background: var(--dfsc-bg); font-size: 15px; }
.dfsc-cal.dfsc-cal .dfsc-cal__grid th { background: var(--dfsc-bg-alt); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--dfsc-muted); padding: 8px 4px; border: 0; border-bottom: 1px solid var(--dfsc-border); text-align: center; }
.dfsc-cal.dfsc-cal .dfsc-cal__day { vertical-align: top; border: 0; border-right: 1px solid var(--dfsc-border); border-bottom: 1px solid var(--dfsc-border); padding: 5px 4px 6px; min-height: 100px; height: 100px; }
.dfsc-cal.dfsc-cal .dfsc-cal__day:last-child { border-right: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__grid tbody tr:last-child .dfsc-cal__day { border-bottom: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__day.is-outside { background: var(--dfsc-bg-alt); }
.dfsc-cal.dfsc-cal .dfsc-cal__day.is-outside .dfsc-cal__daynum { color: #b0b6be; }
.dfsc-cal.dfsc-cal .dfsc-cal__daynum { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.dfsc-cal.dfsc-cal .dfsc-cal__daynum span { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 50%; }
.dfsc-cal.dfsc-cal .dfsc-cal__day.is-today .dfsc-cal__daynum span { background: var(--dfsc-accent); color: #fff; }
.dfsc-cal.dfsc-cal .dfsc-cal__events { display: flex; flex-direction: column; gap: 2px; }

.dfsc-cal.dfsc-cal .dfsc-cal__pill {
	appearance: none; -webkit-appearance: none; border: 0; border-left: 3px solid var(--c, #999); background: color-mix(in srgb, var(--c, #999) 14%, #fff);
	color: var(--dfsc-text); border-radius: 4px; padding: 2px 5px; margin: 0; font: inherit; font-size: 12px; font-weight: 400; line-height: 1.25; text-align: left; cursor: pointer; box-shadow: none; text-shadow: none;
	display: flex; gap: 4px; align-items: baseline; width: 100%; overflow: hidden; min-width: 0;
}
@supports not (background: color-mix(in srgb, red 10%, white)) {
	.dfsc-cal.dfsc-cal .dfsc-cal__pill { background: var(--dfsc-bg-alt); }
}
.dfsc-cal.dfsc-cal .dfsc-cal__pill:hover { filter: brightness(.96); color: var(--dfsc-text); }
.dfsc-cal.dfsc-cal .dfsc-cal__pill:focus-visible { outline: 2px solid var(--dfsc-accent); outline-offset: 1px; }
.dfsc-cal.dfsc-cal .dfsc-cal__pill-time { color: var(--dfsc-muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.dfsc-cal.dfsc-cal .dfsc-cal__pill-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; min-width: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__pill.is-overflow { display: none; }
.dfsc-cal.dfsc-cal .dfsc-cal__day.is-expanded .dfsc-cal__pill.is-overflow { display: flex; }
.dfsc-cal.dfsc-cal .dfsc-cal__more { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--dfsc-accent); font: inherit; font-size: 12px; padding: 2px 5px; margin: 0; text-align: left; cursor: pointer; box-shadow: none; }
.dfsc-cal.dfsc-cal .dfsc-cal__more:hover { text-decoration: underline; background: none; }
.dfsc-cal.dfsc-cal .dfsc-cal__day.is-expanded .dfsc-cal__more { display: none; }

/* List view */
.dfsc-cal.dfsc-cal .dfsc-cal__list { display: flex; flex-direction: column; gap: 1em; }
.dfsc-cal.dfsc-cal .dfsc-cal__daygroup { border: 1px solid var(--dfsc-border); border-radius: var(--dfsc-radius); overflow: hidden; background: var(--dfsc-bg); }
.dfsc-cal.dfsc-cal .dfsc-cal__dayhead { margin: 0; padding: 8px 14px; background: var(--dfsc-bg-alt); border-bottom: 1px solid var(--dfsc-border); font-size: 15px; font-weight: 700; line-height: 1.3; display: flex; justify-content: space-between; align-items: baseline; gap: .5em; color: var(--dfsc-text); }
.dfsc-cal.dfsc-cal .dfsc-cal__daygroup.is-today .dfsc-cal__dayhead { background: var(--dfsc-accent); color: #fff; }
.dfsc-cal.dfsc-cal .dfsc-cal__dayhead-date { font-weight: 400; font-size: 13px; opacity: .85; }
.dfsc-cal.dfsc-cal .dfsc-cal__row { border-radius: 0; border-left-width: 5px; padding: 9px 14px; font-size: 14px; gap: 1em; align-items: center; border-bottom: 1px solid var(--dfsc-border); background: var(--dfsc-bg); }
.dfsc-cal.dfsc-cal .dfsc-cal__row:hover { background: color-mix(in srgb, var(--c, #999) 10%, #fff); }
.dfsc-cal.dfsc-cal .dfsc-cal__daygroup .dfsc-cal__row:last-child { border-bottom: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__row-time { flex: 0 0 140px; color: var(--dfsc-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.dfsc-cal.dfsc-cal .dfsc-cal__row-main { display: flex; flex-direction: column; min-width: 0; }
.dfsc-cal.dfsc-cal .dfsc-cal__row-title { font-weight: 600; }
.dfsc-cal.dfsc-cal .dfsc-cal__row-meta { color: var(--dfsc-muted); font-size: 12.5px; }
.dfsc-cal.dfsc-cal .dfsc-cal__empty, .dfsc-cal.dfsc-cal .dfsc-cal__empty-day { color: var(--dfsc-muted); margin: .75em .9em; font-size: 14px; font-style: italic; }
.dfsc-cal.dfsc-cal .dfsc-cal__empty { text-align: center; }
.dfsc-cal.dfsc-cal .dfsc-cal__foot { margin: .75em 0 0; padding: 0; color: var(--dfsc-muted); font-size: 12px; }

/* Detail dialog (appended to body, outside the widget and outside Nimble's scope) */
.dfsc-cal__overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 99999; }
.dfsc-cal__dialog { position: relative; background: #fff; color: #1f2937; border-radius: 10px; border-top: 6px solid var(--c, #999); max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; padding: 20px 24px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); font-size: 15px; line-height: 1.45; box-sizing: border-box; }
.dfsc-cal__dialog * { box-sizing: border-box; }
.dfsc-cal__dialog .dfsc-cal__close { position: absolute; top: 8px; right: 10px; appearance: none; -webkit-appearance: none; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; padding: 4px 8px; margin: 0; box-shadow: none; }
.dfsc-cal__dialog .dfsc-cal__close:hover { color: #111; background: none; }
.dfsc-cal__dialog .dfsc-cal__dialog-title { margin: 0 24px 4px 0; padding: 0; font-size: 21px; font-weight: 700; line-height: 1.25; color: #1f2937; text-transform: none; }
.dfsc-cal__dialog .dfsc-cal__dialog-when { margin: 0 0 14px; color: #6b7280; font-size: 15px; }
.dfsc-cal__dialog .dfsc-cal__dialog-meta { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; margin: 0 0 14px; font-size: 14px; }
.dfsc-cal__dialog .dfsc-cal__dialog-meta dt { color: #6b7280; margin: 0; padding: 0; font-weight: 400; background: none; }
.dfsc-cal__dialog .dfsc-cal__dialog-meta dd { margin: 0; padding: 0; display: flex; align-items: center; background: none; }
/* Customizr decorates dt/dd with a ::before bar and padding; neutralize inside the dialog. */
.dfsc-cal__dialog .dfsc-cal__dialog-meta dt::before, .dfsc-cal__dialog .dfsc-cal__dialog-meta dd::before,
.dfsc-cal__dialog .dfsc-cal__dialog-meta dt::after, .dfsc-cal__dialog .dfsc-cal__dialog-meta dd::after { content: none; display: none; }
.dfsc-cal__dialog .dfsc-cal__dialog-details, .dfsc-cal__dialog .dfsc-cal__dialog-notice { border-top: 1px solid #e3e6ea; padding-top: 12px; font-size: 14px; }
.dfsc-cal__dialog .dfsc-cal__dialog-details p { margin: 0 0 .6em; font-size: 14px; }
.dfsc-cal__dialog .dfsc-cal__dialog-notice { color: #92400e; }

/* Small screens */
@media (max-width: 639px) {
	.dfsc-cal.dfsc-cal .dfsc-cal__title { order: -1; flex-basis: 100%; }
	.dfsc-cal.dfsc-cal .dfsc-cal__toolbar { justify-content: space-between; }
	.dfsc-cal.dfsc-cal .dfsc-cal__row { flex-direction: column; align-items: flex-start; gap: 2px; }
	.dfsc-cal.dfsc-cal .dfsc-cal__row-time { flex-basis: auto; }
}
@media print {
	.dfsc-cal.dfsc-cal .dfsc-cal__btn, .dfsc-cal.dfsc-cal .dfsc-cal__legend, .dfsc-cal.dfsc-cal .dfsc-cal__foot { display: none; }
	.dfsc-cal.dfsc-cal .dfsc-cal__pill.is-overflow { display: flex; }
	.dfsc-cal.dfsc-cal .dfsc-cal__more { display: none; }
}
