:root {
  --bg: #fcf9f8;
  --surface: #ffffff;
  --surface-strong: #f6f3f2;
  --surface-muted: #f0eded;
  --ink: #1c1b1b;
  --muted: #5f5e5b;
  --line: #e4e2dd;
  --line-strong: #c2c8c0;
  --teal: #163422;
  --teal-dark: #2d4b37;
  --sage: #c8ebd0;
  --sage-dim: #adcfb4;
  --coral: #ba1a1a;
  --amber: #466550;
  --shadow: 0 28px 70px rgba(28, 27, 27, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter",
    ui-sans-serif,
    sans-serif;
  letter-spacing: 0.01em;
  accent-color: var(--teal);
}

body.modal-open {
  overflow: hidden;
}

body.green-view {
  background:
    linear-gradient(180deg, rgba(7, 22, 13, 0.32) 0, rgba(252, 249, 248, 0) 420px),
    var(--bg);
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: progress;
  opacity: 0.65;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.view-switch span {
  padding: 0 8px 0 10px;
  white-space: nowrap;
}

.view-option {
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
}

.view-option.active {
  background: var(--teal);
  color: #ffffff;
}

.green-hero {
  display: none;
}

.green-view .topbar {
  position: relative;
  z-index: 4;
  margin-bottom: 18px;
  border: 1px solid rgba(228, 226, 221, 0.74);
  border-radius: 20px;
  background: rgba(252, 249, 248, 0.88);
  padding: 18px 20px;
  box-shadow: 0 18px 60px rgba(7, 22, 13, 0.11);
  backdrop-filter: blur(18px);
}

.green-view .green-hero {
  position: relative;
  isolation: isolate;
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: end;
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(228, 226, 221, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(5, 20, 12, 0.84) 0%, rgba(5, 20, 12, 0.54) 44%, rgba(5, 20, 12, 0.08) 100%),
    url("/green-stay-hero.jpg") center 48% / cover no-repeat;
  padding: 42px;
  color: #ffffff;
  box-shadow: 0 34px 100px rgba(7, 22, 13, 0.28);
}

.green-view .green-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 20, 12, 0), rgba(5, 20, 12, 0.4));
}

.green-hero-copy {
  max-width: 680px;
}

.green-hero .eyebrow {
  color: var(--sage);
}

.green-hero h2 {
  max-width: 680px;
  color: #ffffff;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
}

.green-hero p {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.6;
}

