:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #637083;
  --line: #dce3ec;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --blue: #1164d8;
  --teal: #087f8c;
  --green: #1c7c45;
  --amber: #b26b00;
  --shadow: 0 18px 45px rgba(18, 31, 48, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(320px, 1.3fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 24px;
}

.intro h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 640px;
}

.search-panel,
.panel,
.status-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
button {
  height: 42px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

button {
  border: none;
  background: var(--blue);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

.module-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  grid-column: span 2;
}

.module-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.module-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 650;
}

.module-picker input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.status-row p,
.quota small {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
}

.quota {
  text-align: right;
}

.quota span,
.quota small {
  display: block;
}

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

.agent-panel {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid rgba(8, 127, 140, 0.25);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.agent-panel h2 {
  margin: 4px 0 8px;
}

.agent-panel p {
  margin: 0;
  color: var(--muted);
}

.agent-panel strong {
  min-width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e9f7f5;
  color: var(--teal);
  font-size: 28px;
}

.price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.price-summary > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.price-summary span,
.price-summary small {
  display: block;
  color: var(--muted);
}

.price-summary strong {
  display: block;
  margin: 6px 0;
  font-size: 26px;
  color: var(--ink);
}

.eyebrow {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.panel-head strong {
  color: var(--teal);
}

.recommendation {
  border-color: rgba(8, 127, 140, 0.25);
}

.recommendation h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

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

.result-list {
  display: grid;
  gap: 12px;
}

.result {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  background: #fbfcfe;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfe;
}

.result h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: white;
}

.price {
  color: var(--green);
  font-weight: 800;
}

.warning {
  color: var(--amber);
}

.source-list,
#agent-reasons {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.source-panel {
  margin-top: 18px;
}

pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 7px;
  background: #111827;
  color: #d7e2f0;
  font-size: 13px;
  line-height: 1.5;
}

footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) 38px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 840px) {
  .topbar,
  .status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .comparison-grid,
  .price-summary,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .module-picker {
    grid-column: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .quota {
    text-align: left;
  }
}
