:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --panel: #ffffff;
  --ink: #1f2428;
  --muted: #6f7680;
  --line: #e6dfd6;
  --accent: #ec7a2f;
  --accent-soft: #fde6d2;
  --shadow: 0 10px 30px rgba(30, 24, 20, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 8% -10%, #f6e2c8 0%, rgba(246, 226, 200, 0) 60%),
    radial-gradient(700px 420px at 100% 0%, #dce7f2 0%, rgba(220, 231, 242, 0) 55%),
    var(--bg);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--muted);
}

h1 {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 600;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #c7c7c7;
}

.status-dot.ready {
  background: #32b36f;
}

.status-dot.error {
  background: #d84c4c;
}

.status-dot.loading {
  background: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

select {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(236, 122, 47, 0.25);
}

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table-wrap {
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #fbfaf8;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a4450f;
  font-size: 12px;
  font-weight: 600;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed rgba(31, 36, 40, 0.4);
}

a:hover {
  border-bottom-color: transparent;
}

.state {
  padding: 18px;
  border-radius: 16px;
  background: #fff3e7;
  color: #8a4d25;
  box-shadow: var(--shadow);
}

.state.hidden {
  display: none;
}

.state-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-meta {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app {
    padding: 24px 16px 32px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls {
    align-items: stretch;
  }

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

  table {
    min-width: 860px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 26px;
  }

  button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: stretch;
  }
}
