:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --border: #e5e7eb;
  --accent: #2456f6;
  --accent-dark: #1239ad;
  --good: #107c41;
  --warn: #b7791f;
  --bad: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #e9efff, transparent 35%), var(--bg);
  color: var(--text);
}
.shell { width: min(1180px, calc(100vw - 32px)); margin: 42px auto; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: stretch; margin-bottom: 24px; }
.compact-hero { display: block; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1; margin: 0 0 14px; letter-spacing: -0.04em; }
.subhead { max-width: 820px; color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-size: 12px; font-weight: 800; }
.panel { background: rgba(255,255,255,0.88); border: 1px solid var(--border); box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08); border-radius: 24px; padding: 28px; margin-bottom: 24px; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 800; color: #344054; }
textarea, input, button { width: 100%; border-radius: 14px; border: 1px solid #ccd4e0; padding: 13px 14px; font: inherit; background: white; }
textarea { min-height: 250px; resize: vertical; line-height: 1.45; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
textarea:focus, input:focus { outline: 3px solid rgba(36, 86, 246, 0.18); border-color: var(--accent); }
button { background: var(--accent); color: white; border: 0; font-weight: 900; cursor: pointer; transition: 0.15s ease; }
button:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.6; cursor: progress; }
button.secondary { background: #eef2ff; color: #1d3fb8; border: 1px solid #c7d2fe; }
button.secondary:hover { background: #dfe6ff; }
button.small { width: auto; padding: 10px 14px; }
.form-actions { display: grid; grid-template-columns: minmax(220px, 320px) 140px; gap: 12px; align-items: center; }
.hint { color: var(--muted); margin: 0; line-height: 1.45; }
code { background: #eef2ff; color: #3538cd; border-radius: 6px; padding: 1px 5px; font-size: 0.92em; }
.result-header-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; }
.result-header-row h2 { font-size: 32px; margin: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; background: #f8fafc; position: sticky; top: 0; }
td { color: #344054; line-height: 1.45; }
td:nth-child(1) { width: 42px; color: var(--muted); }
td:nth-child(2) { width: 120px; font-weight: 800; }
td:nth-child(3) { width: 250px; }
td:nth-child(4) { width: 120px; color: #111827; }
td:nth-child(5) { width: 140px; }
td:nth-child(6) { width: 120px; font-weight: 800; }
.confidence { display: inline-flex; align-items: center; white-space: nowrap; padding: 10px 14px; border-radius: 999px; font-weight: 900; background: #eef2ff; color: #3538cd; }
.confidence.mini { padding: 7px 10px; font-size: 13px; }
.confidence.high { background: #dcfae6; color: var(--good); }
.confidence.medium { background: #fef0c7; color: var(--warn); }
.confidence.low { background: #fee4e2; color: var(--bad); }
.hidden { display: none; }
.api-helper { border: 2px solid #fdb022; background: #fffbeb; }
.api-helper h2 { margin: 0 0 8px; }
.api-helper p { color: var(--muted); line-height: 1.5; }
.api-helper label { margin: 14px 0; }
@media (max-width: 860px) {
  .shell { width: min(100vw - 20px, 1180px); margin: 20px auto; }
  .form-actions, .result-header-row { grid-template-columns: 1fr; display: grid; }
  button.small { width: 100%; }
  .panel { padding: 18px; }
}
