:root {
  color-scheme: light;
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-soft: #f2ece7;
  --ink: #18110f;
  --muted: #6f625c;
  --line: #e4dbd4;
  --orange: #f05a28;
  --orange-dark: #d95621;
  --green: #2e7d58;
  --red: #c9412f;
  --amber: #c65f1d;
  --black: #140d0b;
  --shadow: 0 16px 45px rgba(20, 31, 43, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  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;
  line-height: 1.45;
}

a {
  color: var(--orange-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
  white-space: nowrap;
}

button:hover {
  filter: brightness(0.98);
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

input:focus {
  border-color: rgba(240, 90, 40, 0.72);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.14);
  outline: 0;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 6% 95%, rgba(240, 90, 40, 0.32), transparent 22%),
    linear-gradient(120deg, #140d0b 0%, #23120d 56%, #0e0c0b 100%);
  color: #fff;
  border-bottom: 5px solid var(--orange);
}

.brand-block {
  min-width: 0;
}

.brand {
  color: #fff;
  display: inline-block;
  margin: 4px 0 6px;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand:hover {
  text-decoration: none;
}

.lead {
  margin: 0;
  color: #f2dfd4;
  max-width: 780px;
}

.eyebrow {
  margin: 0;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header .eyebrow {
  color: #ffb18e;
}

.nav {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius);
  background: #efe8e2;
  color: var(--ink);
  font-weight: 800;
  padding: 0 14px;
}

.nav a:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 34px) 48px;
}

.panel,
.answer,
.evidence,
.alert,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel,
.answer {
  padding: 18px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h1,
.section-heading h2 {
  margin: 4px 0 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-heading h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.section-heading h2 {
  font-size: 20px;
}

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

.section-head h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.ask-form {
  margin-top: 16px;
}

.ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.answer,
.evidence-list,
.table-panel {
  margin-top: 16px;
}

.answer p {
  margin: 0;
  color: #2a201c;
}

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

.evidence-list > h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.evidence {
  padding: 16px;
}

.evidence__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}

.evidence__number,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #4d5b66;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
}

.evidence__meta strong {
  color: var(--ink);
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff8f4;
  color: var(--orange-dark);
  font-weight: 800;
  margin-bottom: 10px;
  padding: 0 10px;
}

.source-link:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.evidence__text {
  margin: 0;
  color: #2a201c;
}

.sync-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.sync-form label {
  display: none;
}

.alert {
  border-left: 4px solid var(--red);
  box-shadow: none;
  color: #77201b;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.notice {
  border-left: 4px solid var(--green);
  box-shadow: none;
  color: #155c3e;
  margin-top: 12px;
  padding: 12px 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: #4d5b66;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fff8f4;
}

td strong {
  color: var(--ink);
}

td span,
td em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

td em {
  color: var(--red);
  font-style: normal;
}

.status {
  border: 1px solid var(--line);
  background: #fff;
}

.status--indexed {
  border-color: #b9dcc6;
  background: #edf8f2;
  color: var(--green);
}

.status--error {
  border-color: #f0b9b3;
  background: #fff0ef;
  color: var(--red);
}

.status--processing {
  border-color: #eccb8a;
  background: #fff4e7;
  color: var(--amber);
}

@media (max-width: 860px) {
  .app-header {
    display: block;
  }

  .nav {
    margin-top: 18px;
  }

  .ask-row,
  .sync-form {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
