:root {
  color-scheme: light;
  --paper: #f5f7f4;
  --surface: #fff;
  --ink: #1b2d24;
  --muted: #52645a;
  --line: #dce3dd;
  --accent: #216641;
  --accent-soft: #e7f1e9;
  --danger: #a32d31;
  --warn: #79510c;
  --warn-bg: #fff1d6;
  --focus: #216641;
  --radius: 8px;
  --space: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141c18;
  --surface: #1c2721;
  --ink: #e8f0e9;
  --muted: #afc0b4;
  --line: #3c4c41;
  --accent: #a0ddb4;
  --accent-soft: #273e2f;
  --danger: #ffaaaa;
  --warn: #f8d793;
  --warn-bg: #3f3421;
  --focus: #a0ddb4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141c18;
    --surface: #1c2721;
    --ink: #e8f0e9;
    --muted: #afc0b4;
    --line: #3c4c41;
    --accent: #a0ddb4;
    --accent-soft: #273e2f;
    --danger: #ffaaaa;
    --warn: #f8d793;
    --warn-bg: #3f3421;
    --focus: #a0ddb4;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: var(--accent-soft);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
:root[data-theme="dark"] button.primary {
  color: var(--paper);
}
button.primary:hover {
  filter: brightness(0.92);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection {
  background: var(--accent);
  color: var(--surface);
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  min-height: 40px;
  caret-color: var(--accent);
}
input::placeholder {
  color: var(--muted);
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 14px;
  font-weight: 600;
}
p {
  max-width: 75ch;
}
.muted {
  color: var(--muted);
}
.top {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 76px;
  padding: 0 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  gap: 9px;
  align-items: center;
  white-space: nowrap;
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
  align-items: center;
}
nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px;
}
nav button[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.account {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.account button {
  padding: 6px 10px;
}
.account span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 42px 36px 64px;
  min-height: calc(100vh - 150px);
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.title-row p {
  margin-top: 10px;
}
.actions {
  display: flex;
  gap: 8px;
}
.filters {
  display: grid;
  grid-template-columns:
    140px 140px minmax(130px, 1fr) minmax(130px, 1fr)
    minmax(130px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 26px;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.metric {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.metric > span {
  margin-right: 8px;
  color: var(--muted);
}
.metric button {
  font-size: 12px;
  padding: 7px 10px;
}
.metric button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 820px;
  text-align: left;
}
th,
td {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
thead th {
  background: var(--paper);
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
thead button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 2px;
}
thead button:hover {
  background: transparent;
  color: var(--accent);
}
th:first-child,
td:first-child {
  width: 35%;
  min-width: 220px;
}
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row-title {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.row-title:hover {
  color: var(--accent);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.subline {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  max-width: 420px;
}
.quality {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.quality.partial {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 3px 7px;
  border-radius: 4px;
}
.quality-cell {
  width: 110px;
}
.detail td {
  background: var(--paper);
  padding-top: 14px;
  padding-bottom: 20px;
}
.detail dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 16px;
  margin: 0;
}
.detail dt {
  color: var(--muted);
  font-size: 12px;
}
.detail dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.detail p {
  font-size: 12px;
  margin-top: 14px;
  color: var(--muted);
}
tfoot th,
tfoot td {
  font-weight: 600;
  background: var(--paper);
  border-bottom: 0;
}
.empty {
  padding: 54px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty p {
  margin: auto;
  color: var(--muted);
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
}
.pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pagination button {
  font-size: 12px;
}
.explanation {
  font-size: 12px;
  color: var(--muted);
  max-width: 100ch;
  margin-top: 28px;
}
.error {
  color: var(--danger);
  font-size: 13px;
  margin: 14px 0;
  min-height: 0;
}
.login-panel {
  max-width: 400px;
  margin: 9vh auto;
}
.login-panel h1 {
  font-size: 38px;
  line-height: 1.15;
}
.login-panel > p {
  margin-top: 18px;
}
.login-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 34px;
}
.login-panel form > button {
  margin-top: 6px;
}
.setup-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 60px;
}
.setup-grid p {
  margin: 12px 0;
}
.setup-grid form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 20px 0;
}
.setup-grid form label {
  flex: 1;
}
.instructions {
  border-left: 1px solid var(--line);
  padding-left: 36px;
}
.instructions ol {
  padding-left: 19px;
  color: var(--muted);
}
.instructions li {
  margin-bottom: 18px;
}
.instructions pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    monospace;
  color: var(--ink);
  background: var(--surface);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 12px 0;
}
.new-key {
  border: 1px solid var(--accent);
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.new-key code {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
  margin-bottom: 12px;
}
.settings-section + .settings-section {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.settings-form {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin: 22px 0;
}
.settings-form label {
  min-width: 180px;
  flex: 1;
}
.settings-form label:first-of-type {
  flex: 2;
}
.settings-list {
  border-top: 1px solid var(--line);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.setting-row strong {
  font-weight: 600;
}
.setting-row button {
  font-size: 12px;
}
.setting-row .badge {
  color: var(--muted);
  font-size: 12px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 36px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -60px;
  left: 10px;
  padding: 12px;
  background: var(--surface);
  z-index: 10;
}
.skip:focus {
  top: 10px;
}
.unknown {
  font-variant-numeric: tabular-nums;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
@media (max-width: 1150px) {
  .top {
    gap: 20px;
    padding: 0 24px;
  }
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }
  .filters button {
    justify-self: start;
  }
  main {
    padding: 30px 24px 50px;
  }
  th,
  td {
    padding: 15px;
  }
  .account span {
    display: none;
  }
}
@media (max-width: 700px) {
  .top {
    padding: 18px 18px 0;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 76px;
  }
  .brand {
    font-size: 17px;
  }
  .account {
    gap: 8px;
  }
  nav {
    order: 3;
    width: 100%;
    overflow: auto;
    padding-bottom: 8px;
    gap: 0;
  }
  nav button {
    font-size: 12px;
    padding: 10px;
  }
  main {
    padding: 28px 18px 42px;
  }
  .title-row {
    align-items: flex-start;
    gap: 18px;
    flex-direction: column;
    margin-bottom: 26px;
  }
  h1 {
    font-size: 28px;
  }
  .actions {
    align-self: stretch;
  }
  .actions > * {
    flex: 1;
    text-align: center;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .filters button {
    width: 100%;
    grid-column: 1/-1;
  }
  .metric {
    gap: 4px;
  }
  .metric > span {
    display: none;
  }
  .table-toolbar #snapshot {
    font-size: 11px;
  }
  .setup-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .instructions {
    border-left: 0;
    padding: 28px 0 0;
    border-top: 1px solid var(--line);
  }
  .setup-grid form {
    flex-wrap: wrap;
  }
  .detail dl {
    grid-template-columns: 1fr 1fr;
  }
  .settings-form {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-form label {
    min-width: 0;
  }
  .setting-row {
    flex-wrap: wrap;
  }
  .setting-row > div {
    flex-basis: 100%;
  }
  .pagination > span {
    max-width: 45%;
  }
  .pagination button {
    padding: 7px;
  }
  .pagination > div {
    gap: 8px;
  }
  footer {
    padding: 22px 18px;
    flex-direction: column;
    gap: 6px;
  }
  .login-panel {
    margin: 5vh auto;
  }
  .login-panel h1 {
    font-size: 34px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .metric button,
  .primary {
    transition:
      background-color 0.15s ease-out,
      color 0.15s ease-out;
  }
}

.filter-toggle {
  display: none;
}
@media (max-width: 700px) {
  .filter-toggle {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
  }
  .filters {
    display: none;
  }
  .filters.is-open {
    display: grid;
  }
  table {
    min-width: 680px;
  }
  th:first-child,
  td:first-child {
    width: 190px;
    min-width: 180px;
  }
  .detail dl,
  .detail p {
    width: min(100%, calc(100vw - 72px));
  }
  .detail dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row-title + .quality.partial {
    margin-left: 6px;
  }
}