.green-hero-card {
  justify-self: end;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 20px;
  background: rgba(252, 249, 248, 0.14);
  padding: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.green-hero-card span {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: var(--teal);
  font-weight: 900;
}

.green-hero-card strong {
  display: block;
  margin-top: 34px;
  color: #ffffff;
  font-family:
    "Hanken Grotesk",
    ui-sans-serif,
    sans-serif;
  font-size: 28px;
  line-height: 1.05;
}

.green-hero-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.green-hero-card ol {
  counter-reset: flow-step;
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.green-hero-card li {
  counter-increment: flow-step;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.35;
}

.green-hero-card li::before {
  content: "0" counter(flow-step);
  display: inline-flex;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.green-view .stepper {
  position: relative;
  z-index: 3;
  width: min(1080px, calc(100% - 48px));
  margin: -36px auto 28px;
  border: 1px solid rgba(228, 226, 221, 0.84);
  border-radius: 18px;
  background: rgba(252, 249, 248, 0.92);
  padding: 8px;
  box-shadow: 0 22px 70px rgba(7, 22, 13, 0.13);
  backdrop-filter: blur(18px);
}

.green-view .step-pill {
  border-color: transparent;
  background: transparent;
}

.green-view .step-pill.active {
  background: var(--teal);
  color: #ffffff;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

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

.step-pill {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 0 16px;
  text-align: center;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.step-pill.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.flow-screen[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  font-family:
    "Hanken Grotesk",
    ui-sans-serif,
    sans-serif;
}

h1 {
  color: var(--teal);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 74px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(70, 101, 80, 0.14);
}

.status-pill.ready {
  border-color: var(--sage-dim);
  color: var(--teal);
}

.status-pill.ready::before {
  background: #2f7d47;
  box-shadow: 0 0 0 4px rgba(47, 125, 71, 0.16);
}

.status-pill.local {
  border-color: rgba(217, 104, 83, 0.35);
  color: var(--coral);
}

.status-pill.local::before {
  background: #d83a2e;
  box-shadow: 0 0 0 4px rgba(216, 58, 46, 0.18);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.chat-panel,
.side-panel,
.document-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.green-view .workspace {
  position: relative;
  z-index: 2;
  gap: 24px;
}

.green-view .chat-panel,
.green-view .side-panel,
.green-view .document-panel,
.green-view .guest-card,
.green-view .meta-result {
  border-color: rgba(228, 226, 221, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 80px rgba(7, 22, 13, 0.08);
  backdrop-filter: blur(14px);
}

.chat-panel {
  height: clamp(620px, calc(100dvh - 142px), 760px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.green-view .chat-panel {
  height: clamp(640px, calc(100dvh - 250px), 820px);
}

.progress-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.green-view .progress-strip {
  background: linear-gradient(90deg, #ffffff, #f4f8f3);
}

.progress-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#completionText {
  color: var(--teal);
  font-family:
    "Hanken Grotesk",
    ui-sans-serif,
    sans-serif;
  font-size: 24px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--teal);
  transition: width 200ms ease;
}

.messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
}

.message {
  max-width: 82%;
  border-radius: 14px;
  padding: 13px 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.bot {
  align-self: flex-start;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.message.analyzing {
  align-items: center;
  display: inline-flex;
  gap: 9px;
  color: var(--muted);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  transform: translateY(1px);
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  animation: typingPulse 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 0.9;
    transform: translateY(-3px);
  }
}

.green-view .message.bot {
  background: #f8f6f4;
  border-color: var(--line);
}

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

.green-view .message.user {
  background: linear-gradient(135deg, #163422, #2d4b37);
  box-shadow: 0 12px 28px rgba(22, 52, 34, 0.18);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.green-view .composer {
  background: rgba(246, 243, 242, 0.94);
}

.composer textarea {
  width: 100%;
  height: 72px;
  min-height: 72px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

.composer textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 52, 34, 0.12);
}

.composer button,
.primary-button {
  background: var(--teal);
  color: #ffffff;
  padding: 0 18px;
}

.green-view .composer button,
.green-view .primary-button {
  box-shadow: 0 14px 34px rgba(22, 52, 34, 0.14);
}

.composer button:hover,
.primary-button:hover {
  background: var(--teal-dark);
}

.side-panel,
.document-panel {
  padding: 20px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.missing-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.missing-header-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.missing-list {
  display: grid;
  gap: 10px;
  min-height: 190px;
  max-height: min(62vh, 620px);
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missing-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  overflow: hidden;
}

.missing-section.done {
  background: #fff7d6;
  border-color: #f3df94;
  color: #7a5a12;
}

.missing-section.has-done:not(.done) {
  background: #fffbee;
  border-color: #f4e7b5;
}

.missing-section details {
  width: 100%;
}

.missing-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.missing-section summary::-webkit-details-marker {
  display: none;
}

.missing-section summary::before {
  content: "›";
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.missing-section details[open] summary::before {
  transform: rotate(90deg);
}

.missing-section-title {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.missing-section-title strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.missing-section-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.missing-field-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px 44px;
  list-style: none;
}

.missing-field-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 10px 11px;
  color: var(--muted);
}

.missing-field-list li.done {
  border-color: #f3df94;
  background: #fff7d6;
  color: #7a5a12;
}

.tag {
  min-width: 54px;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 4px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.done .tag {
  background: #f7df7a;
  color: #5d4308;
}

.secondary-button,
.ghost-button,
.doc-actions button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
}

.green-view .secondary-button,
.green-view .ghost-button,
.green-view .doc-actions button {
  background: rgba(255, 255, 255, 0.74);
}

.green-view .doc-actions .primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.secondary-button:hover,
.ghost-button:hover,
.doc-actions button:hover {
  border-color: var(--teal);
  background: var(--surface-strong);
  color: var(--teal);
}

.ghost-button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 13px;
}

.document-panel {
  grid-column: 1 / -1;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.doc-actions .primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.doc-actions .primary-button:hover {
  background: var(--teal-dark);
  color: #ffffff;
}

#documentPreview {
  min-height: 280px;
  max-height: 520px;
  overflow: auto;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 18px;
  color: var(--ink);
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.host-page,
.guest-page {
  min-height: calc(100dvh - 150px);
  display: grid;
  place-items: start center;
}

.host-card,
.guest-card,
.meta-result {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.host-card {
  width: min(448px, 100%);
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.green-view .host-card {
  width: min(520px, 100%);
}

.host-card.has-host-result,
.green-view .host-card.has-host-result {
  width: min(760px, 100%);
}

.host-landing,
.host-result-hero {
  padding: 42px 24px 30px;
  text-align: center;
}

.green-view .host-result-hero {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 243, 242, 0.96)),
    url("/green-stay-hero.jpg") center / cover no-repeat;
}

.green-view .host-result-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(200, 235, 208, 0.55), transparent 48%);
}

.green-view .host-result-hero > * {
  position: relative;
  z-index: 1;
}

.host-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 32px;
}

.host-emoji {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid var(--sage-dim);
  border-radius: 999px;
  background: var(--sage);
  color: var(--teal);
  font-size: 38px;
}

.host-landing h2,
.host-result-hero h2,
.guest-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.18;
}

.host-landing p,
.host-result-hero p,
.guest-lead {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.host-note {
  width: fit-content;
  margin: 18px auto 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 8px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.host-landing .primary-button {
  width: 100%;
  min-height: 56px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 18px 42px rgba(22, 52, 34, 0.12);
}

.host-quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.host-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2f3f2;
}

.host-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 500ms ease;
}

.host-question {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 10px 26px rgba(31, 42, 42, 0.05);
}

.host-question h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.35;
}

.host-question-image-wrap {
  overflow: hidden;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff8df;
  box-shadow: 0 18px 48px rgba(31, 42, 42, 0.08);
}

.host-question-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.host-situation-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.host-options {
  display: grid;
  gap: 10px;
  padding: 12px 0 0;
}

.host-option {
  min-height: auto;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 15px 16px;
  color: var(--ink);
  text-align: left;
  line-height: 1.55;
  font-weight: 650;
}

.host-option:hover {
  border-color: var(--teal);
  background: #f4f8f3;
  color: var(--teal);
}

.host-option strong {
  color: var(--teal);
}

.host-loading,
.host-error {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.host-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--sage);
  border-top-color: var(--teal);
  border-radius: 999px;
  animation: host-spin 0.8s linear infinite;
}

@keyframes host-spin {
  to {
    transform: rotate(360deg);
  }
}

.host-loading-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.host-loading-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.host-error-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: #fff0e8;
  color: var(--coral);
  font-size: 26px;
  font-weight: 900;
}

.host-result-hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.host-card.has-host-result .host-result-hero {
  padding: 30px 30px 34px;
}

.host-character-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 12px;
}

.host-card.has-host-result .host-character-wrap {
  margin: 0 0 24px;
}

.host-character {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(31, 42, 42, 0.12));
}

.host-card.has-host-result .host-character {
  width: min(560px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: contain;
  background: #f6efe3;
  box-shadow: 0 24px 70px rgba(31, 42, 42, 0.12);
  filter: none;
}

.host-card.has-host-result .host-result-hero .eyebrow {
  max-width: none;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
}

.host-card.has-host-result .host-result-hero h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.host-card.has-host-result .host-result-hero h2 + p {
  max-width: 620px;
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.7;
}

.host-copy-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--sage);
  color: var(--teal);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.host-copy-button:hover {
  background: var(--sage-dim);
}

.host-result-hero > .host-copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.host-copy-button.muted {
  background: var(--surface-strong);
  color: var(--muted);
}

.host-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.host-result-detail {
  position: relative;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 10px 26px rgba(31, 42, 42, 0.05);
}

.host-result-detail h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.host-result-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.host-actions {
  display: grid;
  gap: 10px;
  padding: 14px 0 0;
}

.host-actions .primary-button,
.host-actions .secondary-button,
.host-actions .ghost-button {
  width: 100%;
}

.guest-page {
  gap: 16px;
}

.quick-page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.quick-page.has-result {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.76fr) minmax(0, 1.1fr);
}

