/* ===== history.css ===== */
@media (min-width: 1101px) {
  body.history-body {
    display: grid !important;
    grid-template-columns: 240px minmax(0, 1fr) !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.history-body > .history-page {
    grid-column: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 390px !important;
    grid-template-rows: auto auto !important;
    align-content: start !important;
    gap: 14px !important;
    width: auto !important;
    height: 100dvh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 28px 12px 28px 28px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.history-body .history-header,
  body.history-body .history-intro {
    grid-column: 1 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body.history-body .history-header {
    grid-row: 1 !important;
    min-height: 68px !important;
  }

  body.history-body .history-header p {
    margin-top: 2px !important;
    font-size: 30px !important;
  }

  body.history-body .history-intro {
    grid-row: 2 !important;
    padding: 16px 20px !important;
  }

  body.history-body .history-intro p {
    display: block !important;
    margin-top: 7px !important;
    font-size: 13px !important;
  }

  body.history-body > .history-page > .weather-stadium-panel {
    position: static !important;
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    align-self: start !important;
    display: flex !important;
    flex-direction: column !important;
    width: 390px !important;
    height: calc(100dvh - 112px) !important;
    max-height: calc(100dvh - 48px) !important;
    min-width: 0 !important;
    margin: 28px 0 0 !important;
    padding: 8px 14px 16px !important;
    border: 1px solid rgba(224, 240, 251, 0.2) !important;
    border-radius: 16px !important;
    background: var(--sky-panel) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    font-size: 17px !important;
    overflow: hidden !important;
    backdrop-filter: blur(18px) !important;
  }

  body.history-body .weather-panel-search {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    padding: 8px 12px !important;
    gap: 9px !important;
    border: 1px solid rgba(228, 243, 253, 0.24) !important;
    border-radius: 14px !important;
    background: var(--sky-tone-4) !important;
    color: #f2f8fc !important;
    font-family: inherit !important;
    font-size: 17px !important;
  }

  body.history-body .weather-panel-search > svg {
    flex: 0 0 20px !important;
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: rgba(226, 241, 250, 0.82) !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    stroke-width: 1.8 !important;
  }

  body.history-body .weather-panel-search input {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #f2f8fc !important;
    font: inherit !important;
    font-size: 14px !important;
  }

  body.history-body .weather-panel-search input::placeholder {
    color: rgba(226, 241, 250, 0.62) !important;
  }

  body.history-body .weather-panel-current-city {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 5px !important;
    padding-left: 8px !important;
    border-left: 1px solid rgba(228, 243, 253, 0.18) !important;
    color: #f2f8fc !important;
    font-size: 14px !important;
  }

  body.history-body .weather-panel-current-city svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    stroke-width: 1.8 !important;
  }

  body.history-body .weather-panel-current-city strong {
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  body.history-body .weather-stadium-panel h2 {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 14px 8px 10px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid rgba(228, 243, 253, 0.18) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
  }

  body.history-body .weather-panel-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: 82px !important;
    align-content: start !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 1px 2px !important;
    gap: 4px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  body.history-body .weather-panel-list button {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) auto 16px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 82px !important;
    height: 82px !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    border: 1px solid rgba(227, 242, 252, 0.24) !important;
    border-radius: 16px !important;
    background: var(--sky-tone-5) !important;
    color: #f2f8fc !important;
    font-family: inherit !important;
    font-size: 19px !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  body.history-body .weather-panel-list button:hover,
  body.history-body .weather-panel-list button:focus-visible {
    border-color: rgba(235, 247, 255, 0.48) !important;
    background: var(--sky-tone-6) !important;
  }

  body.history-body .weather-panel-list button span {
    min-width: 0 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
  }

  body.history-body .weather-panel-list button .stadium-weather-icon {
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    font-size: 30px !important;
    font-weight: 600 !important;
  }

  body.history-body .weather-panel-list button .stadium-weather-name {
    display: block !important;
    font-weight: 600 !important;
  }

  body.history-body .weather-panel-list button small {
    display: block !important;
    margin-top: 4px !important;
    color: rgba(230, 241, 248, 0.72) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
  }

  body.history-body .weather-panel-list button b {
    color: #f2f8fc !important;
    font-size: 25px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
  }

  body.history-body .weather-panel-list button i {
    color: rgb(216, 220, 237) !important;
    font-size: 18px !important;
    font-style: normal !important;
  }

  body.history-body .weather-panel-list button[hidden] {
    display: none !important;
  }

  body.history-body .weather-panel-empty {
    margin: 12px 6px !important;
    color: rgba(230, 241, 248, 0.72) !important;
    font-size: 12px !important;
    text-align: center !important;
  }

}

@media (min-width: 701px) and (max-width: 1100px) {
  body.history-body {
    display: grid !important;
    grid-template-columns: 240px minmax(0, 1fr) !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.history-body > .history-page {
    grid-column: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 14px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    padding: 24px !important;
    overflow: visible !important;
  }

  body.history-body .history-header,
  body.history-body .history-intro,
  body.history-body > .history-page > .weather-stadium-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body.history-body > .history-page > .weather-stadium-panel {
    width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
  }

  body.history-body .history-intro {
    padding: 18px !important;
  }
}

@media (max-width: 1100px) {
  body.history-body > .history-page > .weather-stadium-panel {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    padding: 8px 14px 16px !important;
    border: 1px solid rgba(224, 240, 251, 0.2) !important;
    border-radius: 16px !important;
    background: var(--sky-panel) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    font-size: 17px !important;
    overflow: hidden !important;
    backdrop-filter: blur(18px) !important;
  }

  body.history-body .weather-panel-search {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 8px 12px !important;
    gap: 9px !important;
    border: 1px solid rgba(228, 243, 253, 0.24) !important;
    border-radius: 14px !important;
    background: var(--sky-tone-4) !important;
    color: #f2f8fc !important;
    font-family: inherit !important;
    font-size: 17px !important;
  }

  body.history-body .weather-panel-search > svg {
    flex: 0 0 20px !important;
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: rgba(226, 241, 250, 0.82) !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    stroke-width: 1.8 !important;
  }

  body.history-body .weather-panel-search input {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #f2f8fc !important;
    font: inherit !important;
    font-size: 12px !important;
  }

  body.history-body .weather-panel-search input::placeholder {
    color: rgba(226, 241, 250, 0.62) !important;
  }

  body.history-body .weather-panel-current-city {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 5px !important;
    padding-left: 8px !important;
    border-left: 1px solid rgba(228, 243, 253, 0.18) !important;
    color: #f2f8fc !important;
    font-size: 12px !important;
  }

  body.history-body .weather-panel-current-city svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    stroke-width: 1.8 !important;
  }

  body.history-body .weather-panel-current-city strong {
    font-size: 12px !important;
    font-weight: 600 !important;
  }

  body.history-body .weather-stadium-panel h2 {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 14px 8px 10px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid rgba(228, 243, 253, 0.18) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
  }

  body.history-body .weather-panel-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: 60px !important;
    align-content: start !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: min(440px, calc(100dvh - 210px)) !important;
    padding: 0 1px 2px !important;
    gap: 4px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  body.history-body .weather-panel-list button {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) auto 16px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 60px !important;
    height: 60px !important;
    padding: 7px 10px !important;
    gap: 8px !important;
    border: 1px solid rgba(227, 242, 252, 0.24) !important;
    border-radius: 16px !important;
    background: var(--sky-tone-5) !important;
    color: #f2f8fc !important;
    font-family: inherit !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  body.history-body .weather-panel-list button:hover,
  body.history-body .weather-panel-list button:focus-visible {
    border-color: rgba(235, 247, 255, 0.48) !important;
    background: var(--sky-tone-6) !important;
  }

  body.history-body .weather-panel-list button span {
    min-width: 0 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
  }

  body.history-body .weather-panel-list button .stadium-weather-icon {
    display: grid !important;
    place-items: center !important;
    width: 32px !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
  }

  body.history-body .weather-panel-list button .stadium-weather-name {
    display: block !important;
    font-weight: 600 !important;
  }

  body.history-body .weather-panel-list button small {
    display: block !important;
    margin-top: 3px !important;
    color: rgba(230, 241, 248, 0.72) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
  }

  body.history-body .weather-panel-list button b {
    color: #f2f8fc !important;
    font-size: 21px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
  }

  body.history-body .weather-panel-list button i {
    color: rgb(216, 220, 237) !important;
    font-size: 18px !important;
    font-style: normal !important;
  }

  body.history-body .weather-panel-list button[hidden] {
    display: none !important;
  }

  body.history-body .weather-panel-empty {
    margin: 12px 6px !important;
    color: rgba(230, 241, 248, 0.72) !important;
    font-size: 12px !important;
    text-align: center !important;
  }
}

@media (max-width: 700px) {
  body.history-body {
    min-height: 100dvh !important;
  }

  body.history-body > .history-page {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 12px !important;
    height: auto !important;
    min-width: 0 !important;
    padding: 18px 14px 24px !important;
  }

  body.history-body .history-header,
  body.history-body .history-intro,
  body.history-body > .history-page > .weather-stadium-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body.history-body .history-header {
    min-height: 56px !important;
    margin-bottom: 4px !important;
  }

  body.history-body .history-header .back-button {
    display: inline-flex !important;
  }

  body.history-body .history-intro {
    padding: 16px !important;
  }

  body.history-body > .history-page > .weather-stadium-panel {
    width: 100% !important;
    height: auto !important;
    max-height: min(420px, calc(100dvh - 24px)) !important;
  }

  body.history-body .weather-panel-list {
    max-height: min(330px, calc(100dvh - 210px)) !important;
  }
}

body.history-body .date-text {
  font-size: 13px !important;
  color: rgba(218, 235, 247, 0.78) !important;
  line-height: 1.35 !important;
}

/* history 상단을 향후 5일 우천취소 위험 요약으로 사용 */
body.history-body .history-intro {
  display: none !important;
}

/* 향후 5일 우천취소 위험 요약 */
body.history-body .five-day-forecast {
  grid-row: 2 !important;
  align-self: start !important;
  grid-column: 1 !important;
  display: block !important;
  min-width: 0 !important;
  padding: 22px 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 18px !important;
  background: var(--sky-tone-38) !important;
  box-shadow: 0 8px 22px var(--sky-tone-37) !important;
}

body.history-body .five-day-forecast .section-title {
  margin-bottom: 16px !important;
}

body.history-body .five-day-forecast .section-title h3 {
  font-size: 20px !important;
}

body.history-body .five-day-forecast-list {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  min-width: 0 !important;
}

body.history-body .five-day-forecast-item {
  display: flex !important;
  min-width: 0 !important;
  min-height: 112px !important;
  padding: 8px 14px !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
  text-align: center !important;
}

body.history-body .five-day-forecast-item:last-child {
  border-right: 0 !important;
}

body.history-body .five-day-forecast-item .date-text {
  font-size: 14px !important;
  white-space: nowrap !important;
}

body.history-body .five-day-forecast-item strong {
  font-size: clamp(28px, 3vw, 42px) !important;
  line-height: 1 !important;
}

/* 예보가 없는 날의 "확인 불가"는 작게 한 줄로 */
body.history-body .five-day-forecast-item strong.is-unavailable {
  font-size: 18px !important;
  line-height: 42px !important;
  white-space: nowrap !important;
  opacity: 0.75;
}

body.history-body .five-day-forecast-item small {
  color: rgba(218, 235, 247, 0.78) !important;
  font-size: 12px !important;
}

body.history-body .five-day-forecast-message {
  margin: 18px 0 !important;
  color: rgba(218, 235, 247, 0.8) !important;
  font-size: 14px !important;
  text-align: center !important;
}

@media (max-width: 700px) {
  body.history-body .five-day-forecast {
    padding: 18px 12px !important;
  }

  body.history-body .five-day-forecast-list {
    grid-template-columns: repeat(5, minmax(76px, 1fr)) !important;
    overflow-x: auto !important;
  }

  body.history-body .five-day-forecast-item {
    padding: 8px 10px !important;
  }
}

/* 모든 화면 크기에서 동일한 글꼴과 굵기 유지 */
body.history-body * {
  font-family:
    "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif !important;
  font-weight: 300 !important;
}

/* ===== 환불하기 버튼 (날씨 기록 페이지 상단) ===== */
/* 헤더가 flex 라서 margin-left:auto 로 오른쪽 끝에 붙입니다. */
body.history-body .refund-links {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

body.history-body .refund-button {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}

body.history-body .refund-button:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.6);
}

/* 키보드로 이동했을 때도 어디에 있는지 보이게 합니다. */
body.history-body .refund-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 화면이 좁으면 버튼이 구장 이름을 밀어내므로 줄을 바꿉니다. */
@media (max-width: 700px) {
  body.history-body .history-header {
    flex-wrap: wrap !important;
  }
  body.history-body .refund-links {
    width: 100%;
    margin-left: 0;
  }
  body.history-body .refund-button {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
  }
}
