:root {
  color-scheme: light dark;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #eef3ed;
  --text: #17201d;
  --muted: #66726d;
  --border: #d8dfd8;
  --accent: #167c6a;
  --accent-strong: #0f5d52;
  --warning: #9a6200;
  --danger: #9a3329;
  --shadow: 0 12px 30px rgba(22, 32, 29, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513;
    --surface: #181f1c;
    --surface-soft: #202a26;
    --text: #eef4ef;
    --muted: #a6b2ac;
    --border: #33403a;
    --accent: #45b79e;
    --accent-strong: #68d6bf;
    --warning: #e0ac45;
    --danger: #ee8b80;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: 0;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.index-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

input,
select {
  font: inherit;
}

.detail-pane {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { align-items: start; flex-direction: column; }
  .index-pane { border-right: 0; border-bottom: 1px solid var(--border); }
  .detail-pane { overflow: visible; }
}
@media (max-width: 560px) {
  .topbar, .detail-pane { padding-left: 16px; padding-right: 16px; }
}
