:root {
  --page: #090d10;
  --page-soft: #11181d;
  --surface: #141b20;
  --surface-raised: #1b242b;
  --surface-muted: #10161a;
  --ink: #edf3f0;
  --muted: #91a19b;
  --line: #29353b;
  --line-strong: #3b4a52;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.13);
  --gold: #f59e0b;
  --blue: #60a5fa;
  --red: #f87171;
  --shadow: 0 24px 70px -42px rgba(0, 0, 0, 0.95);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 28rem),
    linear-gradient(145deg, #090d10 0%, #0f1417 48%, #14110d 100%);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 18px auto 28px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: clamp(78px, 8vw, 118px);
  height: clamp(78px, 8vw, 118px);
  flex: none;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.58));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(1.65rem, 3.3vw, 2.75rem);
  line-height: 1.08;
}

h2 {
  font-size: 1.05rem;
}

.source-pill {
  display: grid;
  gap: 2px;
  min-width: 148px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 27, 32, 0.82);
  text-align: right;
  box-shadow: var(--shadow);
}

.source-pill span,
.muted,
.field span,
.table-meta span {
  color: var(--muted);
}

.source-pill span,
.field span {
  font-size: 0.76rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.village-panel,
.content-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 27, 32, 0.96);
  box-shadow: var(--shadow);
}

.village-panel {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.panel-heading .eyebrow {
  margin: 0;
}

.village-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.village-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11181d;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.village-button:hover,
.village-button.is-active {
  border-color: rgba(45, 212, 191, 0.72);
  background: #132622;
}

.village-button:hover {
  transform: translateY(-1px);
}

.village-button span {
  display: grid;
  gap: 3px;
}

.village-button small {
  color: var(--muted);
  font-size: 0.76rem;
}

.village-button b {
  color: var(--accent);
  font-size: 1.16rem;
}

.content-panel {
  overflow: hidden;
}

.content-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.12), rgba(245, 158, 11, 0.08)),
    var(--surface);
}

.status {
  flex: none;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
  font-size: 0.82rem;
  font-weight: 800;
}

.status.is-error {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.summary-tile {
  min-height: 84px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  background: #12191e;
}

.summary-tile:last-child {
  border-right: 0;
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 210px) minmax(190px, 260px);
  gap: 12px;
  padding: 16px 20px 12px;
  background: var(--surface);
}

.field {
  display: grid;
  gap: 7px;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0e1418;
  color: var(--ink);
  outline: none;
}

.field input {
  padding: 0 12px;
}

.field select {
  padding: 0 34px 0 12px;
}

.field input::placeholder {
  color: #6f7f79;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 14px;
  background: var(--surface);
  font-size: 0.9rem;
}

.table-meta strong {
  color: #ffffff;
}

.table-wrap {
  max-height: 68vh;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #0d1215;
}

table {
  display: none;
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(45, 212, 191, 0.28);
  background: #111a1d;
  color: #dffcf7;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(41, 53, 59, 0.8);
  color: #dce7e2;
  font-size: 0.86rem;
  vertical-align: top;
}

tbody tr {
  background: #0f1518;
}

tbody tr:nth-child(odd) {
  background: #11191c;
}

tbody tr:hover {
  background: #172521;
}

.copy-cell {
  min-width: 150px;
}

.copy-cell,
.copy-cell .copy-value {
  white-space: nowrap;
}

.copy-cell {
  position: relative;
}

.copy-value {
  display: inline-block;
  padding-right: 58px;
}

.copy-button {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 46px;
  min-height: 26px;
  border: 1px solid rgba(45, 212, 191, 0.52);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: #a7fff4;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.copy-cell:hover .copy-button,
.copy-button:focus,
.copy-button.is-copied {
  opacity: 1;
}

.copy-button:hover,
.copy-button:focus {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.2);
  outline: none;
}

.copy-button.is-copied {
  border-color: rgba(245, 158, 11, 0.8);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .village-panel {
    position: static;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-tile:nth-child(3n) {
    border-right: 0;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1420px);
    margin-top: 12px;
  }

  .page-header,
  .content-top,
  .table-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
  }

  .source-pill {
    text-align: left;
  }

  .summary-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .summary-tile,
  .summary-tile:nth-child(3n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-tile:last-child {
    border-bottom: 0;
  }
}
