:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #66717d;
  --line: #d9dfe5;
  --line-strong: #bcc6cf;
  --surface: #ffffff;
  --surface-soft: #f4f6f7;
  --canvas: #eef1f3;
  --green: #176b52;
  --green-soft: #e5f3ed;
  --blue: #1f5f92;
  --blue-soft: #e7f0f7;
  --amber: #8a5b00;
  --amber-soft: #fff3d6;
  --red: #a32f2f;
  --red-soft: #fbe9e9;
  --focus: #1174bd;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
.button {
  min-height: 38px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(17, 116, 189, 0.25);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.97);
}

.topbar-inner,
.footer-inner,
.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: white;
  background: var(--green);
  font-weight: 750;
  font-size: 17px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-actions form {
  margin: 0;
}

.environment,
.format-label {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.user-email {
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell {
  min-height: calc(100vh - 126px);
  padding: 34px 0 56px;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.page-heading h1 {
  margin: 2px 0 5px;
  font-size: 30px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.heading-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.heading-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-good {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.dataset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dataset-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 22px;
  background: var(--surface);
}

.dataset-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dataset-card h2 {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 1.25;
}

.dataset-card > p {
  min-height: 44px;
  margin: 12px 0 18px;
  color: var(--muted);
}

.freshness {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.freshness-good {
  color: var(--green);
  background: var(--green-soft);
}

.freshness-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.freshness-critical {
  color: var(--red);
  background: var(--red-soft);
}

.warning-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-left: 3px solid var(--amber);
  padding: 9px 11px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
}

.warning-summary span {
  color: #5d4a25;
  text-align: right;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: auto 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-row div {
  padding: 13px 8px;
  border-right: 1px solid var(--line);
}

.metric-row div:first-child {
  padding-left: 0;
}

.metric-row div:last-child {
  border-right: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  font-weight: 650;
}

.metric-row dd {
  font-size: 16px;
}

.dataset-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 17px;
}

.dataset-card-foot > span {
  color: var(--muted);
  font-size: 11px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

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

.button-primary {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.button-primary:hover {
  background: #105b45;
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.button-secondary:hover {
  border-color: #8f9ba6;
  background: var(--surface-soft);
}

.button-quiet {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.button-full {
  width: 100%;
}

.button-disabled {
  border-color: var(--line);
  color: #9ca5ad;
  background: var(--surface-soft);
  cursor: default;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs span:last-child {
  color: var(--ink);
}

.quality-band {
  margin-bottom: 18px;
  border: 1px solid #e4c16f;
  border-radius: 6px;
  padding: 17px 18px;
  color: #5a4414;
  background: var(--amber-soft);
}

.quality-band > div:first-child {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.quality-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--amber);
  font-weight: 800;
}

.quality-band h2 {
  margin: 1px 0 2px;
  font-size: 15px;
}

.quality-band p {
  margin: 0;
}

.quality-band details {
  margin: 12px 0 0 39px;
  border-top: 1px solid #e4c16f;
  padding-top: 10px;
}

.quality-band summary {
  width: max-content;
  cursor: pointer;
  font-weight: 650;
}

.measurement-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.measurement-list div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  font-size: 12px;
}

.metadata-band {
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

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

.metadata-grid div {
  min-width: 0;
  padding: 17px 19px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metadata-grid div:nth-child(3n) {
  border-right: 0;
}

.metadata-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.checksum {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 19px;
  color: var(--muted);
  font-size: 11px;
}

.checksum code {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.integrity {
  color: var(--green);
}

.source-status {
  margin-bottom: 18px;
  border-left: 3px solid var(--blue);
  padding: 14px 18px;
  background: var(--blue-soft);
}

.source-status h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.source-status dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.table-section {
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
}

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

.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.table-list {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.table-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 130px 24px;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  border-bottom: 1px solid var(--line);
  padding: 8px 15px;
  color: var(--ink);
}

.table-item:last-child {
  border-bottom: 0;
}

.table-item:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.table-name {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.table-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.table-arrow {
  color: var(--blue);
  font-size: 21px;
  text-align: right;
}

.compact-heading {
  margin-bottom: 18px;
}

.compact-heading h1 {
  overflow-wrap: anywhere;
  font-size: 25px;
}

.schema-strip {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 3px 1px 9px;
}

.schema-strip span {
  min-width: max-content;
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  background: var(--surface);
}

.schema-strip strong {
  font-size: 11px;
}

.schema-strip small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.filterbar {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) minmax(160px, 1fr) 90px auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface);
}

.filterbar label,
.login-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface);
}

input:hover,
select:hover {
  border-color: #8f9ba6;
}

.preview-panel {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.preview-summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 13px;
  color: var(--muted);
  font-size: 12px;
}

.table-scroll {
  max-height: 65vh;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  white-space: nowrap;
}

th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  background: #e8ecef;
  text-align: left;
}

th a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}

td {
  max-width: 360px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px 10px;
  text-overflow: ellipsis;
}

tbody tr:nth-child(even) td {
  background: #f9fafb;
}

tbody tr:hover td {
  background: var(--blue-soft);
}

th:last-child,
td:last-child {
  border-right: 0;
}

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

.empty-cell {
  height: 100px;
  color: var(--muted);
  text-align: center;
}

.pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
  background: #17212b;
}

.login-panel {
  width: min(100%, 420px);
  border: 1px solid #394652;
  border-radius: 8px;
  padding: 32px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark-large {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  font-size: 22px;
}

.login-product {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

.login-lead {
  margin: 25px 0 17px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form .button {
  margin-top: 4px;
}

.login-foot {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.alert {
  margin-bottom: 14px;
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 12px;
}

.alert-critical {
  border: 1px solid #e5b4b4;
  color: var(--red);
  background: var(--red-soft);
}

.error-panel {
  width: min(100%, 580px);
  margin: 9vh auto 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 28px;
  background: var(--surface);
}

.error-panel h1 {
  margin: 5px 0;
  font-size: 22px;
}

.error-panel p {
  margin: 0 0 20px;
  color: var(--muted);
}

.error-code {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

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

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

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

  .metadata-grid div,
  .metadata-grid div:nth-child(3n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metadata-grid div:nth-child(2n) {
    border-right: 0;
  }

  .metadata-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .source-status dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar-inner,
  .footer-inner,
  .shell {
    width: min(100% - 24px, 1440px);
  }

  .topbar-inner {
    min-height: 58px;
  }

  .brand small,
  .user-email,
  .environment {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .shell {
    padding-top: 22px;
  }

  .page-heading,
  .dataset-card-head,
  .dataset-card-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .heading-status {
    padding: 0;
  }

  .dataset-card > p {
    min-height: 0;
  }

  .warning-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .warning-summary span {
    text-align: left;
  }

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

  .metadata-grid div,
  .metadata-grid div:nth-child(2n),
  .metadata-grid div:nth-child(3n),
  .metadata-grid div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metadata-grid div:last-child {
    border-bottom: 0;
  }

  .checksum {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .source-status dl {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .table-item {
    grid-template-columns: minmax(0, 1fr) 80px 18px;
  }

  .table-item .table-meta:first-of-type {
    display: none;
  }

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

  .measurement-list div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .login-panel {
    padding: 25px 21px;
  }

  .footer-inner {
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }
}
