:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #687483;
  --line: #d8dee7;
  --panel: #ffffff;
  --soft: #f4f7fa;
  --brand: #0f6b61;
  --brand-strong: #094942;
  --accent: #b33d2e;
  --gold: #9b7429;
  --shadow: 0 10px 28px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #eef3f6;
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background: #17202a;
  color: #fff;
  border-bottom: 4px solid var(--brand);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 116px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-button {
  display: grid;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-link,
.back-link {
  text-decoration: none;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #0f6b61;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-header .eyebrow {
  color: #9fd6ce;
}

.brand-title {
  font-size: 31px;
  font-weight: 800;
}

.status {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #dce9ed;
  white-space: nowrap;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.search-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.combo {
  display: flex;
  align-items: center;
  border: 1px solid #bfc8d4;
  border-radius: 6px;
  background: #fff;
}

#keyword {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
}

#clearButton {
  width: 44px;
  height: 44px;
  border: 0;
  border-left: 1px solid #e2e7ee;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.filters {
  display: grid;
  grid-template-columns: 150px 210px 96px;
  gap: 10px;
  align-items: end;
}

select,
#searchButton {
  height: 46px;
  border-radius: 6px;
  border: 1px solid #bfc8d4;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

#searchButton,
.primary-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: 87px;
  left: 18px;
  width: min(640px, calc(100% - 36px));
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid #bfc8d4;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.suggestion {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.suggestion:hover,
.suggestion[aria-selected="true"] {
  background: #edf8f6;
}

.suggestion strong {
  font-size: 15px;
}

.suggestion span {
  color: var(--muted);
  font-size: 12px;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0 10px;
  color: var(--muted);
}

.summary-bar strong {
  color: var(--ink);
  font-size: 22px;
}

.summary-bar p {
  margin: 0;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: start;
}

.content-main {
  min-width: 0;
}

.ad-slot {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  min-height: 280px;
  padding: 16px;
  background: #fff;
  border: 1px dashed #bfc8d4;
  border-radius: 8px;
  color: var(--muted);
}

.ad-slot strong {
  color: var(--ink);
  font-size: 20px;
}

.ad-slot span {
  line-height: 1.6;
}

.ad-slot-bottom {
  position: static;
  min-height: 96px;
  margin-top: 18px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.ad-slot-bottom .section-kicker {
  grid-column: 1 / -1;
}

.home-view {
  display: grid;
  gap: 22px;
}

.feature-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-band h1,
.detail-head h1 {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.25;
}

.feature-band p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.primary-action,
.back-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--brand);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 6px 0 10px;
}

.section-head h2,
.detail-section h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.cards,
.results {
  display: grid;
  gap: 10px;
}

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

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cards .result-item {
  grid-template-columns: 1fr;
}

.result-title-row {
  display: flex;
  align-items: start;
  gap: 10px;
}

.result-item h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.maker {
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.english,
.catch,
.detail-english,
.detail-catch {
  margin: 6px 0 0;
}

.english,
.detail-english {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.catch,
.detail-catch {
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

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

.meta div {
  min-width: 0;
  padding: 10px;
  background: var(--soft);
  border-radius: 6px;
}

.meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.result-actions {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 132px;
}

.select-model {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.detail-view {
  display: block;
}

.detail-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: none;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-price {
  padding: 14px;
  background: #f7f2e7;
  border: 1px solid #e4d5b2;
  border-radius: 8px;
}

.detail-price span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-price strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  color: var(--gold);
}

.detail-section {
  margin-top: 16px;
}

.detail-section h2 {
  padding: 7px 9px;
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 16px;
}

.detail-specs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.detail-specs div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #e2e7ee;
  background: #fbfcfd;
}

.detail-specs dt,
.detail-specs dd {
  margin: 0;
  white-space: nowrap;
}

.detail-specs dd {
  font-weight: 800;
}

.price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}

.price-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #e4d5b2;
  border-radius: 4px;
  background: #fffaf0;
}

.price-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.price-summary strong {
  margin: 0;
  color: var(--gold);
  font-size: 15px;
  white-space: nowrap;
}

.store-ranking {
  display: grid;
  gap: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.store-search-list,
.rakuten-ranking {
  gap: 0;
}

.store-card,
.rakuten-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 120px 190px;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.store-card:hover,
.rakuten-row:hover {
  background: #f2fbf9;
}

.store-card div {
  display: grid;
  gap: 4px;
}

.store-card strong,
.rakuten-row span {
  overflow-wrap: anywhere;
}

.store-card span {
  color: var(--muted);
  font-size: 13px;
}

.future-slot {
  min-height: 34px;
  border-radius: 4px;
  background: #f8fafc;
}

.rakuten-row {
  grid-template-columns: minmax(0, 1fr) 120px 140px;
}

.rakuten-row strong {
  color: var(--accent);
  text-align: right;
}

.store-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 88px 96px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.store-row:hover {
  background: #f2fbf9;
}

.store-header {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.store-header span {
  justify-self: stretch;
}

.store-main {
  min-width: 0;
  justify-self: stretch;
}

.store-condition {
  justify-self: stretch;
  text-align: center;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-price {
  justify-self: stretch;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.store-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  justify-self: stretch;
}

.rakuten-link {
  background: #bf0000;
}

.store-link-disabled {
  background: #e2e7ee;
  color: var(--muted);
}

.more-stores,
.more-rakuten-used,
.more-note {
  min-height: 38px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.more-stores,
.more-rakuten-used {
  color: var(--brand);
  font-weight: 800;
}

.empty {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .header-inner,
  .summary-bar,
  .result-item,
  .search-panel,
  .feature-band,
  .detail-head,
  .content-layout {
    display: block;
  }

  .status,
  .filters,
  .summary-bar p,
  .result-actions,
  .primary-action,
  .detail-price,
  .store-price,
  .ad-slot {
    margin-top: 14px;
  }

  .filters,
  .cards,
  .meta {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .store-row {
    grid-template-columns: minmax(0, 1fr) 132px 72px 76px;
  }

  .store-card,
  .rakuten-row {
    grid-template-columns: 1fr;
  }

  .future-slot {
    display: none;
  }

  .rakuten-row strong {
    text-align: left;
  }

  .suggestions {
    top: 87px;
    width: calc(100% - 36px);
  }

  .store-price {
    justify-self: stretch;
  }
}

@media (max-width: 560px) {
  .price-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .price-summary div {
    display: grid;
    gap: 2px;
    align-items: center;
  }

  .price-summary strong {
    font-size: 13px;
  }
}
