/* =========================================================
   内視鏡検査 予約空き状況
   Prefix: stm-ea
========================================================= */
.stm-ea {
  --stm-ea-main: #94424d;
  --stm-ea-main-dark: #6f3039;
  --stm-ea-accent: #b99b63;
  --stm-ea-bg: #f7f2ea;
  --stm-ea-paper: #fffdf9;
  --stm-ea-line: #e4d8cb;
  --stm-ea-text: #3c342e;
  --stm-ea-muted: #746b64;
  --stm-ea-saturday: #497ca9;
  --stm-ea-sunday: #b64c59;

  position: relative;
  padding: 80px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(185, 155, 99, 0.13), transparent 24%),
    radial-gradient(circle at 92% 90%, rgba(148, 66, 77, 0.08), transparent 26%),
    var(--stm-ea-bg);
  color: var(--stm-ea-text);
}

.stm-ea *,
.stm-ea *::before,
.stm-ea *::after {
  box-sizing: border-box;
}

.stm-ea__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.stm-ea__heading {
  margin-bottom: 38px;
  text-align: center;
}

.stm-ea__heading-en {
  margin: 0 0 9px;
  color: var(--stm-ea-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.stm-ea__title {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0 18px 19px;
  color: var(--stm-ea-text);
  font-family: "ten-mincho", serif;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.45;
}

.stm-ea__title span {
  color: var(--stm-ea-main);
}

.stm-ea__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 92px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stm-ea-main), var(--stm-ea-accent));
  transform: translateX(-50%);
}

.stm-ea__block {
  position: relative;
  margin-top: 28px;
  padding: 30px;
  border: 1px solid rgba(185, 155, 99, 0.35);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.97);
  box-shadow: 0 12px 36px rgba(76, 57, 45, 0.08);
}

.stm-ea__period {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--stm-ea-main-dark);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.7;
}

.stm-ea__period::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stm-ea-accent);
  box-shadow: 0 0 0 5px rgba(185, 155, 99, 0.15);
}

.stm-ea__scroll-guide {
  display: none;
}

.stm-ea__scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--stm-ea-line);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--stm-ea-main) #eee5da;
  scrollbar-width: thin;
}

.stm-ea__scroll::-webkit-scrollbar {
  height: 8px;
}

.stm-ea__scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #eee5da;
}

.stm-ea__scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--stm-ea-main);
}

.stm-ea__table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--stm-ea-text);
  font-size: 15px;
  line-height: 1.5;
}

.stm-ea__table th,
.stm-ea__table td {
  height: 72px;
  padding: 12px 10px;
  border-right: 1px solid var(--stm-ea-line);
  border-bottom: 1px solid var(--stm-ea-line);
  text-align: center;
  vertical-align: middle;
}

.stm-ea__table tr > *:last-child {
  border-right: 0;
}

.stm-ea__table tbody tr:last-child > * {
  border-bottom: 0;
}

.stm-ea__corner,
.stm-ea__exam {
  position: sticky;
  left: 0;
  width: 150px;
  min-width: 150px;
}

