:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #f0f5f2;
  --ink: #18201d;
  --muted: #5d6964;
  --line: #d9e0dc;
  --line-strong: #b8c8bf;
  --green: #1f7a5c;
  --blue: #3177a8;
  --coral: #c8523f;
  --amber: #b98222;
  --shadow: 0 20px 55px rgba(28, 45, 37, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(217, 224, 220, 0.8);
  background: rgba(246, 247, 244, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
.language-switch,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.language-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: var(--surface);
}

.language-switch a {
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.language-switch a[aria-current="page"] {
  background: var(--green);
  color: #fff;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: clamp(20px, 4vw, 44px);
  align-items: end;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 44px) 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.prototype-note {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid #e3ce98;
  border-radius: 8px;
  background: #fff9e9;
  color: #5e4720;
  line-height: 1.55;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 0 clamp(16px, 4vw, 44px) 44px;
}

.filters-panel,
.results-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.filters-panel {
  position: sticky;
  top: 82px;
  padding: 20px;
  border-radius: 8px;
}

.results-panel {
  min-width: 0;
  padding: 20px;
  border-radius: 8px;
}

.panel-heading,
.results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.results-toolbar h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.filters {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.filter-group {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.filter-group h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field,
.check-field,
.sort-control,
.note-input {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.field select,
.field input,
.sort-control select,
.note-input textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.field select,
.field input,
.sort-control select {
  min-height: 42px;
  padding: 0 12px;
}

.field select:focus,
.field input:focus,
.sort-control select:focus,
.note-input textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.16);
}

.check-field {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  cursor: pointer;
}

.check-field input,
.segment input {
  accent-color: var(--green);
}

.mode-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-group legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

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

.segment {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment span {
  display: block;
  width: 100%;
  padding: 10px 6px;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.segment:has(input:checked) {
  border-color: rgba(31, 122, 92, 0.35);
  background: #e9f5ef;
}

.segment:has(input:checked) span {
  color: var(--green);
}

.reset-button,
.notes-toggle,
.add-note,
.buy-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.reset-button {
  width: 100%;
  margin-top: 18px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.sort-control {
  min-width: 180px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin: 16px 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.active-filters p {
  margin: 0;
}

.active-label,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
}

.active-label {
  background: var(--ink);
  color: white;
  font-weight: 850;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
}

.product-grid {
  display: grid;
  gap: 8px;
}

.comparison-header,
.product-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.7fr)
    minmax(74px, 0.55fr)
    minmax(76px, 0.55fr)
    minmax(68px, 0.5fr)
    minmax(62px, 0.45fr)
    minmax(76px, 0.5fr)
    minmax(104px, 0.75fr)
    minmax(78px, 0.55fr)
    minmax(78px, 0.5fr)
    minmax(116px, 0.7fr);
  gap: 8px;
  align-items: center;
}

.comparison-header {
  position: sticky;
  top: 82px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.product-row {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.row-product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.row-image {
  position: relative;
  width: 44px;
  height: 58px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38), transparent 36%),
    var(--accent);
}

.row-image::before {
  position: absolute;
  top: 6px;
  right: 10px;
  bottom: 8px;
  left: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  content: "";
}

.row-image--photo {
  border: 1px solid var(--line);
  background: #fff;
}

.row-image--photo::before {
  display: none;
}

.row-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.row-copy,
.row-metric,
.row-price {
  min-width: 0;
}

.row-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.row-copy h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.18;
}

.row-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.row-metric {
  display: grid;
  gap: 2px;
  min-height: 48px;
  align-content: center;
  padding: 6px 7px;
  border-left: 1px solid var(--line);
}

.row-metric span,
.row-metric small,
.row-price span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.row-metric strong {
  font-size: 0.88rem;
  line-height: 1.18;
}

.row-metric--unknown strong {
  color: var(--amber);
}

.row-price {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.row-price strong {
  color: var(--coral);
  font-size: 1.08rem;
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.row-actions .notes-toggle,
.row-actions .buy-link {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.product-row .source-note,
.product-row .notes-panel {
  grid-column: 1 / -1;
}

.product-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.bottle-art {
  position: relative;
  width: 58px;
  height: 78px;
  border-radius: 18px 18px 12px 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38), transparent 36%),
    var(--accent);
  box-shadow: inset -10px 0 0 rgba(0, 0, 0, 0.08);
}

.bottle-art::before {
  position: absolute;
  top: -10px;
  left: 16px;
  width: 26px;
  height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: #343c39;
  content: "";
}

.bottle-art span {
  position: absolute;
  right: 9px;
  bottom: 14px;
  left: 9px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.bottle-art--image {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.bottle-art--image::before {
  display: none;
}

.bottle-art--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.product-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e6f3ed;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 850;
}

.status-pill--demo {
  background: #eef2f7;
  color: #546070;
}

.product-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.product-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.price-block {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.price-block strong {
  color: var(--coral);
  font-size: 1.35rem;
}

.price-block span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

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

.spec {
  display: grid;
  gap: 3px;
  min-height: 60px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.spec span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.spec strong {
  font-size: 0.88rem;
  line-height: 1.22;
}

.spec--unknown {
  border-style: dashed;
  background: #faf8f2;
}

.spec--unknown strong {
  color: var(--amber);
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
  gap: 10px;
}

.notes-toggle {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.buy-link {
  background: var(--green);
  color: #fff;
}

.source-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.notes-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.notes-heading h4 {
  margin: 0;
  font-size: 1rem;
}

.notes-heading p {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.notes-list {
  display: grid;
  gap: 8px;
}

.note-item,
.empty-notes {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.note-item p {
  margin: 0;
  color: var(--ink);
}

.note-item time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.note-input textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.add-note {
  background: var(--ink);
  color: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfb;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.language-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.language-gate__panel {
  width: min(620px, 100%);
  padding: clamp(24px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.language-gate__panel h1 {
  font-size: clamp(2rem, 8vw, 4rem);
}

.language-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button-link {
  padding: 0 16px;
  background: var(--green);
  color: #fff;
}

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

@media (max-width: 1050px) {
  .intro,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .comparison-header {
    display: none;
  }

  .product-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .row-product,
  .row-actions {
    grid-column: 1 / -1;
  }

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

  .row-price {
    justify-items: start;
  }

  .row-metric,
  .row-price {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .language-switch {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .language-switch a {
    flex: 1;
  }

  .intro {
    padding-top: 26px;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control,
  .toolbar-actions {
    width: 100%;
  }

  .product-main {
    grid-template-columns: 52px minmax(0, 1fr);
  }

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

  .price-block {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .bottle-art {
    width: 48px;
    height: 68px;
  }

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

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

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

@media (max-width: 420px) {
  .segmented {
    grid-template-columns: 1fr;
  }

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

  .product-row {
    grid-template-columns: 1fr;
  }
}
