/* 校網近期行事獨立樣式：不改動教師系統其他日曆畫面。 */
.calendar-widget-compact { background: transparent; color: #1d314d; overflow-x: hidden; }
.calendar-widget-compact .calendar-widget-shell { width: 100%; padding: 3px 6px 8px; }
.calendar-widget-compact .calendar-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 2px 12px; margin-bottom: 10px;
  border-bottom: 1px solid #dce7f3;
}
.calendar-widget-compact .calendar-widget-header p { color: #66819f; font-size: 12px; letter-spacing: 0; line-height: 1.1; }
.calendar-widget-compact .calendar-widget-header h1 { color: #153c70; font-size: 19px; font-weight: 800; margin: 2px 0 0; line-height: 1.25; }
.calendar-widget-compact .calendar-widget-header a {
  flex: none; color: #17619b; font-size: 13px; font-weight: 750;
  border-radius: 6px; padding: 7px 4px; text-decoration: none;
}
.calendar-widget-compact .calendar-widget-header a:focus-visible,
.calendar-widget-compact .calendar-widget-announcement:focus-visible { outline: 3px solid #005fcc; outline-offset: 2px; }
.calendar-widget-compact .calendar-widget-header a:hover { text-decoration: underline; }
.calendar-widget-compact .calendar-widget-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.calendar-widget-compact .calendar-widget-item {
  min-width: 0; display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px;
  margin: 0; padding: 11px 12px; background: #fff; border: 1px solid #e2eaf3;
  border-radius: 12px; box-shadow: 0 2px 7px rgba(28,74,122,.035);
}
.calendar-widget-compact .calendar-widget-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  align-content: center; min-height: 58px; border-radius: 10px;
  color: #21538b; background: #edf4fc; font-variant-numeric: tabular-nums;
}
.calendar-widget-compact .calendar-widget-date strong { font-size: 17px; line-height: 1.25; }
.calendar-widget-compact .calendar-widget-date span { color: #5b7697; font-size: 11px; margin-top: 2px; }
.calendar-widget-compact .calendar-widget-content { min-width: 0; }
.calendar-widget-compact .calendar-widget-category {
  display: inline-flex; padding: 1px 7px; border: 0; border-radius: 20px;
  font-size: 11px; line-height: 1.5; font-weight: 750;
}
.calendar-widget-compact .calendar-widget-content h2 {
  color: #1c3452; font-size: 15px; font-weight: 800;
  line-height: 1.45; overflow-wrap: anywhere; margin: 4px 0 2px;
}
.calendar-widget-compact .calendar-widget-content p {
  color: #65798e; font-size: 12px; line-height: 1.45;
  overflow-wrap: anywhere; margin: 0;
}
.calendar-widget-compact .calendar-widget-announcement { font-size: 12px; padding: 2px 6px; margin-top: 4px; }
.calendar-widget-compact .calendar-widget-empty {
  margin: 0; padding: 19px 10px; background: #f5f9fd;
  border-radius: 10px; color: #617a95; font-size: 14px;
}
@media (max-width: 560px) {
  .calendar-widget-compact .calendar-widget-shell { padding: 2px 3px 6px; }
  .calendar-widget-compact .calendar-widget-header { margin-bottom: 7px; padding-bottom: 8px; }
  .calendar-widget-compact .calendar-widget-header h1 { font-size: 17px; }
  .calendar-widget-compact .calendar-widget-list { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .calendar-widget-compact .calendar-widget-item { grid-template-columns: 54px minmax(0,1fr); padding: 8px; gap: 9px; border-radius: 10px; }
  .calendar-widget-compact .calendar-widget-date { min-height: 54px; }
  .calendar-widget-compact .calendar-widget-date strong { font-size: 16px; }
  .calendar-widget-compact .calendar-widget-content h2 { font-size: 14px; margin: 2px 0; }
  .calendar-widget-compact .calendar-widget-content p { font-size: 12px; }
}

/* v1.23.2.9.9.2：內容高度隨卡片決定，不受 iframe 視窗高度牽動。 */
html,
body.calendar-widget-compact {
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
}
body.calendar-widget-compact .calendar-widget-shell {
  height: auto !important;
  min-height: 0 !important;
  box-sizing: border-box;
}