.stm-ea__corner {
  z-index: 4;
  border-radius: 11px 0 0;
  background: var(--stm-ea-main-dark);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.stm-ea__date {
  position: relative;
  z-index: 1;
  background: #f6efe7;
  color: var(--stm-ea-text);
  font-weight: 700;
  white-space: nowrap;
}

.stm-ea__date.is-saturday {
  color: var(--stm-ea-saturday);
}

.stm-ea__date.is-sunday {
  color: var(--stm-ea-sunday);
}

.stm-ea__date.is-today::after {
  content: "本日";
  position: absolute;
  top: 4px;
  left: 50%;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--stm-ea-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  transform: translateX(-50%);
}

.stm-ea__date.is-today {
  padding-top: 24px;
  background: #fbf2f1;
  box-shadow: inset 0 0 0 2px rgba(148, 66, 77, 0.36);
}

.stm-ea__date-md,
.stm-ea__date-week {
  display: inline-block;
}

.stm-ea__exam {
  z-index: 3;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.stm-ea__exam--stomach {
  background: #f3e5e6;
  color: var(--stm-ea-main-dark);
}

.stm-ea__exam--colon {
  background: #eee7d8;
  color: #6e5933;
}

.stm-ea__table td {
  background: #fff;
  font-weight: 500;
}

.stm-ea__remaining {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  color: var(--stm-ea-text);
  white-space: nowrap;
}

.stm-ea__remaining strong {
  color: var(--stm-ea-main);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.stm-ea__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--stm-ea-line);
  border-radius: 999px;
  background: #faf7f2;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.stm-ea__status--full {
  border-color: rgba(148, 66, 77, 0.25);
  background: #f5e5e7;
  color: var(--stm-ea-main-dark);
}

.stm-ea__status--closed {
  border-color: #ddd5cc;
  background: #f1efec;
  color: #77716b;
}

.stm-ea__empty {
  color: #aaa19a;
}

.stm-ea__note {
  margin: 15px 0 0;
  color: var(--stm-ea-muted);
  font-size: 13px;
  line-height: 1.8;
}

.stm-ea__button-wrap {
  margin-top: 34px;
  text-align: center;
}

.stm-ea__button {
  position: relative;
  display: inline-flex;
  min-width: 320px;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  padding: 18px 62px 18px 38px;
  border: 1px solid var(--stm-ea-main);
  border-radius: 999px;
  background: var(--stm-ea-main);
  box-shadow: 0 10px 24px rgba(111, 48, 57, 0.2);
  color: #fff !important;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-decoration: none !important;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.stm-ea__button span {
  margin-right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.stm-ea__button::after {
  content: "→";
  position: absolute;
  right: 26px;
  top: 50%;
  font-size: 20px;
  transform: translateY(-50%);
}

.stm-ea__button:hover {
  background: var(--stm-ea-main-dark);
  box-shadow: 0 14px 30px rgba(111, 48, 57, 0.27);
  transform: translateY(-2px);
}

.stm-ea__scroll:focus-visible,
.stm-ea__button:focus-visible {
  outline: 3px solid rgba(73, 124, 169, 0.55);
  outline-offset: 3px;
}

@media screen and (max-width: 767px) {
  .stm-ea {
    padding: 56px 15px;
  }

  .stm-ea__heading {
    margin-bottom: 28px;
  }

  .stm-ea__heading-en {
    font-size: 11px;
  }

  .stm-ea__title {
    padding: 0 5px 16px;
    font-size: 25px;
    letter-spacing: 0.04em;
  }

  .stm-ea__block {
    margin-top: 20px;
    padding: 22px 14px 18px;
    border-radius: 16px;
  }

  .stm-ea__period {
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.65;
  }

  .stm-ea__period::before {
    margin-top: 8px;
  }

  .stm-ea__scroll-guide {
    display: block;
    margin: 0 0 8px;
    color: var(--stm-ea-main);
    font-size: 11px;
    font-weight: 700;
    text-align: right;
  }

  .stm-ea__scroll-guide span {
    display: inline-block;
    margin-left: 3px;
    animation: stm-ea-arrow 1.4s ease-in-out infinite;
  }

  .stm-ea__table {
    min-width: 760px;
    font-size: 14px;
  }

  .stm-ea__table th,
  .stm-ea__table td {
    height: 66px;
    padding: 10px 8px;
  }

  .stm-ea__corner,
  .stm-ea__exam {
    width: 116px;
    min-width: 116px;
  }

  .stm-ea__date {
    width: 92px;
  }

  .stm-ea__remaining strong {
    font-size: 22px;
  }

  .stm-ea__note {
    margin-top: 12px;
    font-size: 11px;
  }

  .stm-ea__button-wrap {
    margin-top: 26px;
  }

  .stm-ea__button {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    padding: 15px 50px 15px 24px;
    font-size: 16px;
  }

  .stm-ea__button span {
    margin-right: 8px;
    font-size: 10px;
  }
}

@keyframes stm-ea-arrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}