@font-face {
  font-family: "DM Serif Display";
  src: url("/assets/studio-dm-serif-display.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/studio-dm-sans.woff") format("woff");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --bg: #f6f1e8;
  --card: #fffcf8;
  --ink: #1c1915;
  --muted: #6e665c;
  --line: #e6dccb;
  --gold: #b08a2e;
  --gold-soft: #f3e6c4;
  --clay: #c4563a;
  --navy: #1b2744;
  --bubble: #f3ead8;
  --forest: #1e4a38;
  --forest-ink: #f4fbf6;
  --shadow: 0 18px 40px rgba(70, 48, 20, 0.08);
  --serif: "DM Serif Display", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(243, 230, 196, 0.85), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

button, input { font: inherit; color: inherit; }

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

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand em {
  font-style: normal;
  color: var(--gold);
}

.back {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
  white-space: nowrap;
}

#off {
  max-width: 680px;
  margin: 8vh auto 0;
  padding: 42px 36px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

#off p, .lede, .policy p, .note, .pick-summary {
  color: var(--muted);
}

#off a, .policy a { color: var(--forest); }

.pay-fallback ul, #off noscript ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-fallback a, #off noscript a, #retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--navy);
  color: #f7f4ee;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

#retry { margin-top: 4px; }

.policy {
  margin-top: 22px;
  padding-top: 16px;
}

.policy p, .fine { margin: 0 0 8px; }

.lede { max-width: 38em; margin: 0 0 18px; }

.deal-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 36px;
  align-items: start;
}

.item, .chat, .pick, .composer, .counter, .deal-grid {
  min-width: 0;
  max-width: 100%;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.steps .current {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pick {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.pick-art img {
  display: block;
  width: 100%;
  border-radius: 16px;
}

.pick-kicker {
  margin: 0 0 4px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pick h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pick-summary { margin: 6px 0 0; font-size: 14px; }

.pick-price { margin: 0; }

.pick-price-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pick-price strong {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.chat {
  background: var(--card);
  border: 1px solid #efe6d8;
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px 20px 18px;
}

.notice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  max-height: 420px;
  margin: 16px 0 12px;
  overflow: auto;
}

.bubble {
  max-width: 88%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  background: var(--bubble);
  color: #2a241c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.thinking {
  color: var(--muted);
  font-style: italic;
}

.bubble.mine {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: var(--navy);
  color: #f4efe6;
}

.bubble.mine .amt {
  color: #e2b15a;
  font-weight: 700;
}

.counter {
  margin: 4px 0 12px;
  padding: 12px;
  border: 1.5px solid #e4c98a;
  border-radius: 16px;
}

.counter-label {
  margin: 0 0 10px;
  color: #8d6820;
  font-size: 14px;
  font-weight: 700;
}

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

.counter-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

.btn-solid, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-solid {
  border: 2px solid var(--clay);
  background: var(--clay);
  color: #fffaf6;
}

.btn-solid.send {
  width: auto;
  min-width: 88px;
  border-color: var(--navy);
  background: var(--navy);
  color: #f7f4ee;
}

.btn-outline {
  border: 2px solid #d9d0c2;
  background: #fff;
  color: var(--navy);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #e2dacd;
  border-radius: 999px;
  background: #fff;
  color: #3f3933;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.composer {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.offer-field, .composer input[name="message"] {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.offer-field {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
}

.offer-field span { color: var(--muted); }

.offer-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.composer input[name="message"] { padding: 0 12px; }

.composer input:focus, .offer-field:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.btn-solid:focus-visible, .btn-outline:focus-visible, .chip:focus-visible, #retry:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

button:disabled { opacity: 0.55; cursor: default; }

.code {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--gold-soft);
  overflow-wrap: anywhere;
}

.code a { color: var(--forest); font-weight: 700; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.choice { max-width: 760px; }

.choice h1 {
  margin: 4px 0 10px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 26px 0 22px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 168px;
  padding: 24px 26px;
  border-radius: 22px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.choice-card:hover { transform: translateY(-2px); }

.choice-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.choice-take {
  border: 2px solid var(--navy);
  background: var(--navy);
  color: #f7f4ee;
}

.choice-try {
  border: 2px solid var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}

.choice-label { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

.choice-price {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
}

.choice-sub { font-size: 15px; opacity: 0.85; }

@media (max-width: 860px) {
  .shell { width: min(1120px, calc(100% - 24px)); }
  .top { align-items: flex-start; }
  #off { margin-top: 12px; padding: 28px 18px 20px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 0; width: 100%; }
  .deal-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .pick {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
  }
  .pick-art { width: 72px; }
  .pick-art img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
  }
  .pick h2 { font-size: 20px; }
  .pick-price { text-align: right; }
  .pick-price strong { font-size: 28px; }
  .chat { padding: 16px 14px 14px; }
  .composer { grid-template-columns: 96px minmax(0, 1fr); }
  .composer .send { grid-column: 1 / -1; width: 100%; }
}
