.sp-book,
.sp-book__dialog {
  --sp-action: #111111;
  --sp-action-hover: #2b2b2b;
  --sp-text: #111111;
  --sp-muted: #5f5f5f;
  --sp-border: #ececec;
  --sp-border-strong: #d6d6d6;
  --sp-subtle: #f5f5f5;
  --sp-error: #b42318;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--sp-text);
  font-size: 16px;
  line-height: 1.5;
  box-sizing: border-box;
}

.sp-book *,
.sp-book *::before,
.sp-book *::after,
.sp-book__dialog *,
.sp-book__dialog *::before,
.sp-book__dialog *::after {
  box-sizing: border-box;
}

.sp-book [hidden] {
  display: none !important;
}

.sp-book__panel,
.sp-book__done {
  background: transparent;
  border: 0;
  padding: 0;
}

.sp-book__kicker {
  margin: 0 0 4px;
  color: var(--sp-action);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sp-book__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sp-book__muted {
  margin: 8px 0 0;
  color: var(--sp-muted);
  font-size: 14px;
}

.sp-book__tzline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--sp-text);
  font-size: 14px;
  font-weight: 600;
}

.sp-book__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.sp-book__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-text);
}

.sp-book__input,
.sp-book__select,
.sp-book button {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.sp-book__input,
.sp-book__select {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--sp-text);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}

.sp-book__select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #5a5f6b 50%), linear-gradient(135deg, #5a5f6b 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.sp-book__input:focus,
.sp-book__select:focus {
  border-color: var(--sp-action);
  outline: 2px solid var(--sp-action);
  outline-offset: 1px;
}

.sp-book__input:-webkit-autofill,
.sp-book__input:-webkit-autofill:hover,
.sp-book__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--sp-text);
  caret-color: var(--sp-text);
  box-shadow: 0 0 0 1000px #fff inset;
}

.sp-book:not([data-sp-ready]) .sp-book__split {
  display: none;
}

.sp-book[data-sp-ready] .sp-book__fallback {
  display: none;
}

.sp-book__fallback {
  margin: 16px 0 0;
  color: var(--sp-muted);
  font-size: 14px;
}

.sp-book__split {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.sp-book__nav {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
}

.sp-book__month {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.sp-book__nav-btn,
.sp-book__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-text);
  cursor: pointer;
}

.sp-book__nav-btn:hover:not(:disabled),
.sp-book__icon:hover {
  background: var(--sp-subtle);
}

.sp-book__nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sp-book__dow,
.sp-book__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.sp-book__dow {
  margin-top: 12px;
  color: var(--sp-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.sp-book__day {
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sp-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sp-book__day:hover:not(:disabled) {
  background: var(--sp-subtle);
}

.sp-book__day[aria-pressed="true"] {
  background: var(--sp-action);
  color: #fff;
}

.sp-book__day--today:not([aria-pressed="true"]) {
  box-shadow: inset 0 0 0 1.5px var(--sp-action);
}

.sp-book__day:disabled,
.sp-book__day--empty {
  color: #c8ccd4;
  font-weight: 500;
  cursor: default;
  background: transparent;
  box-shadow: none;
}

.sp-book__daylabel {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.sp-book__slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sp-book__slot {
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--sp-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sp-book__slot:hover {
  border-color: var(--sp-action);
  background: var(--sp-subtle);
}

.sp-book__day:focus-visible,
.sp-book__slot:focus-visible,
.sp-book__nav-btn:focus-visible,
.sp-book__icon:focus-visible,
.sp-book__link:focus-visible,
.sp-book__more:focus-visible,
.sp-book__submit:focus-visible {
  outline: 2px solid var(--sp-action);
  outline-offset: 2px;
}

.sp-book__done {
  text-align: left;
}

.sp-book__done-time {
  display: block;
  margin-top: 4px;
}

.sp-book__mark {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--sp-subtle);
  display: grid;
  place-items: center;
}

.sp-book__mark::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--sp-action);
  border-bottom: 2px solid var(--sp-action);
  transform: rotate(-45deg) translate(1px, -1px);
}

.sp-book__dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--sp-text);
  box-shadow: 0 24px 64px rgba(15, 20, 38, 0.18);
  overflow: auto;
}

.sp-book__dialog::backdrop {
  background: rgba(15, 20, 38, 0.48);
}

.sp-book__form {
  position: relative;
  padding: 24px;
}

.sp-book__dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sp-book__when {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--sp-subtle);
  font-size: 14px;
  font-weight: 600;
}

.sp-book__link,
.sp-book__more {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sp-action);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sp-book__more {
  margin-top: 16px;
}

.sp-book__names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sp-book__names .sp-book__field {
  margin-top: 16px;
}

.sp-book__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 14px;
}

.sp-book__check input {
  margin-top: 3px;
}

.sp-book__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sp-book__error {
  min-height: 0;
  margin: 12px 0 0;
  color: var(--sp-error);
  font-size: 14px;
}

.sp-book__error:empty {
  display: none;
}

.sp-book__submit {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--sp-action);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.sp-book__submit:hover:not(:disabled) {
  background: var(--sp-action-hover);
}

.sp-book__submit:disabled {
  opacity: 0.65;
  cursor: default;
}

@container (min-width: 560px) {
  .sp-book__split {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.sp-book {
  container-type: inline-size;
}

@media (max-width: 420px) {
  .sp-book__names {
    grid-template-columns: 1fr;
  }

  .sp-book__form {
    padding: 20px 16px;
  }
}
