:root {
  color-scheme: light;
  --bg: #eef6f9;
  --surface: #ffffff;
  --surface-soft: #f7fbfe;
  --ink: #172033;
  --muted: #607084;
  --line: #d8e5ee;
  --brand: #2477b7;
  --brand-dark: #173f68;
  --ribbon: #173f68;
  --shadow: 0 14px 34px rgba(25, 51, 82, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.2) 320px),
    var(--bg);
  font-family:
    "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 0 22px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hero-status span,
.made-by-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.made-by-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-dark);
  text-decoration: none;
}

.made-by-link:hover,
.made-by-link:focus-visible,
.lead a:hover,
.lead a:focus-visible {
  color: var(--brand);
  outline: none;
}

.made-by-link img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  opacity: 0.82;
}

.lead a {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.touch-hint {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .touch-hint {
    display: inline;
  }
}

.notice {
  margin-bottom: 14px;
  border: 1px solid #cfe1ef;
  border-radius: 8px;
  padding: 12px 14px;
  color: #395269;
  background: #f7fbfe;
}

.notice p {
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.controls {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.optional-controls[hidden] {
  display: none;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  min-height: 42px;
  padding: 10px 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.tab-button:hover,
.tab-button:focus-visible {
  color: var(--brand-dark);
  background: #ffffff;
  outline: none;
}

.tab-button.is-active {
  color: #ffffff;
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.search-box {
  display: grid;
  gap: 6px;
  width: min(380px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tier-board {
  display: grid;
  gap: 12px;
}

.tier-row {
  display: grid;
  grid-template-columns: minmax(176px, 250px) 1fr;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tier-label {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 168px;
  padding: 16px;
  color: var(--tier-text, #ffffff);
  background: var(--tier-color, #2477b7);
}

.tier-label h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tier-label p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tier-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  gap: 12px;
  align-content: start;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
}

.product-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 176px;
  border: 1px solid #dce9f1;
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 8px 18px rgba(25, 51, 82, 0.09);
  text-align: left;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: #9cc9e7;
  box-shadow: 0 12px 24px rgba(25, 51, 82, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.product-ribbons {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}

.product-ribbon {
  max-width: 100%;
  border-radius: 7px;
  padding: 6px 8px;
  color: #ffffff;
  background: rgba(23, 63, 104, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.product-image-wrap {
  display: grid;
  place-items: center;
  height: 112px;
  overflow: hidden;
  border-radius: 7px;
  background: #eaf3f9;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-body {
  display: grid;
  gap: 6px;
  align-content: start;
  align-items: start;
  min-height: 54px;
}

.product-name {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.product-extra-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  align-self: start;
  gap: 4px;
  min-width: 0;
}

.product-extra-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 18px;
  border-radius: 6px;
  padding: 4px 4px;
  max-width: 100%;
  color: #ffffff;
  background: rgba(37, 119, 143, 0.94);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.empty-tier,
.load-error {
  margin: 0;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  line-height: 1.7;
}

.empty-tier-note {
  grid-column: 1 / -1;
}

.site-footer {
  display: grid;
  gap: 6px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.footer-notice {
  color: #395269;
  font-weight: 800;
}

.contact-cta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.contact-button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-dark);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.contact-button:hover,
.contact-button:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  outline: none;
}

.contact-shell {
  width: min(900px, calc(100% - 28px));
}

.contact-hero {
  display: grid;
  gap: 18px;
  padding: 16px 0 22px;
}

.back-link {
  justify-self: start;
}

.contact-page {
  display: grid;
  gap: 16px;
}

.form-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 254, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
}

.contact-note {
  margin: 8px 0 0;
  color: #395269;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.8;
}

.contact-note a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.required-note {
  margin: 0;
  color: #c24c3a;
  font-size: 12px;
  font-weight: 900;
}

.form-field,
.form-fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.form-field span,
.form-fieldset legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.form-field strong,
.form-fieldset legend span {
  color: #c24c3a;
}

.form-field input,
.form-field textarea,
.other-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.7;
}

.form-field input:focus,
.form-field textarea:focus,
.other-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 119, 183, 0.14);
  outline: none;
}

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

.app-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: #2f4357;
  background: rgba(247, 251, 254, 0.88);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.choice-line input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.choice-line:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #eaf3f9;
}

.other-input {
  margin-top: 2px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-submit {
  border: 1px solid var(--brand-dark);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 18px;
  color: #ffffff;
  background: var(--brand-dark);
  font-weight: 900;
}

.contact-submit:hover,
.contact-submit:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  outline: none;
}

.contact-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-status.is-success {
  color: #28754c;
}

.form-status.is-error {
  color: #b44332;
}

.product-dialog {
  width: min(740px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(10, 26, 45, 0.34);
}

.product-dialog::backdrop {
  background: rgba(8, 22, 36, 0.44);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  background: rgba(20, 39, 58, 0.82);
}

.dialog-content {
  display: grid;
  grid-template-columns: minmax(180px, 290px) 1fr;
  gap: 18px;
  padding: 24px;
}

.dialog-content img {
  width: 100%;
  border-radius: 8px;
  background: #edf5fb;
}

.dialog-copy h2 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.24;
  letter-spacing: 0;
}

.dialog-copy p {
  margin: 0;
  line-height: 1.8;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
}

.meta-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.meta-list dt {
  color: var(--muted);
  font-weight: 900;
}

.meta-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 780px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: calc(100vw - 18px);
    max-width: 1180px;
    padding-top: 12px;
    overflow-x: hidden;
  }

  .hero,
  .controls,
  .tab-strip,
  .tier-board,
  .site-footer,
  .contact-cta,
  .contact-page {
    max-width: 100%;
  }

  .contact-cta {
    display: grid;
    align-items: start;
  }

  .contact-button,
  .back-link,
  .contact-submit {
    width: 100%;
  }

  .choice-grid,
  .app-choice-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    align-items: start;
  }

  .hero-status {
    justify-content: flex-start;
  }

  .tier-row,
  .dialog-content {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .tier-label {
    min-height: auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .tier-label p {
    width: calc(100vw - 76px);
    max-width: calc(100vw - 76px);
    overflow-wrap: anywhere;
    word-break: break-all;
    line-break: anywhere;
  }

  .tier-products {
    display: flex;
    overflow-x: auto;
    grid-template-columns: none;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    padding: 10px;
    overscroll-behavior-x: contain;
  }

  .product-card {
    flex: 0 0 146px;
    min-height: 164px;
  }

  .product-image-wrap {
    height: 96px;
  }

  .product-name {
    font-size: 13px;
  }
}
