.sc-calendar {
  --sc-accent: #c62828;
  --sc-accent-soft: #fde7e7;
  --sc-surface: #ffffff;
  --sc-border: #e3e6ea;
  --sc-text: #1f2937;
  --sc-muted: #6b7280;
  --sc-ui-scale: 1;
  width: var(--sc-width, 100%);
  margin: 0 auto;
  max-width: var(--sc-max-width, 360px);
  height: var(--sc-height, auto);
  padding: calc(14px * var(--sc-ui-scale));
  border: 1px solid var(--sc-border);
  background: linear-gradient(180deg, #fffdfd 0%, #f6f8fb 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  color: var(--sc-text);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.sc-calendar-viewport {
  width: 100%;
  min-width: 0;
}

.sc-calendar-content {
  width: 100%;
  min-width: 0;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--sc-ui-scale));
  margin-bottom: calc(12px * var(--sc-ui-scale));
}

.sc-title-wrap {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.sc-title {
  margin-bottom: calc(8px * var(--sc-ui-scale));
  font-size: calc(18px * var(--sc-ui-scale));
  font-weight: 700;
}

.sc-nav-button {
  width: calc(36px * var(--sc-ui-scale));
  height: calc(36px * var(--sc-ui-scale));
  border: 0;
  background: var(--sc-accent-soft);
  color: var(--sc-accent);
  font-size: calc(18px * var(--sc-ui-scale));
  line-height: 1;
  cursor: pointer;
  margin-bottom: auto;
}

.sc-selects {
  display: flex;
  justify-content: center;
  gap: calc(8px * var(--sc-ui-scale));
  flex-wrap: wrap;
}

.sc-selects select {
  min-width: calc(104px * var(--sc-ui-scale));
  height: calc(36px * var(--sc-ui-scale));
  padding: 0 calc(34px * var(--sc-ui-scale)) 0 calc(10px * var(--sc-ui-scale));
  border: 1px solid var(--sc-border);
  background: var(--sc-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2.25 4.5 6 8.25 9.75 4.5'/%3E%3C/svg%3E");
  background-position: right calc(14px * var(--sc-ui-scale)) center;
  background-repeat: no-repeat;
  background-size: calc(12px * var(--sc-ui-scale)) calc(12px * var(--sc-ui-scale));
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: calc(13px * var(--sc-ui-scale));
}

.sc-table-wrap {
  width: 100%;
  overflow: hidden;
  min-height: 0;
}

.sc-calendar--fixed-height {
  overflow: hidden;
}

.sc-calendar--fixed-height .sc-calendar-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.sc-calendar--fixed-height .sc-table-wrap {
  overflow: visible;
}

.sc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: calc(3px * var(--sc-ui-scale));
  table-layout: fixed;
}

.sc-table th {
  padding: calc(6px * var(--sc-ui-scale)) 0;
  color: var(--sc-muted);
  font-size: calc(12px * var(--sc-ui-scale));
  font-weight: 600;
}

.sc-table td {
  height: calc(38px * var(--sc-ui-scale));
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background: #fff;
  font-size: calc(13px * var(--sc-ui-scale));
  transition: background 0.2s ease, transform 0.2s ease;
}

.sc-day {
  color: var(--sc-text);
  background: #fff;
}

.sc-table td:empty {
  cursor: default;
  background: transparent;
}

.sc-day:hover {
  background: #eef2f7;
  transform: translateY(-1px);
}

.weekend {
  color: var(--sc-muted);
}

.today {
  background: #111827 !important;
  color: #ffffff !important;
  outline: 2px solid #111827;
  outline-offset: -2px;
  font-weight: 700;
}

.is-holiday {
  background: var(--sc-accent) !important;
  color: #fff;
  font-weight: 700;
}

.has-events {
  box-shadow: inset 0 calc(-3px * var(--sc-ui-scale)) 0 rgba(198, 40, 40, 0.25);
}

.sc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.sc-modal[hidden] {
  display: none;
}

.sc-modal-dialog {
  width: min(100%, 460px);
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.sc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.sc-modal-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--sc-muted, #6b7280);
}

.sc-modal-content {
  padding: 16px 20px 20px;
}

.sc-event-range {
  margin: 4px 0 0;
  color: var(--sc-muted, #6b7280);
  font-size: 13px;
}

.sc-modal-event + .sc-modal-event {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--sc-border, #e3e6ea);
}

@media (max-width: 640px) {
  .sc-calendar {
    max-width: 100%;
    padding: calc(12px * var(--sc-ui-scale));
  }

  .sc-header {
    gap: calc(8px * var(--sc-ui-scale));
  }

  .sc-title {
    font-size: calc(17px * var(--sc-ui-scale));
  }

  .sc-nav-button {
    width: calc(34px * var(--sc-ui-scale));
    height: calc(34px * var(--sc-ui-scale));
    font-size: calc(18px * var(--sc-ui-scale));
    margin-bottom: auto;
  }

  .sc-selects select {
    height: calc(34px * var(--sc-ui-scale));
  }

  .sc-table td {
    height: calc(36px * var(--sc-ui-scale));
    font-size: calc(13px * var(--sc-ui-scale));
  }
}

.sc-single-event {
  padding: 32px 16px;
}

.sc-single-event__inner {
  width: min(100%, 860px);
  margin: 0 auto;
}

.sc-single-event__article {
  padding: 24px;
  border: 1px solid var(--sc-border);
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.sc-single-event__header {
  margin-bottom: 16px;
}

.sc-single-event__title {
  margin: 0 0 8px;
}

.sc-single-event__date {
  margin: 0;
  color: var(--sc-muted);
  font-size: 15px;
  font-weight: 600;
}

.sc-single-event__content > :first-child {
  margin-top: 0;
}

@media (max-width: 640px) {
  .sc-single-event {
    padding: 20px 12px;
  }

  .sc-single-event__article {
    padding: 16px;
  }
}
