:root {
  --font-inter:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: var(--surface-secondary);
}
.primary {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}
.primary:hover {
  opacity: 0.85;
  background: var(--foreground);
}
.danger {
  color: #fa87ae;
}
.quiet {
  border-color: transparent;
  background: transparent;
}
:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}
.navbar {
  min-height: 74px;
  padding: 0 max(24px, calc((100vw - 1100px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.navbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.navbar nav > a:not(.brand) {
  color: var(--muted);
  padding: 25px 0;
  position: relative;
}
.navbar nav > a[aria-current] {
  color: var(--foreground);
  font-weight: 600;
}
.navbar nav > a[aria-current]::after {
  content: '';
  position: absolute;
  height: 2px;
  background: var(--foreground);
  bottom: 0;
  left: 0;
  right: 0;
}
.brand {
  display: flex;
}
.brand img,
.auth-brand img {
  border-radius: var(--field-radius);
}
.account-menu {
  position: relative;
}
.account-menu summary {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}
.account-menu summary::-webkit-details-marker {
  display: none;
}
.avatar {
  display: block;
  border-radius: 50%;
  background: var(--default);
}
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  min-width: 140px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px #0005;
}
.account-dropdown button {
  width: 100%;
  justify-content: flex-start;
}
main {
  max-width: 1148px;
  margin: 48px auto;
  padding: 0 24px;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.6px;
  font-weight: 600;
  margin: 0;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}
p {
  margin: 8px 0 16px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.muted,
.hint {
  color: var(--muted);
}
.hint {
  font-size: 12px;
  margin: 12px 0 0;
}
.empty {
  text-align: center;
  padding: 60px 24px;
}
.empty p {
  max-width: 440px;
  margin: 8px auto 20px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-secondary);
}
th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--separator);
}
tr:last-child td {
  border-bottom: 0;
}
th:first-child {
  border-top-left-radius: var(--radius);
}
th:last-child {
  border-top-right-radius: var(--radius);
}
.filename {
  overflow-wrap: anywhere;
  min-width: 160px;
}
.nowrap {
  white-space: nowrap;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.create-key {
  padding: 24px;
  margin-bottom: 24px;
}
.key-form {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  margin-top: 20px;
}
.name-field {
  flex: 1;
}
label,
legend {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
}
input:not([type='checkbox']):not([type='radio']) {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--field-radius);
  background: var(--field-background);
  color: var(--field-foreground);
}
input::placeholder {
  color: var(--field-placeholder);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-height: 70px;
}
legend {
  padding: 0;
}
.permission-switch {
  display: flex;
  padding: 3px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.permission-switch label {
  position: relative;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
  white-space: nowrap;
}
.permission-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.permission-switch span {
  display: block;
  padding: 6px 10px;
  border-radius: var(--field-radius);
  color: var(--muted);
}
.permission-switch input:checked + span {
  background: var(--foreground);
  color: var(--background);
}
.permission-switch input:focus-visible + span {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}
.key-form > button {
  min-height: 40px;
}
.badges {
  display: flex;
  gap: 6px;
}
.badge {
  background: var(--default);
  border-radius: 4px;
  font-size: 12px;
  padding: 3px 8px;
}
code {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.notice {
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.error {
  color: #fa87ae;
  border-color: #854259;
}
.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input {
  font-family: monospace;
}
.auth-main {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 96px);
}
.auth {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  margin: auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 30px;
}
.auth h1 {
  font-size: 24px;
}
.stack {
  display: flex;
  flex-direction: column;
}
.stack label {
  margin-top: 16px;
}
.stack button {
  margin-top: 12px;
}
.stack .hint {
  margin-bottom: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 680px) {
  .navbar {
    padding: 0 16px;
    gap: 12px;
  }
  .navbar nav {
    gap: 18px;
  }
  main {
    padding: 0 16px;
    margin: 32px auto;
  }
  .key-form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .auth {
    padding: 24px;
  }
  th,
  td {
    padding: 14px;
  }
}

.inline-link {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 64px #0008;
}
#confirm-dialog::backdrop {
  background: #000a;
}
#confirm-dialog p {
  color: var(--muted);
  margin: 12px 0 24px;
}

.icon-button {
  width: 36px;
  padding: 8px;
  flex-shrink: 0;
}
.icon-button svg {
  display: block;
  width: 16px;
  height: 16px;
}

.actions-heading {
  text-align: right;
}

.account-status {
  max-width: 560px;
  margin: 80px auto;
  padding: 32px;
}
.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 24px;
  margin-bottom: 24px;
}
.overview strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}
select {
  min-height: 40px;
  font: inherit;
  color: var(--field-foreground);
  background: var(--field-background);
  border: 1px solid var(--border);
  border-radius: var(--field-radius);
  padding: 8px;
}
.admin-table {
  min-width: 900px;
}
.admin-table th {
  white-space: nowrap;
}
.admin-table td {
  vertical-align: middle;
}
.admin-table .admin-user {
  min-width: 200px;
  overflow-wrap: anywhere;
}
.admin-table select {
  width: 100%;
  min-width: 160px;
}
.admin-table input[type='number'] {
  min-width: 140px;
}
.admin-table button {
  min-height: 40px;
}
@media (max-width: 450px) {
  .overview {
    gap: 12px;
    padding: 20px 16px;
  }
  .overview strong {
    font-size: 20px;
  }
}
@media (max-width: 450px) {
  .navbar nav {
    gap: 10px;
  }
  .navbar {
    gap: 8px;
    padding: 0 12px;
  }
}

.auth-switch {
  margin: 24px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#0008, #0008), url('/assets/assets/auth.png') center / cover fixed;
}
.auth-page .auth-main {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.auth-footer {
  padding: 16px 24px 24px;
  text-align: center;
  font-size: 10px;
}
.auth-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-footer img {
  width: auto;
  height: 14px;
  max-width: 112px;
  object-fit: contain;
}
.cf-turnstile {
  margin-top: 20px;
  min-width: 0;
}
