:root {
  color-scheme: light;
  --ink: #241e2c;
  --muted: #655e6c;
  --paper: #fffdf8;
  --cream: #f5efe5;
  --plum: #503256;
  --plum-dark: #35213a;
  --coral: #e26958;
  --sage: #dce9df;
  --sage-dark: #245b3c;
  --amber: #f8e7bd;
  --amber-dark: #704e0b;
  --line: #ded6cc;
  --shadow: 0 18px 60px rgb(53 33 58 / 10%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgb(226 105 88 / 13%) 0 7rem, transparent 7.1rem),
    var(--cream);
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

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

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.08rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  color: white;
  background: var(--plum);
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.quiet-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--plum-dark);
  background: rgb(255 253 248 / 72%);
  font-weight: 700;
  cursor: pointer;
}

.quiet-button:hover {
  background: white;
}

main {
  padding: 56px 0 40px;
}

.intro {
  max-width: 780px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--plum);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.3rem);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.intro-copy {
  max-width: 680px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.privacy-note {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid #bfd1c3;
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--sage);
  font-size: 0.85rem;
  font-weight: 700;
}

.privacy-note span {
  font-size: 0.65rem;
}

.chat-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 4vw, 42px);
}

.message {
  max-width: min(720px, 88%);
  padding: 17px 20px;
  border-radius: 18px;
  line-height: 1.55;
}

.message p {
  margin: 0;
}

.message-label {
  margin-bottom: 5px !important;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assistant-message {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  background: var(--cream);
}

.assistant-message .message-label {
  color: var(--plum);
}

.user-message {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  color: white;
  background: var(--plum);
}

.user-message .message-label {
  color: #f3dce8;
}

.error-message {
  align-self: flex-start;
  border: 1px solid #e5ad9f;
  background: #fff0eb;
}

.error-message .message-label {
  color: #8b2f25;
}

.results {
  border-top: 1px solid var(--line);
}

.results:empty {
  display: none;
}

.results-header,
.product-group,
.empty-results {
  padding: 28px clamp(20px, 4vw, 42px) 0;
}

.results-header h2 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.catalogue-notice {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--coral);
  color: #653028;
  background: #fff0eb;
  line-height: 1.5;
}

.product-group h3 {
  margin: 0 0 15px;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.product-image-frame {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--plum);
  background: #eee4eb;
}

.product-image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-fallback {
  font-family: Georgia, serif;
  font-size: 4.5rem;
  opacity: 0.42;
}

.product-content {
  min-width: 0;
  padding: 18px;
}

.match-badge {
  width: fit-content;
  margin: 0 0 12px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.match-badge.compatible {
  color: var(--sage-dark);
  background: var(--sage);
}

.match-badge.missing {
  color: var(--amber-dark);
  background: var(--amber);
}

.product-content h4 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.retailer,
.sizes {
  margin: 5px 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.price {
  margin: 13px 0 7px;
  font-weight: 850;
}

.evidence-list {
  margin: 14px 0;
  padding-left: 18px;
  color: #4f4854;
  font-size: 0.8rem;
  line-height: 1.45;
}

.evidence-list li + li {
  margin-top: 6px;
}

.product-link {
  display: inline-block;
  margin-top: 5px;
  color: var(--plum);
  font-size: 0.83rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.empty-results {
  margin: 0;
  padding-bottom: 28px;
  color: var(--muted);
}

.composer {
  margin-top: 30px;
  padding: 24px clamp(20px, 4vw, 42px) 20px;
  border-top: 1px solid var(--line);
  background: #faf7f0;
}

.composer label {
  display: block;
  margin-bottom: 9px;
  font-weight: 850;
}

.composer-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid #bfb5c2;
  border-radius: 14px;
  color: var(--ink);
  background: white;
  line-height: 1.45;
}

textarea::placeholder {
  color: #79717d;
}

.send-button {
  min-width: 116px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--plum);
  font-weight: 850;
  cursor: pointer;
}

.send-button:hover:not(:disabled) {
  background: var(--plum-dark);
}

button:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}

.composer-help,
.request-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.request-status {
  min-height: 1.4em;
  margin: 0;
  padding: 0 clamp(20px, 4vw, 42px) 20px;
  background: #faf7f0;
}

footer {
  padding: 5px 0 36px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 850px) {
  main {
    padding-top: 34px;
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .site-header {
    min-height: 68px;
  }

  main {
    padding-top: 26px;
  }

  .privacy-note {
    width: 100%;
    align-items: flex-start;
    border-radius: 14px;
  }

  .chat-panel {
    border-radius: 20px;
  }

  .message {
    max-width: 94%;
  }

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

  .product-image-frame {
    min-height: 220px;
  }

  .composer-row {
    flex-direction: column;
  }

  .send-button {
    align-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
