: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);
}

/* Progressive onboarding refresh */
:root {
  --teal: #174f3c;
  --teal-dark: #103a2d;
  --mint: #dff4e8;
  --mint-strong: #a9ddbd;
  --blue: #3159c8;
  --blue-soft: #e9efff;
  --warning: #a86216;
  --warning-soft: #fff2dc;
}

body {
  font-family: "Noto Sans KR", "Inter", ui-sans-serif, sans-serif;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 89, 200, 0.28);
  outline-offset: 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.onboarding-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  margin: 10px 0 22px;
  padding: clamp(28px, 5vw, 60px);
  overflow: hidden;
  border: 1px solid rgba(23, 79, 60, 0.15);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 10%, rgba(169, 221, 189, 0.7), transparent 34%),
    linear-gradient(135deg, #f3fbf6 0%, #e8f5ed 100%);
}

.onboarding-hero h1 {
  margin: 8px 0 14px;
  max-width: 720px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  word-break: keep-all;
}

.onboarding-hero > div > p:last-child {
  max-width: 640px;
  margin: 0;
  color: #496158;
  font-size: 17px;
  line-height: 1.75;
}

.hero-promise {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 45px rgba(23, 79, 60, 0.08);
  backdrop-filter: blur(12px);
}

.hero-promise span {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #29483c;
  font-weight: 700;
}

.hero-promise b {
  color: #77a689;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.stepper {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(252, 249, 248, 0.94);
  box-shadow: 0 10px 30px rgba(28, 27, 27, 0.05);
  backdrop-filter: blur(16px);
}

.step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border-radius: 11px;
}

.step-pill span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  font-size: 12px;
}

.step-pill.active span {
  background: rgba(255, 255, 255, 0.2);
}

.screen-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.8fr);
  gap: 30px;
  align-items: end;
  margin: 28px 0 18px;
}

