:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --ink: #1d2428;
  --muted: #64717b;
  --line: #d9dfdb;
  --panel: #ffffff;
  --soft: #edf5ef;
  --soft-alt: #f3f6fa;
  --accent: #10776c;
  --accent-dark: #0b584f;
  --coral: #c86243;
  --blue: #385f9b;
  --warn: #8a4d1d;
  --shadow: 0 20px 60px rgba(26, 34, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  background:
    linear-gradient(180deg, #eef4ef 0, #f7f8f4 380px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
}

body::before {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--coral), var(--blue));
  content: "";
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 24px;
  align-items: start;
  padding: 18px 0 20px;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 7px;
  font-size: 2.7rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1rem;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(200, 98, 67, 0.3);
  border-radius: 999px;
  background: #fff7f2;
  color: var(--coral);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.language-control {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

select,
input,
button,
.button {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

select,
input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

select:focus,
input:focus,
button:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(16, 119, 108, 0.2);
  outline-offset: 2px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.button[aria-disabled="true"] {
  background: #dfe7e3;
  color: #53615d;
  pointer-events: none;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--soft);
  color: var(--ink);
}

.status-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 12px 0 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.status-band strong {
  display: block;
  margin-bottom: 5px;
}

.status-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(26, 34, 38, 0.05);
  padding: 20px;
}

.guide-panel {
  min-height: 360px;
}

.guide-stack {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.guide-section {
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
}

.guide-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.guide-section + .guide-section {
  margin-top: 18px;
}

.guide-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.guide-section-header strong {
  font-size: 1.02rem;
}

.guide-section p {
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.62;
}

.guide-section p:last-child {
  margin-bottom: 0;
}

.source-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-alt);
  padding: 3px 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  gap: 10px;
  margin-top: 18px;
}

.answer-box {
  margin-top: 14px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  padding: 15px;
  line-height: 1.55;
}

.answer-box[data-action="blocked"] {
  border-color: rgba(200, 98, 67, 0.55);
  background: #fff7f2;
  color: var(--warn);
}

.answer-box[data-action="host_review"] {
  border-color: rgba(16, 119, 108, 0.45);
  background: var(--soft);
  color: var(--accent-dark);
}

.answer-box[data-action="agent"] {
  border-color: rgba(56, 95, 155, 0.45);
  background: var(--soft-alt);
  color: var(--ink);
}

.source-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.source-row {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  padding: 13px 0;
  text-decoration: none;
}

.source-row:first-child {
  border-top: 0;
}

.source-row span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.source-row:hover strong {
  color: var(--accent-dark);
}

.setup-shell {
  width: min(1240px, calc(100% - 32px));
}

.warning-band {
  background: #fff8e8;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.setup-form {
  display: grid;
  gap: 14px;
}

.setup-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.setup-form input,
.setup-form textarea,
.output-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.setup-form textarea,
.output-textarea,
.config-preview {
  line-height: 1.5;
}

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

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

.setup-output {
  display: grid;
  gap: 18px;
}

.warning-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.config-preview {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
  color: #eaf2f4;
  padding: 14px;
  font-size: 0.86rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  h1 {
    font-size: 2.15rem;
  }

  .topbar,
  .status-band,
  .layout,
  .setup-layout {
    grid-template-columns: 1fr;
  }

  .language-control {
    max-width: 260px;
  }
}

@media (max-width: 560px) {
  .shell,
  .setup-shell {
    width: min(100% - 24px, 1160px);
    padding-top: 26px;
  }

  h1 {
    font-size: 1.82rem;
  }

  .panel,
  .status-band {
    padding: 16px;
  }

  .language-control {
    max-width: none;
  }

  .ask-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  button,
  .button {
    width: 100%;
  }

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