.guest-card,
.meta-result,
.quick-card,
.quick-result {
  padding: 24px;
}

.quick-card,
.quick-result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.green-view .quick-card,
.green-view .quick-result {
  border-color: rgba(228, 226, 221, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 80px rgba(7, 22, 13, 0.08);
  backdrop-filter: blur(14px);
}

.green-view .guest-card {
  position: relative;
  overflow: hidden;
  padding: 32px;
}

.green-view .guest-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.86)),
    url("/green-stay-hero.jpg") right center / 52% auto no-repeat;
}

.guest-card textarea,
.quick-card textarea {
  width: 100%;
  min-height: 210px;
  margin: 20px 0 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  color: var(--ink);
  font: inherit;
  line-height: 1.65;
  outline: none;
}

.guest-card textarea:focus,
.quick-card textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 52, 34, 0.12);
}

#quickPromptInput {
  min-height: 520px;
}

#quickQuestionInput {
  min-height: 250px;
}

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

.guest-actions .primary-button,
.guest-actions .secondary-button {
  width: 100%;
}

.quick-actions .primary-button {
  width: 100%;
}

.meta-result {
  display: grid;
  gap: 14px;
}

.quick-result {
  display: grid;
  gap: 14px;
}

.meta-result[hidden],
.quick-result[hidden] {
  display: none;
}

.meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#metaPromptPreview,
#quickPromptPreview {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 620px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 16px;
  color: var(--ink);
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(20px);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(31, 42, 42, 0.38);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.example-modal {
  width: min(760px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(31, 42, 42, 0.22);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.modal-header,
.modal-footer {
  padding: 16px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-close {
  flex: 0 0 auto;
}

.modal-lead {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
}

.example-guide {
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px;
}

.example-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.example-block:last-child {
  border-bottom: 0;
}

.example-block h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.example-block p {
  margin: 0 0 10px;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
}

.example-answer {
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px 13px;
  color: #263332;
  font-size: 14px;
  line-height: 1.65;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.modal-footer .primary-button {
  width: auto;
  min-width: 120px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 14px 0;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch {
    width: 100%;
    justify-content: space-between;
  }

  .view-option {
    flex: 1;
  }

  .green-view .topbar {
    border-radius: 18px;
    padding: 16px;
  }

  .green-view .green-hero {
    min-height: 420px;
    grid-template-columns: 1fr;
    align-items: end;
    gap: 18px;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(5, 20, 12, 0.18) 0%, rgba(5, 20, 12, 0.72) 56%, rgba(5, 20, 12, 0.9) 100%),
      url("/green-stay-hero.jpg") center top / cover no-repeat;
    padding: 24px;
  }

  .green-hero h2 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .green-hero p {
    font-size: 15px;
  }

  .green-hero-card {
    justify-self: stretch;
  }

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

  .green-view .stepper {
    width: calc(100% - 20px);
    margin: -24px auto 20px;
    grid-template-columns: 1fr;
  }

  .step-pill {
    justify-content: flex-start;
    text-align: left;
  }

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

  .quick-page,
  .quick-page.has-result {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: clamp(520px, calc(100dvh - 132px), 720px);
    min-height: 0;
  }

  .green-view .chat-panel {
    height: clamp(560px, calc(100dvh - 190px), 740px);
  }

  .message {
    max-width: 92%;
  }

  .composer {
    position: static;
    grid-template-columns: 1fr;
  }

  .composer button {
    width: 100%;
  }

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

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .meta-actions button {
    width: 100%;
  }

  .doc-actions {
    display: flex;
    justify-content: stretch;
  }

  .doc-actions button {
    width: 100%;
    padding: 0 8px;
  }

  .host-page,
  .guest-page,
  .quick-page {
    min-height: auto;
  }

  .host-landing,
  .host-result-hero,
  .guest-card,
  .meta-result,
  .quick-card,
  .quick-result {
    padding: 20px;
  }

  #quickPromptInput,
  #quickQuestionInput {
    min-height: 260px;
  }

  .green-view .guest-card::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92)),
      url("/green-stay-hero.jpg") right top / 100% auto no-repeat;
    opacity: 0.92;
  }

  .host-question {
    padding: 20px;
  }

  .host-question-image-wrap {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .host-situation-copy {
    font-size: 14px;
    line-height: 1.55;
  }

  .host-options,
  .host-actions {
    padding-left: 0;
    padding-right: 0;
  }

  .host-result-detail {
    margin: 14px 0 0;
  }

  .host-card.has-host-result,
  .green-view .host-card.has-host-result {
    width: 100%;
  }

  .host-card.has-host-result .host-result-hero {
    padding: 16px;
  }

  .host-card.has-host-result .host-character-wrap {
    margin-bottom: 18px;
  }

  .host-card.has-host-result .host-character {
    width: 100%;
    border-radius: 14px;
  }

  .host-card.has-host-result .host-result-hero .eyebrow {
    font-size: 11px;
  }

  .host-card.has-host-result .host-result-hero h2 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .host-card.has-host-result .host-result-hero h2 + p {
    font-size: 15px;
    line-height: 1.6;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .example-modal {
    max-height: calc(100dvh - 20px);
  }

  .modal-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .modal-close,
  .modal-footer .primary-button {
    width: 100%;
  }
}
