:root {
  color-scheme: light;
  --page: #ffe7f1;
  --card: #ffffff;
  --pink: #e6007e;
  --pink-deep: #d41473;
  --text: #7b1749;
  --muted: #7a6470;
  --shadow: 0 18px 40px rgba(180, 20, 105, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--text);
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 876px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px 28px;
  background: radial-gradient(circle at 50% 72%, #ffffff 0 32%, #fff4f9 52%, var(--page) 100%);
}

.tagline {
  margin: 0 0 18px;
  color: #111827;
  text-align: right;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.35;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 560px) auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 20px;
  gap: 14px;
  padding-top: 4px;
}

.select-card {
  position: relative;
  width: min(100%, 560px);
  min-height: 66px;
  padding: 9px 14px;
  background: var(--card);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(180, 20, 105, 0.06);
}

.select-card label {
  display: block;
  margin-bottom: 2px;
  color: #1f1f24;
  font-size: 13px;
  line-height: 1.25;
}

.select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 24px;
  align-items: center;
  gap: 6px;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pink-deep);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
}

.icon-button,
.close-button,
.chevron-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  color: var(--pink);
}

.icon-button,
.close-button {
  width: 32px;
  height: 32px;
  background: #fff0f7;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.chevron-button {
  width: 24px;
  height: 32px;
  background: transparent;
}

.chevron {
  display: block;
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--pink-deep);
  border-bottom: 2px solid var(--pink-deep);
  transform: rotate(45deg) translateY(-3px);
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: #fff;
  border: 1px solid #f8c8dd;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(180, 20, 105, 0.18);
}

.suggestion-item,
.suggestion-empty {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #fde6f0;
  background: #fff;
  color: var(--pink-deep);
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  touch-action: manipulation;
}

.suggestion-item:active,
.suggestion-item:hover {
  background: #fff0f7;
}

.suggestion-empty {
  color: var(--muted);
  font-weight: 400;
}

.search-button {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 116px;
  height: 48px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: var(--pink);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 10px 18px rgba(230, 0, 126, 0.18);
}

.search-button:disabled {
  background: #e8c9d7;
  box-shadow: none;
}

.result-card {
  position: relative;
  width: min(100%, 724px);
  margin: 16px auto 0;
  padding: 30px 62px 32px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 13px;
  right: 14px;
  background: transparent;
}

h1 {
  margin: 0;
  color: var(--pink-deep);
  text-align: center;
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.35;
}

h2 {
  margin: 24px 0 14px;
  color: var(--pink-deep);
  text-align: center;
  font-size: 24px;
  line-height: 1.2;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border: 2px solid var(--pink);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
}

.rate-box {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 22px 28px;
  background: linear-gradient(135deg, var(--pink-deep) 0%, var(--pink) 72%, #f13393 100%);
  border-radius: 13px;
  box-shadow: 0 12px 22px rgba(180, 20, 105, 0.28);
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(74px, auto) auto;
  align-items: baseline;
  gap: 18px;
  min-height: 60px;
  color: #fff;
}

.rate-row span,
.rate-row strong,
.rate-row em {
  font-size: clamp(22px, 5vw, 25px);
  line-height: 1.1;
}

.rate-row span,
.rate-row strong {
  font-weight: 800;
}

.rate-row strong {
  text-align: right;
}

.rate-row em {
  font-style: normal;
  white-space: nowrap;
}

.updated-note,
.status-text {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.updated-note {
  max-width: 640px;
  margin: 16px auto 0;
  line-height: 1.5;
}

.status-text {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 12px;
  }

  .tagline {
    text-align: center;
  }

  .search-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    justify-items: center;
  }

  .search-button {
    grid-column: auto;
    grid-row: auto;
    margin: 16px 0 24px;
  }

  .result-card {
    padding: 30px 12px 24px;
  }

  .rate-box {
    padding: 20px 18px;
  }

  .rate-row {
    grid-template-columns: minmax(92px, 1fr) minmax(64px, auto) auto;
    gap: 10px;
  }
}
