:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --surface-2: #f1eee6;
  --ink: #1f2428;
  --muted: #606a70;
  --line: #d8d1c5;
  --accent: #1f7a6b;
  --accent-dark: #15594e;
  --warm: #b25c2c;
  --shadow: 0 18px 48px rgba(38, 43, 47, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(246, 244, 239, 0.96)),
    radial-gradient(circle at 12% 8%, rgba(31, 122, 107, 0.10), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(178, 92, 44, 0.10), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.search-surface,
.result-surface {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-surface {
  padding: 28px;
}

.result-surface {
  margin-top: 18px;
  min-height: 220px;
  padding: 24px;
}

.top-row,
.result-head,
.prompt-head,
.feedback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
}

.query-form {
  margin-top: 24px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.45;
}

textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 122, 107, 0.28);
  outline-offset: 2px;
}

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

.primary-button,
.secondary-button,
.copy-button,
.feedback-row button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

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

.secondary-button,
.copy-button,
.feedback-row button {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

.settings-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head h2,
.panel-head p {
  margin-bottom: 0;
}

.panel-head p,
.empty-state p,
.match-label,
.evidence p,
.workflow p,
.safety p {
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-content: center;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.recommendation {
  display: grid;
  gap: 20px;
}

.match-label {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.cost-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(178, 92, 44, 0.32);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(178, 92, 44, 0.10);
  color: #743915;
  font-size: 0.9rem;
  font-weight: 800;
}

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

.summary-grid section,
.workflow,
.evidence,
.safety,
.prompt-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.summary-grid p,
.workflow p,
.evidence p,
.safety p {
  margin-bottom: 0;
  line-height: 1.45;
}

.safety {
  border-color: rgba(178, 92, 44, 0.42);
  background: rgba(178, 92, 44, 0.07);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: var(--ink);
}

.feedback-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1080px);
    padding: 16px 0;
  }

  .search-surface,
  .result-surface {
    padding: 18px;
  }

  .top-row,
  .result-head,
  .panel-head {
    align-items: flex-start;
  }

  .settings-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

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