:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #5c6880;
  --line: #d9dfeb;
  --accent: #315efb;
  --accent-soft: #e9efff;
  --danger: #a42828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 220px);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.page-shell {
  width: min(1100px, calc(100vw - 32px));
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(27, 39, 94, 0.08);
}

.auth-card {
  max-width: 420px;
  padding: 32px;
}

.page-shell {
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.hero h1,
.auth-card h1,
.panel h2 {
  margin: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lede,
.muted,
.panel-head p,
label {
  color: var(--muted);
}

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

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

.pill {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f3fa;
  color: #33415c;
  font-size: 13px;
}

.auth-form,
.query-form {
  display: grid;
  gap: 12px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button.secondary-button,
button.ghost-button {
  background: #eef2ff;
  color: var(--accent);
}

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

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff0f0;
  border: 1px solid #f0c9c9;
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f8faff;
}

.privacy-note {
  font-size: 14px;
}

.clarification-panel {
  border-color: #cfd9ff;
  background: #f7f9ff;
}

.clarification-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clarification-chip-form {
  margin: 0;
}

.clarification-chip {
  background: #e9efff;
  color: #2547b8;
  border: 1px solid #cfd9ff;
  border-radius: 999px;
  padding: 8px 12px;
}

.clarification-chip:hover {
  background: #dfe8ff;
}

.clarification-pill {
  background: #e9efff;
  color: #2547b8;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.spec-grid div {
  padding: 14px;
  border-radius: 14px;
  background: #f7f9fd;
  border: 1px solid #e6ebf5;
}

.spec-grid strong {
  display: block;
  margin-bottom: 6px;
}

.spec-grid span {
  color: var(--muted);
  word-break: break-word;
}

@media (max-width: 700px) {
  .hero,
  .panel-head {
    flex-direction: column;
  }

  .page-shell {
    width: min(100vw - 20px, 1100px);
    padding-top: 20px;
  }
}