.screen-intro h2,
.optional-step-head h2 {
  margin: 6px 0 8px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.screen-intro > div > p:last-child,
.optional-step-head p {
  margin: 0;
  color: var(--muted);
}

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

.progress-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.progress-card > span,
.progress-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-card strong {
  display: block;
  margin: 3px 0 9px;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 26px;
}

.progress-card .progress-track {
  height: 6px;
  margin-bottom: 8px;
  background: #e8ece9;
}

.progress-card .progress-track span {
  background: var(--teal);
}

.progress-card.total .progress-track span {
  background: var(--blue);
}

.workspace {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

.chat-panel,
.side-panel,
.document-panel,
.guest-card,
.guest-answer-panel,
.optional-step-head {
  border-radius: 20px;
}

.panel-kicker {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.core-complete-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 20px 16px;
  padding: 16px;
  border: 1px solid var(--mint-strong);
  border-radius: 16px;
  background: var(--mint);
}

.core-complete-banner[hidden] {
  display: none;
}

.core-complete-banner strong {
  color: var(--teal-dark);
}

.core-complete-banner p {
  margin: 4px 0 0;
  color: #476257;
  font-size: 13px;
  line-height: 1.55;
}

.celebration-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.composer label,
.guest-card > label,
.doc-actions label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

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

.composer-footer small {
  color: var(--muted);
  line-height: 1.5;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c2c7c4;
}

.status-dot.partial { background: #e49a3a; }
.status-dot.complete { background: #2f8c5e; }

.missing-field-list li {
  align-items: flex-start;
  gap: 10px;
}

.field-main {
  display: grid;
  flex: 1;
  gap: 3px;
}

.field-main small {
  color: var(--warning);
  font-size: 11px;
  line-height: 1.4;
}

.field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.tag.level-required { background: #173f31; color: #fff; }
.tag.level-recommended { background: var(--blue-soft); color: #284aa8; }
.tag.level-optional { background: #f0ece8; color: #6c6159; }
.tag.status-partial { background: var(--warning-soft); color: var(--warning); }
.tag.status-not_applicable { background: #edf0ee; color: #607067; }

.applicability-controls {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.applicability-controls button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.applicability-controls button.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.side-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.primary-button:disabled {
  cursor: not-allowed;
  background: #c7cec9;
  opacity: 1;
}

.text-button {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.doc-actions {
  align-items: end;
}

.doc-actions label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.doc-actions select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 34px 0 12px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.privacy-note {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #f1f5f3;
  color: #4d655b;
  font-size: 12px;
}

.document-next-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 14px;
}

.optional-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  background: #fff;
}

.sample-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.sample-questions button {
  min-height: 36px;
  border: 1px solid #cdd8d2;
  border-radius: 999px;
  background: #f5faf7;
  color: var(--teal);
  padding: 0 13px;
  font-size: 12px;
}

.guest-page {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.guest-answer-panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.guest-answer-panel[hidden] { display: none; }

.guest-answer {
  margin: 18px 0;
  padding: 20px;
  border-radius: 15px;
  background: #f3f8f5;
  color: #183b2e;
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.answer-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.answer-evidence-grid section {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.answer-evidence-grid h3 {
  margin: 0 0 7px;
  font-size: 12px;
}

.answer-evidence-grid p,
.answer-evidence-grid ul {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.answer-evidence-grid ul {
  list-style: none;
}

.answer-evidence-grid li + li { margin-top: 5px; }

@media (max-width: 900px) {
  .onboarding-hero,
  .screen-intro,
  .workspace,
  .guest-page {
    grid-template-columns: 1fr;
  }

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

  .answer-evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .app-shell { width: min(100% - 20px, 1280px); padding-top: 10px; }
  .onboarding-hero { padding: 24px 20px; border-radius: 20px; }
  .hero-promise { display: none; }
  .stepper { gap: 4px; }
  .step-pill { justify-content: flex-start; padding: 8px; font-size: 11px; }
  .progress-grid { grid-template-columns: 1fr; }
  .optional-step-head { align-items: stretch; flex-direction: column; }
  .composer-footer,
  .document-next-actions,
  .doc-actions { align-items: stretch; flex-direction: column; }
  .composer-footer button,
  .document-next-actions button,
  .doc-actions select,
  .doc-actions button { width: 100%; }
}

* {
  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;
  grid-auto-rows: max-content;
  align-content: start;
  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%;
  }
}

/* Speak to Info — unified operating-notebook system */
:root {
  --bg: #f4f1eb;
  --surface: #fffdf9;
  --surface-strong: #f2eee7;
  --surface-muted: #e8e3da;
  --ink: #17211d;
  --muted: #5d6863;
  --line: #d9d5cc;
  --line-strong: #b6bdb7;
  --teal: #123f31;
  --teal-dark: #0a3025;
  --mint: #dff0e6;
  --mint-strong: #9fc7ad;
  --blue: #3159c8;
  --blue-soft: #e9efff;
  --warning: #965b17;
  --warning-soft: #fff0d8;
  --coral: #8a4a32;
  --amber: #b36b1e;
  --sage: #d4eadb;
  --sage-dim: #9fc7ad;
  --shadow: 0 18px 55px rgba(23, 33, 29, 0.07);
}

html {
  background: var(--bg);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgba(189, 219, 198, 0.28), transparent 22rem),
    linear-gradient(180deg, #f8f5ef 0, var(--bg) 38rem);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.012em;
  word-break: keep-all;
}

h1,
h2,
.progress-card strong,
#completionText {
  font-family: inherit;
}

button,
textarea,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border-radius: 10px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #ed9f42;
  outline-offset: 3px;
}

.app-shell {
  width: min(1240px, calc(100% - 40px));
  padding: 20px 0 64px;
}

.topbar {
  min-height: 58px;
  align-items: center;
  flex-direction: row;
  margin-bottom: 20px;
  padding: 0 2px 16px;
}

.brand {
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.status-pill {
  min-width: 96px;
  min-height: 38px;
  border-color: #cdd5cf;
  background: rgba(255, 253, 249, 0.82);
  color: #425149;
  padding: 8px 13px;
  backdrop-filter: blur(10px);
}

.doc-actions select {
  min-height: 44px;
}

.status-pill::before {
  width: 8px;
  height: 8px;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(179, 107, 30, 0.12);
}

.status-pill.local {
  border-color: #ddc9a9;
  color: #704b1f;
}

.status-pill.local::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(179, 107, 30, 0.12);
}

.onboarding-hero {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
  min-height: 330px;
  align-items: center;
  margin: 0 0 18px;
  border: 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 8%, rgba(168, 214, 183, 0.36), transparent 24rem),
    linear-gradient(135deg, #0a3025, #174c3a 68%, #245f49);
  color: #fff;
  box-shadow: 0 24px 70px rgba(18, 63, 49, 0.18);
}

.onboarding-hero::after {
  position: absolute;
  inset: 18px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  content: "";
  pointer-events: none;
}

.onboarding-hero .eyebrow {
  color: #bbdbc6;
  letter-spacing: 0.06em;
}

.onboarding-hero h1 {
  max-width: 680px;
  color: #fff;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.onboarding-hero > div > p:last-child {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.75;
}

.hero-promise {
  position: relative;
  gap: 0;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.hero-promise span {
  position: relative;
  color: rgba(255, 255, 255, 0.86);
}

.hero-promise span + span {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-promise b {
  color: #a9d3b7;
}

.stepper {
  position: sticky;
  top: 8px;
  z-index: 20;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 30px;
  padding: 7px;
  border: 1px solid rgba(217, 213, 204, 0.92);
  border-radius: 16px;
  background: rgba(248, 245, 239, 0.92);
  box-shadow: 0 12px 35px rgba(23, 33, 29, 0.07);
  backdrop-filter: blur(14px);
}

.step-pill {
  min-height: 48px;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  color: #69736e;
  font-size: 13px;
  text-align: center;
}

.step-pill:hover {
  background: rgba(18, 63, 49, 0.06);
  color: var(--teal);
}

.step-pill.active,
.step-pill[aria-current="step"] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 22px rgba(18, 63, 49, 0.16);
}

.step-pill span {
  width: 23px;
  height: 23px;
  background: rgba(18, 63, 49, 0.08);
}

.step-pill.active span {
  background: rgba(255, 255, 255, 0.16);
}

.screen-intro {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.66fr);
  align-items: end;
  margin: 0 0 18px;
}

.screen-intro h2,
.optional-step-head h2 {
  max-width: 720px;
  font-size: clamp(27px, 3vw, 40px);
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

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

.progress-card {
  padding: 14px 15px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.84);
  box-shadow: none;
}

.progress-card strong {
  font-size: 25px;
}

.workspace {
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.62fr);
  gap: 18px;
}

.chat-panel,
.side-panel,
.document-panel,
.guest-card,
.guest-answer-panel,
.optional-step-head,
.host-card,
.meta-result {
  border-color: rgba(217, 213, 204, 0.92);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: var(--shadow);
}

.chat-panel {
  height: 580px;
  grid-template-rows: auto minmax(220px, 1fr) auto;
}

.chat-panel > .panel-kicker {
  margin: 0;
  padding: 16px 18px 0;
}

.messages {
  gap: 10px;
  padding: 16px 18px;
}

.message {
  max-width: min(88%, 620px);
  border-radius: 14px 14px 14px 4px;
  line-height: 1.65;
}

.message.user {
  border-radius: 14px 14px 4px 14px;
  background: var(--teal);
}

.composer {
  display: block;
  padding: 15px 18px 17px;
  background: #f3efe8;
}

.composer textarea {
  height: 88px;
  min-height: 88px;
  max-height: 180px;
  resize: vertical;
  border-radius: 12px;
  background: var(--surface);
  line-height: 1.55;
}

.composer-footer {
  margin-top: 9px;
}

.composer-footer button {
  flex: 0 0 auto;
  min-width: 176px;
}

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

.side-panel {
  gap: 12px;
}

.missing-list {
  max-height: 390px;
  gap: 8px;
}

.missing-section {
  border-radius: 11px;
}

.missing-section summary {
  min-height: 54px;
}

.missing-header-actions .ghost-button,
.applicability-controls button,
.sample-questions button {
  min-height: 44px;
}

.applicability-controls button {
  min-width: 60px;
  padding-inline: 12px;
}

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

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

.document-panel {
  margin-top: 2px;
}

.document-panel.is-locked #documentPreview {
  min-height: 96px;
  color: var(--muted);
}

.document-panel.is-locked .privacy-note {
  opacity: 0.78;
}

#documentPreview {
  min-height: 220px;
  max-height: 440px;
  background: #f3efe8;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.privacy-note {
  border-left: 3px solid var(--mint-strong);
  background: #edf4ef;
}

.optional-step-head,
.guest-card,
.guest-answer-panel,
.host-landing,
.host-result-hero {
  padding: clamp(20px, 4vw, 32px);
}

.host-page,
.guest-page {
  min-height: auto;
  place-items: start stretch;
}

.guest-page {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
}

.guest-card,
.host-card,
.meta-result {
  width: 100%;
}

.host-card.has-host-result {
  width: min(900px, 100%);
  margin-inline: auto;
}

.host-copy-button {
  min-width: 52px;
  min-height: 44px;
}

.sample-questions button {
  border-color: #c5d4cb;
  background: #f2f7f3;
}

.example-modal {
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(23, 33, 29, 0.22);
}

@media (max-width: 1040px) {
  .onboarding-hero,
  .screen-intro,
  .workspace,
  .guest-page {
    grid-template-columns: 1fr;
  }

  .onboarding-hero {
    min-height: 0;
  }

  .hero-promise {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-promise span + span {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .chat-panel {
    height: 540px;
  }

  .missing-list {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    padding: 10px 0 40px;
  }

  .topbar {
    min-height: 54px;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .status-pill {
    width: auto;
    min-width: 92px;
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .onboarding-hero {
    display: block;
    margin-bottom: 12px;
    padding: 26px 22px;
    border-radius: 20px;
  }

  .onboarding-hero::after {
    inset: 10px;
    border-radius: 14px;
  }

  .onboarding-hero h1 {
    margin: 7px 0 12px;
    font-size: clamp(31px, 9.8vw, 42px);
    line-height: 1.1;
  }

  .onboarding-hero > div > p:last-child {
    font-size: 14px;
    line-height: 1.65;
  }

  .hero-promise {
    display: none;
  }

  .stepper {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 22px;
  }

  .step-pill {
    min-height: 46px;
    justify-content: flex-start;
    padding: 6px 9px;
    font-size: 12px;
    text-align: left;
  }

  .screen-intro {
    gap: 14px;
    margin-bottom: 14px;
  }

  .screen-intro h2,
  .optional-step-head h2 {
    font-size: 27px;
    line-height: 1.25;
  }

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

  .progress-card {
    padding: 12px;
  }

  .progress-card strong {
    margin-bottom: 6px;
    font-size: 22px;
  }

  .workspace {
    gap: 14px;
  }

  .chat-panel {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto;
  }

  .messages {
    min-height: 190px;
    max-height: 340px;
  }

  .composer {
    padding: 14px;
  }

  .composer textarea {
    height: 108px;
  }

  .composer-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .composer-footer button {
    width: 100%;
    min-width: 0;
  }

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

  .panel-header {
    gap: 12px;
  }

  .missing-header-actions {
    justify-content: flex-start;
  }

  .missing-header-actions .ghost-button {
    flex: 1;
  }

  .document-next-actions,
  .doc-actions,
  .optional-step-head {
    align-items: stretch;
    flex-direction: column;
  }

  .doc-actions select,
  .doc-actions button,
  .document-next-actions button,
  .optional-step-head button {
    width: 100%;
  }

  #documentPreview {
    min-height: 190px;
  }

  .guest-card,
  .guest-answer-panel,
  .optional-step-head,
  .host-landing,
  .host-result-hero {
    padding: 18px;
  }
}

@media (max-width: 350px) {
  .app-shell {
    width: calc(100% - 16px);
  }

  .status-pill {
    min-width: 82px;
    padding-inline: 8px;
  }

  .onboarding-hero {
    padding: 24px 18px;
  }

  .onboarding-hero h1 {
    font-size: 30px;
  }

  .step-pill {
    font-size: 11px;
  }

  .step-pill span {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  button:focus,
  textarea:focus,
  select:focus,
  a:focus,
  summary:focus {
    outline: 3px solid #ed9f42;
    outline-offset: 3px;
  }
}

/* Okgongi guided core-information flow */
.core-wizard-started .onboarding-hero {
  display: none;
}

.core-wizard-started .stepper {
  margin-bottom: 20px;
}

.workspace {
  grid-template-columns: minmax(0, 1.28fr) minmax(390px, 0.72fr);
}

.chat-panel.guided-mode {
  height: auto;
  min-height: 700px;
  display: block;
  overflow: visible;
}

.chat-panel.guided-mode > .intake-kicker {
  display: none;
}

.intake-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intake-kicker img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transform: scale(1.35);
}

.guided-question {
  scroll-margin-top: 90px;
}

.guided-question {
  padding: clamp(18px, 3vw, 30px);
}

.guided-question[hidden],
.chat-panel .composer[hidden],
.chat-panel .messages[hidden] {
  display: none !important;
}

.okgongi-guide {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.okgongi-guide img {
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(18, 63, 49, 0.16));
  transform: scale(1.5);
  transform-origin: center;
}

.okgongi-guide > div {
  position: relative;
  flex: 1;
  border: 1px solid #bad4c2;
  border-radius: 18px 18px 18px 5px;
  background: #edf7f0;
  padding: 13px 16px;
}

.okgongi-guide strong {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 15px;
}

.okgongi-guide p {
  margin: 0;
  color: #31483e;
  font-size: 16px;
  line-height: 1.55;
}

.guided-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
}

.guided-progress span {
  font-weight: 750;
  color: var(--teal);
}

.guided-progress strong {
  font-size: 14px;
}

.guided-visual {
  position: relative;
  width: min(100%, 560px);
  height: auto;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #cbd9cf;
  border-radius: 22px;
  background: #f2eee5;
}

.guided-visual::after {
  display: none;
}

.guided-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.guided-form {
  width: min(100%, 680px);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 30px) 4px 0;
}

.guided-kicker {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 800;
}

.guided-form h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3.2vw, 34px);
  font-weight: 780;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.guided-help {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.guided-control input[type="text"],
.guided-control input[type="tel"],
.guided-control input[type="time"],
.guided-control textarea,
.guided-custom {
  width: 100%;
  min-height: 60px;
  border: 2px solid #aebbb3;
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.5;
}

.guided-control textarea {
  min-height: 112px;
  resize: vertical;
}

.guided-control input:focus,
.guided-control textarea:focus {
  border-color: var(--teal);
}

.guided-quicks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.guided-quicks button {
  min-height: 50px;
  border: 1px solid #b9c9bf;
  border-radius: 12px;
  background: #eff6f1;
  padding: 10px 15px;
  color: var(--teal);
  font-size: 16px;
  font-weight: 700;
}

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

.guided-choices:not(.yesno) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guided-choice {
  min-height: 66px;
  border: 2px solid #b8c4bc;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  color: #26382f;
  font-size: 17px;
  font-weight: 750;
}

.guided-choice:hover {
  border-color: var(--teal);
  background: #f0f7f2;
}

.guided-choice.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 20px rgba(18, 63, 49, 0.18);
}

.guided-custom {
  margin-top: 10px;
}

.number-stepper {
  display: grid;
  grid-template-columns: 72px minmax(140px, 1fr) 72px;
  align-items: stretch;
  gap: 10px;
}

.number-stepper > button,
.mini-stepper button {
  min-width: 58px;
  min-height: 64px;
  border: 2px solid #9db8a6;
  border-radius: 16px;
  background: #e9f5ed;
  color: var(--teal);
  font-size: 34px;
  font-weight: 600;
}

.number-stepper label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 2px solid #aebbb3;
  border-radius: 16px;
  background: #fff;
}

.number-stepper input {
  width: 84px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
  text-align: right;
}

.number-stepper b {
  margin-left: 7px;
  font-size: 18px;
}

.bed-matrix {
  display: grid;
  gap: 8px;
}

.bed-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border: 1px solid #d4dcd6;
  border-radius: 14px;
  background: #fff;
  padding: 8px 10px 8px 16px;
}

.bed-row > strong {
  font-size: 18px;
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-stepper button {
  min-width: 52px;
  min-height: 52px;
  border-radius: 12px;
  font-size: 27px;
}

.mini-stepper input {
  width: 48px;
  border: 0;
  background: transparent;
  font-size: 23px;
  font-weight: 800;
  text-align: right;
}

.guided-error {
  margin: 12px 0 0;
  border-radius: 10px;
  background: #fff0e8;
  padding: 11px 13px;
  color: #8a351e;
  font-size: 16px;
  font-weight: 700;
}

.guided-actions {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.guided-save {
  min-height: 62px;
  font-size: 19px;
  font-weight: 800;
}

.guided-actions .text-button,
.return-guided {
  min-height: 50px;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.return-guided {
  width: 100%;
  margin-top: 8px;
}

.side-panel {
  min-width: 0;
}

.missing-field-list > li {
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.missing-field-list .field-main {
  min-width: 0;
  min-height: 58px;
  flex: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
}

button.field-main:hover,
button.field-main:focus-visible {
  background: #eef5f0;
}

.field-main > span {
  font-size: 15px;
  font-weight: 750;
}

.field-main .field-value {
  display: -webkit-box;
  overflow: hidden;
  color: #53645a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.missing-field-list > li.done .field-value {
  color: var(--teal);
  font-weight: 650;
}

.field-tags {
  flex: 0 0 auto;
  align-items: center;
  flex-direction: column;
  gap: 4px;
}

.field-edit-label {
  color: #66746c;
  font-size: 12px;
  text-decoration: underline;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: 2;
  }
}

@media (max-width: 700px) {
  .chat-panel.guided-mode {
    min-height: 0;
  }

  .guided-question {
    padding: 14px;
  }

  .okgongi-guide {
    align-items: flex-start;
    gap: 9px;
  }

  .okgongi-guide img {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }

  .okgongi-guide > div {
    padding: 11px 13px;
  }

  .okgongi-guide p {
    font-size: 15px;
  }

  .guided-visual {
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 17px;
  }

  .guided-form {
    padding-top: 18px;
  }

  .guided-form h3 {
    font-size: 25px;
  }

  .guided-help {
    margin-bottom: 16px;
    font-size: 16px;
  }

  .guided-choices,
  .guided-choices:not(.yesno) {
    grid-template-columns: 1fr;
  }

  .guided-choice {
    min-height: 60px;
    font-size: 18px;
  }

  .number-stepper {
    grid-template-columns: 66px minmax(110px, 1fr) 66px;
    gap: 7px;
  }

  .bed-row {
    grid-template-columns: 1fr;
  }

  .mini-stepper {
    justify-content: space-between;
  }

  .guided-save {
    min-height: 64px;
  }

  .missing-field-list > li {
    align-items: center;
  }
}

@media (max-width: 350px) {
  .guided-progress {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .number-stepper {
    grid-template-columns: 58px minmax(96px, 1fr) 58px;
  }
}
