:root {
  color-scheme: dark;
  --bg: #17130f;
  --panel: #231d18;
  --panel-soft: #2d251f;
  --text: #f7eee1;
  --muted: #c6b9a8;
  --line: #4b3b30;
  --accent: #d7a85f;
  --accent-strong: #f0c16f;
  --user: #36515c;
  --master: #312920;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(215, 168, 95, 0.14), transparent 26rem),
    linear-gradient(145deg, #120f0d, var(--bg) 42%, #211813);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 32px 16px;
}

.bar {
  min-height: calc(100vh - 64px);
  display: grid;
  align-content: center;
  gap: 20px;
}

.bar__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 28vw, 260px);
  gap: 24px;
  align-items: end;
  max-width: 900px;
}

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

.hero-copy h1 {
  width: calc(100% + 24px + clamp(150px, 28vw, 260px));
  max-width: 900px;
}

.master-art {
  width: 100%;
  max-width: 260px;
  justify-self: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.28));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 13px;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.price-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.price-card {
  display: grid;
  gap: 2px;
  min-width: min(220px, 100%);
  min-height: 68px;
  border-color: var(--line);
  background: rgba(35, 29, 24, 0.82);
  color: var(--text);
  text-align: left;
}

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

.price-card strong {
  font-size: 22px;
  letter-spacing: 0;
}

.price-card--active {
  border-color: var(--accent);
  background: rgba(215, 168, 95, 0.16);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.text-link,
.order-result a,
.admin-link {
  color: var(--accent-strong);
  text-underline-offset: 4px;
}

.panel,
.chat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(35, 29, 24, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  image-rendering: pixelated;
}

.panel {
  padding: 20px;
}

.master-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.master-line p {
  margin: 0;
  line-height: 1.8;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #18130f;
  color: var(--accent-strong);
  font-size: 13px;
}

.name-form {
  margin-top: 18px;
}

.concern-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.concern-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.concern-options legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.concern-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15110e;
  color: var(--text);
  cursor: pointer;
}

.concern-options label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(215, 168, 95, 0.16);
}

.concern-options input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--accent);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15110e;
  color: var(--text);
  outline: none;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  min-height: 140px;
  padding: 14px;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(215, 168, 95, 0.14);
}

@media (max-width: 620px) {
  .concern-options {
    grid-template-columns: 1fr;
  }
}

button {
  border: 1px solid rgba(240, 193, 111, 0.22);
  border-radius: 8px;
  background: var(--accent);
  color: #1b130a;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost,
.secondary {
  background: transparent;
  color: var(--text);
}

.ghost:hover,
.secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chat {
  overflow: hidden;
}

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(56vh, 560px);
  overflow-y: auto;
  padding: 18px;
}

.message {
  width: min(680px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.message--assistant {
  align-self: flex-start;
  background: var(--master);
}

.message--user {
  align-self: flex-end;
  background: var(--user);
}

.message__name {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 12px;
}

.meter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 18px;
  color: var(--muted);
  font-size: 12px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 18px;
  background: rgba(20, 16, 13, 0.66);
}

.composer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.next-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  background: rgba(20, 16, 13, 0.74);
}

.next-step__intro p:last-child,
.final-note p {
  margin-bottom: 0;
}

.final-note textarea {
  min-height: 112px;
}

.next-step__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.next-step__title {
  margin: 0;
  color: var(--accent-strong);
}

.prompt-result {
  border-top: 1px solid var(--line);
  padding: 18px;
  background: rgba(20, 16, 13, 0.86);
}

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

.prompt-result pre {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #15110e;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.65;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 13px;
}

.checkout-panel,
.order-panel {
  border-top: 1px solid var(--line);
  padding: 18px;
  background: rgba(20, 16, 13, 0.78);
}

.price-strip--checkout {
  margin-top: 14px;
}

.price-card--leave {
  border-color: rgba(198, 185, 168, 0.3);
  background: rgba(21, 17, 14, 0.72);
}

.price-card--leave strong {
  font-size: 18px;
}

.order-form {
  margin-top: 14px;
}

.order-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #15110e;
  color: var(--muted);
  line-height: 1.7;
}

.order-result p {
  margin: 0 0 8px;
}

.order-result p:last-child {
  margin-bottom: 0;
}

code {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  background: #15110e;
  color: var(--accent-strong);
}

.small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .app {
    padding: 20px 12px;
  }

  .bar {
    min-height: calc(100vh - 40px);
  }

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

  .hero-copy h1 {
    width: auto;
    max-width: none;
  }

  .master-art {
    order: -1;
    width: min(48vw, 180px);
  }

  .row,
  .composer__actions,
  .next-step,
  .prompt-result__header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .price-card {
    width: 100%;
  }

  button {
    width: 100%;
  }
}
