:root {
  --ink: #15201b;
  --muted: #617068;
  --paper: #f4f5ef;
  --card: rgba(255, 255, 252, 0.86);
  --line: #dce2da;
  --green: #1c6b4a;
  --green-dark: #114a33;
  --mint: #ccebdc;
  --orange: #f1a65a;
  --shadow: 0 20px 60px rgba(33, 63, 48, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

.ambient { position: fixed; border-radius: 50%; filter: blur(2px); z-index: -1; }
.ambient-one { width: 460px; height: 460px; top: -180px; right: -120px; background: rgba(174, 224, 199, .62); }
.ambient-two { width: 360px; height: 360px; bottom: -170px; left: -110px; background: rgba(244, 181, 113, .35); }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0; }
.hero { max-width: 720px; margin-bottom: 34px; }
.eyebrow, .kicker { color: var(--green); font-size: .74rem; font-weight: 700; letter-spacing: .14em; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 28px; height: 2px; background: var(--orange); }
h1 { margin: 12px 0 10px; font-family: "Space Grotesk", sans-serif; font-size: clamp(2.6rem, 6vw, 5rem); line-height: .98; letter-spacing: -.055em; }
.hero p { margin: 0; max-width: 630px; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }

.query-card, .panel { background: var(--card); border: 1px solid rgba(215, 224, 215, .9); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.query-card { padding: 24px; border-radius: 22px; }
label { display: block; margin-bottom: 9px; font-size: .85rem; font-weight: 700; }
.input-row { display: flex; gap: 12px; }
input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; background: #fff; color: var(--ink); font: inherit; outline: none; transition: .2s; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(28, 107, 74, .1); }
button { font: inherit; cursor: pointer; }
#submit-button { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 13px; padding: 0 22px; background: var(--green); color: #fff; font-weight: 700; transition: .2s; }
#submit-button:hover { background: var(--green-dark); transform: translateY(-1px); }
#submit-button:disabled { opacity: .65; cursor: wait; transform: none; }
#submit-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.suggestions button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: transparent; color: var(--muted); font-size: .8rem; }
.suggestions button:hover { border-color: var(--green); color: var(--green); }

.status { margin: 22px 0; padding: 13px 16px; border-radius: 12px; background: #fff4e6; color: #8c511f; border: 1px solid #f1d2ae; }
.status.loading { background: #e8f5ee; color: var(--green-dark); border-color: #c7e5d5; }
.hidden { display: none !important; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; margin-top: 22px; align-items: start; }
.side-stack { display: grid; gap: 18px; }
.panel { border-radius: 18px; padding: 21px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
h2 { margin: 3px 0 0; font: 700 1.25rem "Space Grotesk", sans-serif; }
.row-count { padding: 6px 10px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: .76rem; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #edf3ee; color: #3c5046; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf7; }
pre { margin: 12px 0 0; padding: 15px; overflow-x: auto; border-radius: 12px; background: #15201b; color: #cdebdc; font: .78rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.steps { list-style: none; padding: 0; margin: 15px 0 0; }
.steps li { position: relative; padding: 0 0 17px 28px; color: var(--muted); font-size: .83rem; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 10px; height: 10px; border: 3px solid var(--mint); border-radius: 50%; background: var(--green); }
.steps li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; color: var(--ink); margin-bottom: 2px; }
.empty { padding: 32px !important; text-align: center; color: var(--muted); }

@media (max-width: 820px) {
  .shell { padding: 44px 0; }
  .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); padding: 34px 0; }
  .query-card { padding: 16px; }
  .input-row { flex-direction: column; }
  #submit-button { justify-content: center; min-height: 48px; }
  .suggestions { display: grid; }
  h1 { font-size: 2.8rem; }
}

