.product-detail > .product-guide,
.guide-surface {
  --guide-ink: #38262f;
  --guide-muted: #6e5662;
  --guide-accent: #812748;
  --guide-focus: #a33862;
  --guide-line: #dcbfc9;
  --guide-panel: #fffbfd;
  --guide-wash: #faeaf0;
  --guide-glass: rgb(255 249 252 / 94%);
  color: var(--guide-ink);
}

.guide-surface--dark {
  color-scheme: dark;
  --guide-ink: #f5eef2;
  --guide-muted: #d4c2ce;
  --guide-accent: #fac4d8;
  --guide-focus: #fac4d8;
  --guide-line: #604655;
  --guide-panel: #29212a;
  --guide-wash: #3b2936;
  --guide-glass: rgb(37 30 39 / 96%);
}

.guide-surface {
  position: fixed;
  inset: 0;
  width: min(36rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(42rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--guide-line);
  border-radius: 1.75rem;
  overflow: hidden;
  background: var(--guide-panel);
  box-shadow: 0 24px 80px #2a111f40, inset 0 1px 0 #fff5;
}

.guide-surface[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.guide-surface::backdrop {
  background: rgb(27 17 25 / 58%);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .guide-surface {
    background: var(--guide-glass);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
  }
}

.guide-surface__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.125rem clamp(1rem, 4vw, 1.625rem);
  border-bottom: 1px solid var(--guide-line);
}

.guide-surface__head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.guide-surface__body {
  display: grid;
  align-content: start;
  gap: .85rem;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 4vw, 1.625rem);
}

.product-guide {
  display: grid;
  gap: .65rem;
  min-width: 0;
  color: var(--guide-ink);
}

.product-detail > .product-guide {
  padding: 1rem;
  border: 1px solid var(--guide-line);
  border-radius: 1.25rem;
  background: linear-gradient(150deg, var(--guide-wash), var(--guide-panel) 45%);
}

.guide-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem .75rem;
  color: var(--guide-accent);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.guide-ref {
  color: var(--guide-muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  text-transform: none;
  overflow-wrap: anywhere;
}

.guide-text {
  display: grid;
  gap: .7rem;
  min-width: 0;
  font-size: .9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.guide-text p {
  margin: 0;
}

.guide-summary {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-width: 0;
}

.guide-product-photo {
  flex: none;
  width: clamp(3.75rem, 19vw, 5.25rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--guide-line);
  border-radius: .75rem;
  background: #fbf8fa;
}

.guide-product-photo[hidden], .guide-fields:empty {
  display: none;
}

.guide-summary-copy, .guide-fields {
  display: grid;
  gap: .65rem;
  min-width: 0;
}

.guide-intro {
  font-weight: 650;
}

.guide-muted {
  color: var(--guide-muted);
  font-size: .8125rem;
}

.guide-muted[role='status']:empty {
  position: absolute;
}

.guide-field {
  padding-top: .6rem;
  border-top: 1px solid var(--guide-line);
}

.guide-field h4 {
  margin: 0 0 .175rem;
  color: var(--guide-accent);
  font-size: .875rem;
  line-height: 1.35;
}

.guide-tags,
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.guide-tags span {
  max-width: 100%;
  padding: .2rem .6rem;
  border-radius: 1rem;
  background: var(--guide-wash);
  color: var(--guide-accent);
  font-size: .75rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.guide-button,
.guide-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: .45rem;
  padding: .45rem .8rem;
  border: 1px solid var(--guide-line);
  border-radius: .85rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 750;
  text-decoration: none;
  color: var(--guide-accent);
  background: var(--guide-wash);
  cursor: pointer;
}

.guide-button:focus-visible,
.guide-result:focus-visible,
.guide-catalog input:focus-visible,
.guide-text textarea:focus-visible {
  outline: 2px solid var(--guide-focus);
  outline-offset: 2px;
}

.guide-close {
  width: 44px;
  padding: 0;
  flex: none;
  border-radius: 50%;
}

.guide-catalog,
.guide-catalog label,
.guide-catalog-results {
  display: grid;
  gap: .55rem;
  min-width: 0;
}

.guide-catalog label {
  color: var(--guide-muted);
  font-size: .875rem;
  font-weight: 700;
}

.guide-catalog input,
.guide-text textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .65rem .8rem;
  border: 1px solid var(--guide-line);
  border-radius: .85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--guide-ink);
  background: var(--guide-panel);
}

.guide-catalog input::placeholder {
  color: var(--guide-muted);
}

.guide-text textarea {
  resize: vertical;
}

.guide-result {
  justify-content: flex-start;
  gap: .65rem;
  min-width: 0;
  text-align: start;
  color: var(--guide-ink);
  background: var(--guide-panel);
}

.guide-result-summary {
  display: grid;
  gap: .15rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.guide-result-photo {
  flex: none;
  border: 1px solid var(--guide-line);
  border-radius: .55rem;
  background: #f7f4f5;
  object-fit: contain;
}

.guide-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.guide-picker-row .guide-result {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.guide-picker-guide {
  flex-direction: column;
  gap: .125rem;
  padding-inline: .6rem;
  border-inline-start: 0;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  font-size: .75rem;
}

.guide-result small {
  color: var(--guide-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.guide-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.guide-search-row:last-child {
  border-bottom: 0;
}

.guide-search-row .suggest-item {
  border-bottom: 0;
}

.guide-search-row .suggest-item:focus-visible,
.guide-search-button:focus-visible {
  outline-offset: -3px;
}

.guide-search-button,
.guide-item-title {
  border: 0;
  font: inherit;
  color: var(--pink-d);
  background: transparent;
}

.guide-search-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .125rem;
  min-height: 44px;
  width: 48px;
  border-inline-start: 1px solid var(--line);
  border-radius: 0 .65rem .65rem 0;
  font-size: .6875rem;
  font-weight: 750;
}

.guide-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 44px;
  width: 100%;
  padding: 0;
  text-align: start;
}

.guide-item-name {
  min-width: 0;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.guide-item-label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex: none;
  font-size: .75rem;
  font-weight: 750;
}

@media (hover: hover) {
  .guide-button:hover,
  .guide-result:hover {
    border-color: var(--guide-accent);
  }

  .guide-search-button:hover {
    background: var(--pink-l);
  }

  .guide-item-title:hover .guide-item-name {
    color: var(--pink-d);
  }
}

@media (max-width: 480px) {
  .guide-surface {
    inset-block-start: auto;
    width: 100%;
    max-height: calc(100dvh - max(1rem, env(safe-area-inset-top, 0px)));
    border-radius: 1.5rem 1.5rem 0 0;
  }

  .guide-surface__body {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .sell .guide-search-row .suggest-item {
    gap: .45rem;
  }

  .sell .guide-search-row .suggest-item > .product-thumb {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .sell .guide-search-row .suggest-item > .si-side {
    flex-basis: 75px;
    max-width: 75px;
  }
}
