:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #647084;
  --line: #dfe5ee;
  --blue: #2563eb;
  --green: #0f9f6e;
  --amber: #b7791f;
  --shadow: 0 16px 42px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

.subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.status-pill {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.query-panel,
.partner-strip,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.query-panel {
  display: grid;
  grid-template-columns: 170px 170px 120px;
  gap: 16px;
  align-items: end;
  padding: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.partner-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
}

.partner-strip[hidden] {
  display: none;
}

.partner-strip div {
  min-width: 0;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.partner-strip strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.message {
  min-height: 24px;
  margin: 14px 2px;
  color: var(--amber);
  font-size: 14px;
}

.delay-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.message.error {
  color: #c2410c;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px;
  margin: 8px 0 20px;
}

.metric {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: 30px;
  line-height: 1;
}

.metric.accent strong {
  color: var(--green);
}

.detail-section {
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  color: var(--text);
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .query-panel,
  .partner-strip,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
