:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --surface-tint: #eef7f3;
  --ink: #101817;
  --muted: #5f6c68;
  --line: #dce3e1;
  --line-strong: #c9d4d0;
  --brand: #126b54;
  --brand-dark: #0b4d3d;
  --amber: #9a5a18;
  --amber-soft: #fff4df;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 6px 18px rgba(17, 24, 39, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f9faf9 0, var(--bg) 320px),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 227, 225, 0.86);
  background: rgba(249, 250, 249, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-inner,
.hero,
.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  padding: 10px 0;
}

.store-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f1;
}

.store-tabs a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
  overflow-wrap: anywhere;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.store-tabs a:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.store-tabs a[aria-current="page"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.hero {
  padding: 44px 0 22px;
}

h1 {
  max-width: 960px;
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 100%;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding-bottom: 58px;
}

.content-stack {
  display: grid;
  gap: 20px;
}

.section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: 0;
  padding-top: 0;
}

.section-header {
  max-width: 100%;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0 0 6px;
  font-size: 1.68rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 1.14rem;
}

.section p {
  color: var(--muted);
  margin: 0;
}

.coupon-grid {
  display: grid;
  gap: 16px;
}

.coupon-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f1;
}

.filter-button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.filter-button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.coupon-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.coupon-card:hover {
  border-color: rgba(18, 107, 84, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.coupon-card.is-filtered-in {
  animation: couponFadeIn 180ms ease both;
}

.coupon-card.featured {
  border-color: rgba(18, 107, 84, 0.45);
  box-shadow: var(--shadow);
}

.coupon-card.has-revealed-code {
  border-color: rgba(18, 107, 84, 0.62);
}

.coupon-main {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.coupon-title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.coupon-main > .meta-grid,
.coupon-details > .meta-grid {
  margin-top: 0;
}

.coupon-details {
  align-self: start;
}

.coupon-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  transition: color 160ms ease;
}

.coupon-details summary:hover {
  color: var(--brand-dark);
}

.coupon-details[open] summary {
  margin-bottom: 8px;
  color: var(--brand-dark);
}

.meta-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  margin-top: 2px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.coupon-details[open] .meta-grid {
  animation: detailsIn 180ms ease both;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.revealed-code {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px dashed rgba(18, 107, 84, 0.55);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--brand-dark);
  text-align: left;
  overflow-wrap: normal;
}

.revealed-code-value {
  min-width: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  white-space: nowrap;
}

.copy-code-button {
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 107, 84, 0.12);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease, color 160ms ease;
}

.copy-code-button:hover {
  background: var(--brand);
  color: #fff;
}

.button,
button.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  font-weight: 900;
  cursor: pointer;
  font: inherit;
}

.show-code-button[hidden] {
  display: none;
}

.button.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18, 107, 84, 0.18);
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 14px 28px rgba(18, 107, 84, 0.22);
  transform: translateY(-1px);
}

.button.primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(18, 107, 84, 0.18);
}

.button.secondary {
  background: var(--ink);
  color: #fff;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.summary-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.summary-item:hover {
  border-color: rgba(18, 107, 84, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-size: 1.24rem;
  font-weight: 900;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.info-box:hover {
  border-color: rgba(18, 107, 84, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.info-box strong {
  display: block;
  margin-bottom: 6px;
}

.expired-list {
  display: grid;
  gap: 12px;
}

.expired-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.expired-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.expired-head .badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #eef2f6;
  color: #4b5a66;
  font-size: 0.8rem;
  font-weight: 800;
}

.expired-code {
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.faq-item:hover {
  border-color: rgba(18, 107, 84, 0.28);
  box-shadow: var(--shadow);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-item p {
  margin-top: 10px;
}

.disclosure {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.footer {
  border-top: 1px solid rgba(202, 212, 208, 0.78);
  padding: 22px 0;
  color: var(--muted);
  background: #f0f3f2;
}

.footer .disclosure {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0;
}

.footer .disclosure strong {
  color: var(--ink);
  font-weight: 900;
}

.region-notice {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 23, 0.45);
}

.region-notice-dialog {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(16, 24, 23, 0.24);
}

.region-notice-title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.region-notice-copy {
  margin: 10px 0 0;
  color: var(--muted);
}

.region-notice-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

@keyframes couponFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes detailsIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 768px), (pointer: coarse) {
  .topbar-inner {
    padding: 6px 0;
  }

  .store-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .store-tabs a {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .hero {
    padding: 18px 0 12px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero-copy {
    margin-top: 8px;
    font-size: 0.96rem;
    line-height: 1.45;
  }

  .layout {
    padding-bottom: 38px;
  }

  .content-stack {
    gap: 12px;
  }

  .section {
    padding: 16px 0;
  }

  .section h2 {
    font-size: 1.35rem;
  }

  .section-header {
    margin-bottom: 10px;
  }

  .section-header p,
  .section p {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .coupon-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: stretch;
    align-items: stretch;
    gap: 0;
    margin-bottom: 10px;
    padding: 4px;
  }

  .filter-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 34px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.34);
    padding: 6px 4px;
    font-size: 0.82rem;
  }

  .filter-button:first-child {
    border-radius: 6px 0 0 6px;
  }

  .filter-button:last-child {
    border-right: 0;
    border-radius: 0 6px 6px 0;
  }

  .coupon-grid {
    gap: 10px;
  }

  .coupon-main {
    padding: 14px;
    gap: 10px;
  }

  .coupon-title {
    font-size: 1.08rem;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .coupon-details summary {
    font-size: 0.82rem;
  }

  .meta-item {
    padding: 8px 10px;
  }

  .meta-label {
    font-size: 0.68rem;
  }

  .meta-value {
    font-size: 0.92rem;
  }

}

@media (min-width: 620px) {
  .store-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-notice-actions {
    grid-template-columns: 1fr auto;
  }

  .summary-grid,
  .meta-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 920px) {
  .hero {
    padding-top: 22px;
  }

  .coupon-main {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
    align-items: start;
    gap: 18px;
  }

  .coupon-main > .meta-grid,
  .coupon-details {
    grid-column: 1;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .info-grid,
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
