:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-soft: #eef2ea;
  --ink: #1f2420;
  --muted: #667064;
  --line: #d8ddd3;
  --green: #5c872f;
  --green-dark: #3f641d;
  --red: #a83c32;
  --amber: #9d6b1f;
  --shadow: 0 18px 48px rgba(31, 36, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 42px clamp(20px, 4vw, 56px) 28px;
  background: #20251f;
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #bdd7a3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

h3 {
  margin: 26px 0 12px;
  font-size: 15px;
  text-transform: uppercase;
}

.subline {
  margin-bottom: 0;
  max-width: 760px;
  color: #d9dfd3;
  font-size: 17px;
  line-height: 1.5;
}

.status-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

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

.status-card.ok .status-dot {
  background: #8fca58;
}

.status-card.error .status-dot {
  background: #d86d62;
}

main {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(360px, 1.2fr);
  gap: 18px;
  padding: 22px clamp(16px, 3vw, 40px) 42px;
}

section {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.advisor-panel,
.result-panel,
.handoff-panel,
.notes-panel {
  padding: 22px;
}

.result-panel {
  grid-row: span 3;
}

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

.panel-head p,
.notes-panel p,
.handoff-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.quick-prompts button,
.secondary,
.ghost-link {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

.quick-prompts button:hover,
.secondary:hover,
.ghost-link:hover {
  border-color: var(--green);
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

textarea:focus,
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(92, 135, 47, 0.14);
}

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

.primary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--green);
  color: #fff;
  padding: 10px 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

.primary:disabled,
.disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

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

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  background: #fff;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f7f8f5;
  border-bottom: 1px solid var(--line);
}

.product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.brand {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.25;
}

.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.price {
  color: var(--ink);
}

.product-link {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

.product-link:hover {
  text-decoration: underline;
}

.empty-state {
  display: block;
  border: 1px dashed var(--line);
  background: #fafbf8;
  color: var(--muted);
  padding: 22px;
}

.caution,
.quantity-box {
  margin-bottom: 14px;
  padding: 13px 14px;
  line-height: 1.45;
}

.caution {
  border-left: 4px solid var(--amber);
  background: #fff7e8;
  color: #624311;
}

.quantity-box {
  border-left: 4px solid var(--green);
  background: var(--surface-soft);
}

.hidden {
  display: none;
}

.handoff-items {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.handoff-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.notes-grid {
  display: grid;
  gap: 12px;
}

.notes-grid article {
  border-left: 3px solid var(--green);
  background: var(--surface-soft);
  padding: 12px;
}

code {
  background: #e5eadf;
  padding: 2px 5px;
}

@media (max-width: 1100px) {
  main,
  .product-grid,
  .product-grid.compact {
    grid-template-columns: 1fr;
  }

  .result-panel {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .app-header,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .status-card {
    width: 100%;
  }
}
