:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --line: #111111;
  --line-soft: #d8d8d8;
  --ink: #111111;
  --muted: #555555;
  --green: #0b6f3a;
  --amber: #8a5a00;
  --red: #b00020;
  --blue: #0645ad;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Arial, Helvetica, sans-serif;
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: var(--blue);
}

button,
input,
select {
  font: inherit;
}

code,
pre {
  min-width: 0;
  font-family: var(--mono);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 2px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

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

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

.nav-tabs {
  display: inline-flex;
  justify-self: center;
  border: 2px solid var(--line);
}

.nav-tab {
  min-width: 76px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.nav-tab:last-child {
  border-right: 0;
}

.nav-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--line);
  background: var(--amber);
}

.status-dot.is-online::before {
  background: var(--green);
}

.status-dot.is-error::before {
  background: var(--red);
}

main {
  width: min(1000px, calc(100% - 28px));
  margin: 0 auto;
  min-width: 0;
}

main > * {
  min-width: 0;
}

.home {
  min-height: 58vh;
  padding: 54px 0 42px;
  border-bottom: 2px solid var(--line);
}

.home > * + * {
  margin-top: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  width: 100%;
  max-width: 760px;
  margin-bottom: 0;
  font-size: 52px;
  line-height: 1.02;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.lead {
  width: 100%;
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.band {
  padding: 30px 0;
  border-bottom: 2px solid var(--line);
}

.section-head {
  margin-bottom: 16px;
}

.section-head p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.code-sample {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  margin: 0;
  padding: 14px;
  border: 2px solid var(--line);
  background: #111;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-sample code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.facts-table {
  width: 100%;
  max-width: 760px;
  table-layout: fixed;
}

.facts-table td {
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 2px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  width: 150px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

td:first-child {
  font-weight: 700;
}

.method {
  display: inline-block;
  min-width: 48px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.method.get {
  color: var(--green);
}

.method.post {
  color: var(--blue);
}

#pricing-cards {
  border: 2px solid var(--line);
}

.pricing-table {
  min-width: 680px;
}

.pricing-table td:nth-child(2),
.pricing-table td:nth-child(3) {
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}

.pricing-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.try-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
}

.search-panel,
.journal-panel {
  grid-column: 1;
}

.evidence-panel,
.access-panel {
  grid-column: 2;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.compact-field,
.field {
  display: grid;
  gap: 5px;
}

.compact-field span,
.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-field select,
.field input,
.field select,
.search-box input {
  width: 100%;
  min-height: 39px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.small-action {
  min-width: 52px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

tr.is-selected td {
  background: #eef7f1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.review {
  color: var(--amber);
  background: #fff8e8;
}

.badge.demo {
  color: var(--green);
  background: #eef7f1;
}

.evidence-list {
  display: grid;
  gap: 8px;
}

.evidence-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
}

.evidence-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--green);
  font-weight: 800;
}

.evidence-item strong {
  display: block;
  margin-bottom: 3px;
}

.evidence-item small {
  color: var(--muted);
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail-card {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line-soft);
}

.detail-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-card strong {
  display: block;
  margin-top: 4px;
  word-break: break-word;
}

.notice {
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.4;
}

.notice.ok {
  color: var(--green);
  background: #eef7f1;
}

.notice.error {
  color: var(--red);
  background: #fff1f1;
}

.journal-table {
  margin: 12px 0;
  border: 1px solid var(--line);
  overflow-x: auto;
}

.journal-row {
  display: grid;
  grid-template-columns: 48px 82px minmax(180px, 1fr) 82px 82px;
  min-width: 520px;
  border-bottom: 1px solid var(--line-soft);
}

.journal-row:last-child {
  border-bottom: 0;
}

.journal-row span {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px;
  border-right: 1px solid var(--line-soft);
  font-size: 13px;
}

.journal-row span:last-child {
  border-right: 0;
}

.journal-row span:nth-child(4),
.journal-row span:nth-child(5) {
  justify-content: flex-end;
  font-family: var(--mono);
}

.journal-head {
  background: var(--surface-soft);
  font-weight: 800;
}

.mini-stats {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--line-soft);
}

.mini-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.mini-stats dt {
  color: var(--muted);
}

.mini-stats dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

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

.settings-actions {
  display: flex;
  gap: 8px;
}

.settings-editor {
  display: grid;
  gap: 8px;
}

.tier-editor {
  display: grid;
  grid-template-columns: 1fr 110px 130px 1.4fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.tier-editor input {
  min-width: 0;
}

.boundary-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.footer {
  width: min(1000px, calc(100% - 28px));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .nav-tabs,
  .top-actions {
    justify-self: start;
  }

  .try-grid,
  .search-panel,
  .journal-panel,
  .evidence-panel,
  .access-panel {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .tier-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main,
  .footer {
    width: 320px;
    max-width: calc(100vw - 20px);
  }

  .topbar {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 10px;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .nav-tab {
    min-width: 72px;
  }

  .home {
    min-height: auto;
    padding: 36px 0 30px;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 16px;
  }

  .facts-table,
  .facts-table tbody,
  .facts-table tr,
  .facts-table th,
  .facts-table td {
    display: block;
    width: 100%;
  }

  .facts-table th {
    border-bottom: 0;
  }

  th,
  td {
    padding: 9px;
  }

  .panel-head,
  .search-row,
  .settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .footer {
    flex-direction: column;
  }
}
