.fox-crowd-calendar {
  position: relative;
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", Meiryo, sans-serif;
  font-variant-numeric: tabular-nums;
  container-type: inline-size;
}

.fox-crowd-calendar button,
.fox-crowd-calendar select {
  font: inherit;
}

.fox-crowd-head {
  display: grid;
  gap: 7px;
}

.fox-crowd-instance-buttons {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.fox-crowd-instance-buttons button {
  flex: 1 0 40px;
  min-width: 40px;
  padding: 5px 8px;
  border: 1px solid #dbe2ea;
  border-radius: 5px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.fox-crowd-instance-buttons button.is-active {
  border-color: #7c3aed;
  background: #ede9fe;
  color: #5b21b6;
}

.fox-crowd-instance-buttons button:focus-visible,
.fox-crowd-month-button:focus-visible,
.fox-crowd-day:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

.fox-crowd-instance-select-wrap {
  display: none;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.fox-crowd-instance-select {
  min-width: 0;
  flex: 1;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #111827;
}

.fox-crowd-month-nav {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
}

.fox-crowd-month-label {
  font-size: 15px;
  text-align: center;
}

.fox-crowd-month-button {
  width: 30px;
  height: 28px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.fox-crowd-server-label {
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fox-crowd-weekdays,
.fox-crowd-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.fox-crowd-weekdays {
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef2f7;
}

.fox-crowd-weekdays span {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.fox-crowd-weekdays .is-saturday,
.fox-crowd-day.is-saturday .fox-crowd-date-circle {
  color: #1d4ed8;
}

.fox-crowd-weekdays .is-sunday,
.fox-crowd-day.is-sunday .fox-crowd-date-circle {
  color: #b91c1c;
}

.fox-crowd-grid {
  min-height: 330px;
  transition: opacity .15s ease;
}

.fox-crowd-calendar.is-loading .fox-crowd-grid {
  opacity: .42;
}

.fox-crowd-day {
  position: relative;
  display: grid;
  grid-template-rows: 34px 14px;
  justify-items: center;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 4px 1px 2px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

.fox-crowd-day:hover {
  background: #f8fafc;
}

.fox-crowd-day.is-outside {
  opacity: .38;
}

.fox-crowd-date-circle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #1f2937;
  font-size: 12px;
  font-weight: 850;
}

.fox-crowd-day.level-green .fox-crowd-date-circle,
.fox-crowd-legend .is-green {
  border-color: #86efac;
  background: #dcfce7;
}

.fox-crowd-day.level-orange .fox-crowd-date-circle,
.fox-crowd-legend .is-orange {
  border-color: #fdba74;
  background: #ffedd5;
}

.fox-crowd-day.level-red .fox-crowd-date-circle,
.fox-crowd-legend .is-red {
  border-color: #fca5a5;
  background: #fee2e2;
}

.fox-crowd-day.level-unknown .fox-crowd-date-circle,
.fox-crowd-legend .is-unknown {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.fox-crowd-day.is-today .fox-crowd-date-circle {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4f46e5;
}

.fox-crowd-peak {
  overflow: hidden;
  max-width: 100%;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fox-crowd-host-mark {
  position: absolute;
  top: 3px;
  right: 2px;
  padding: 1px 2px;
  border-radius: 3px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
}

.fox-crowd-event-star {
  position: absolute;
  top: 0;
  left: calc(50% + 9px);
  z-index: 2;
  color: #2563eb;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff;
}

.fox-crowd-host-mark.risk-high {
  background: #fee2e2;
  color: #b91c1c;
}

.fox-crowd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 8px;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
}

.fox-crowd-legend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.fox-crowd-legend i {
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 1px solid;
  border-radius: 50%;
}

.fox-crowd-popover {
  position: fixed;
  z-index: 100000;
  box-sizing: border-box;
  max-height: calc(100vh - 16px);
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .2);
  color: #1f2937;
  font-size: 12px;
  line-height: 1.65;
  overflow-y: auto;
}

.fox-crowd-popover[hidden] {
  display: none;
}

.fox-crowd-popover-title {
  padding-right: 30px;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
}

.fox-crowd-popover-kind {
  margin-top: 1px;
  color: #7c3aed;
  font-size: 10px;
  font-weight: 800;
}

.fox-crowd-current {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 800;
}

.fox-crowd-wipe {
  display: inline-block;
  margin-top: 5px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ffedd5;
  color: #9a3412;
  font-weight: 800;
}

.fox-crowd-popover p {
  margin: 7px 0;
}

.fox-crowd-popover-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
  padding-top: 6px;
  border-top: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 10px;
}

.fox-crowd-popover-values span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.fox-crowd-popover-values b {
  color: #111827;
}

.fox-crowd-event-notice {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #bfdbfe;
}

.fox-crowd-event-heading {
  margin-bottom: 5px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
}

.fox-crowd-event-notice section + section {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #dbeafe;
}

.fox-crowd-event-notice strong {
  display: block;
  color: #1e3a8a;
  font-size: 12px;
}

.fox-crowd-event-notice small {
  display: block;
  color: #64748b;
  font-size: 9px;
}

.fox-crowd-event-notice p {
  margin: 3px 0 0;
  color: #334155;
}

.fox-crowd-loading,
.fox-crowd-error {
  grid-column: 1 / -1;
  padding: 24px 8px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

@container (max-width: 360px) {
  .fox-crowd-instance-buttons {
    display: none;
  }

  .fox-crowd-instance-select-wrap {
    display: flex;
  }

  .fox-crowd-grid {
    min-height: 300px;
  }

  .fox-crowd-day {
    grid-template-rows: 31px 12px;
    min-height: 47px;
  }

  .fox-crowd-date-circle {
    width: 29px;
    height: 29px;
  }
}
