:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #fff;
  --surface-2: #f1f4f5;
  --text: #22272a;
  --muted: #687277;
  --line: #e2e7e9;
  --accent: #111415;
  --on-accent: #fff;
  --shadow: 0 18px 46px #14202020;
  --radius: 10px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171a1b;
  --surface: #202425;
  --surface-2: #252a2c;
  --text: #f2f5f5;
  --muted: #a0aaae;
  --line: #353b3d;
  --accent: #f5f7f8;
  --on-accent: #151819;
  --shadow: 0 18px 46px #0006;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.skip-link {
  position: fixed;
  left: 80px;
  top: -50px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.sidebar {
  position: fixed;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 50px;
  border-radius: 14px;
  z-index: 20;
  display: flex;
  overflow: clip;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 24px #0001;
  transition: width 180ms ease;
}
.sidebar:hover,
.sidebar:focus-within,
.sidebar.open {
  width: 264px;
  box-shadow: var(--shadow);
}
.rail {
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  flex-direction: column;
  background: var(--accent);
  color: var(--on-accent);
  padding: 20px 0;
}
.logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}
.logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(1) brightness(0) invert(1);
}
html[data-theme="dark"] .logo img {
  filter: grayscale(1) brightness(0);
}
.rail-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}
.rail button {
  color: inherit;
  width: 34px;
  height: 34px;
  font-size: 21px;
  border-radius: 8px;
}
.rail button:hover,
.rail button.selected {
  background: color-mix(in srgb, var(--on-accent) 18%, transparent);
}
.rail-bottom {
  margin-top: auto;
}
.sidebar-panel {
  width: 214px;
  flex: 0 0 214px;
  display: flex;
  flex-direction: column;
  padding: 18px 10px;
  visibility: hidden;
}
.sidebar:hover .sidebar-panel,
.sidebar:focus-within .sidebar-panel,
.sidebar.open .sidebar-panel {
  visibility: visible;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px 28px;
}
.wordmark {
  font-size: 30px;
  font-weight: 640;
  letter-spacing: -0.065em;
  line-height: 1;
  color: var(--accent);
}
.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 17px;
}
.icon-button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-title {
  font-size: 9px;
  letter-spacing: 0.1em;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 9px 9px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0;
}
.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-link[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: auto;
  display: grid;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom > * {
  text-align: left;
  padding: 7px 9px;
}
.sidebar-bottom span {
  font-weight: 600;
  color: var(--text);
}
#mobile-menu {
  display: none;
}
main {
  margin-left: 70px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  font-size: 11px;
  color: var(--muted);
}
.topbar-right {
  display: flex;
  gap: 16px;
  align-items: center;
}
.environment {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
}
#content {
  padding: 30px;
  flex: 1;
  outline: none;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--muted);
}
h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.045em;
  margin: 7px 0 8px;
}
h2 {
  font-size: 16px;
  font-weight: 620;
  margin: 0;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 13px;
  margin: 0;
}
p {
  line-height: 1.65;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface);
  min-height: 34px;
}
.button:hover {
  background: var(--surface-2);
}
.button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.button.primary:hover {
  opacity: 0.85;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric-label {
  color: var(--muted);
  font-size: 11px;
}
.metric strong {
  display: block;
  font-size: 27px;
  letter-spacing: -0.05em;
  font-weight: 650;
  margin: 13px 0 8px;
}
.metric small {
  font-size: 10px;
  color: var(--muted);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.card-heading {
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.search {
  min-width: 160px;
  max-width: 300px;
  flex: 1;
}
.toolbar .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.input,
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  padding: 9px 11px;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
select {
  padding-right: 26px;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px 17px;
}
td {
  padding: 15px 17px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
td.wrap {
  white-space: normal;
  min-width: 220px;
  max-width: 430px;
}
td strong {
  font-weight: 620;
  font-size: 12px;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.row-action {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 10px;
  color: var(--text);
}
.row-action:hover {
  background: var(--surface-2);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 9px;
}
.badge::before {
  content: "";
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}
.badge.good {
  color: #287850;
}
.badge.warn {
  color: #986900;
}
html[data-theme="dark"] .badge.good {
  color: #85d5a7;
}
html[data-theme="dark"] .badge.warn {
  color: #e9c178;
}
.pagination {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.pagination .actions {
  gap: 14px;
}
.empty {
  padding: 58px 24px;
  text-align: center;
  white-space: normal;
  color: var(--muted);
}
.empty .empty-icon {
  display: block;
  font-size: 30px;
  opacity: 0.5;
  margin-bottom: 16px;
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.empty p {
  font-size: 12px;
  max-width: 390px;
  margin: 10px auto 18px;
}
.error {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.error p {
  color: var(--muted);
}
.columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
.stack {
  display: grid;
  gap: 18px;
}
.chart {
  width: 100%;
  height: 160px;
  display: block;
  padding: 18px;
}
.chart rect {
  fill: var(--accent);
}
.chart-note {
  font-size: 10px;
  color: var(--muted);
  padding: 0 20px 15px;
}
.note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 16px;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  margin: 0 30px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 11px;
}
.field.full {
  grid-column: 1/-1;
}
.field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.field label {
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
.form-section {
  border-bottom: 1px solid var(--line);
  padding: 0 0 20px;
  margin-bottom: 20px;
}
.form-section > h3 {
  margin: 0 0 16px;
}
.form-actions {
  position: sticky;
  bottom: -24px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin: 22px -24px -24px;
  padding: 16px 24px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.form-error {
  font-size: 12px;
  color: #b64b4b;
  line-height: 1.6;
}
.form-error:empty {
  display: none;
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(740px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #0a101866;
  backdrop-filter: blur(3px);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.panel-head h2 {
  font-size: 20px;
  margin-top: 7px;
}
#panel-body {
  padding: 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.detail-grid dt {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.timeline li {
  border-left: 1px solid var(--line);
  padding: 0 0 20px 20px;
  position: relative;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 5px 0;
}
.preview {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
}
.preview h1 {
  font-size: 29px;
}
.preview-body {
  white-space: pre-wrap;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  width: min(390px, 100%);
  padding: 35px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.login-card h1 {
  font-size: 23px;
  margin-top: 30px;
}
.login-card p {
  color: var(--muted);
  font-size: 12px;
}
.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}
.login-card .button {
  margin-top: 6px;
}
.login-foot {
  font-size: 10px;
  text-align: center;
  margin-top: 25px;
  color: var(--muted);
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow);
  padding: 13px 18px;
  font-size: 12px;
  max-width: calc(100vw - 44px);
}
.article-select {
  display: grid;
  gap: 10px;
}
.section-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.section-tabs button {
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.section-tabs button.active {
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}
.muted {
  color: var(--muted);
}
@media (min-width: 1600px) {
  #content {
    max-width: 1600px;
    width: 100%;
    margin: auto;
  }
}
@media (max-width: 1050px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px), (pointer: coarse) {
  .sidebar {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: auto;
    width: auto;
    height: 50px;
    overflow: visible;
  }
  .sidebar:hover,
  .sidebar:focus-within,
  .sidebar.open {
    width: auto;
  }
  .rail {
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 12px;
  }
  .rail-nav {
    display: none;
  }
  .rail-bottom {
    margin: 0;
  }
  #mobile-menu {
    display: block;
    margin-left: auto;
    margin-right: 8px;
  }
  .sidebar-panel {
    display: none;
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    width: auto;
    max-height: calc(100dvh - 80px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .sidebar.open .sidebar-panel {
    display: flex;
    visibility: visible;
  }
  .sidebar-top {
    padding-bottom: 10px;
  }
  .sidebar-bottom {
    margin-top: 15px;
  }
  main {
    margin-left: 0;
    padding-top: 66px;
  }
  .topbar {
    height: 50px;
    padding: 0 16px;
  }
  .topbar-right {
    gap: 8px;
  }
  #content {
    padding: 20px 14px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 25px;
  }
  .page-head p {
    max-width: 320px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 15px;
  }
  .metric strong {
    font-size: 24px;
  }
  .toolbar {
    padding: 12px;
    gap: 8px;
  }
  .toolbar .search {
    max-width: none;
    min-width: 100%;
    width: 100%;
  }
  .toolbar select {
    flex: 1;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .app-footer {
    margin: 0 14px;
  }
  .app-footer span {
    display: none;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .button,
  .row-action {
    min-height: 42px;
  }
  .panel-head {
    padding: 17px;
  }
  #panel-body {
    padding: 18px;
  }
  .form-actions {
    margin: 20px -18px -18px;
    padding: 14px 18px;
    bottom: -18px;
  }
  .card-heading {
    padding: 16px;
  }
  dialog {
    max-height: calc(100dvh - 16px);
  }
  .form-grid {
    gap: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.preview-body {
  white-space: normal;
}
.preview-body table {
  white-space: normal;
}
.preview-body pre {
  overflow: auto;
}
.preview-body h2,
.preview-body h3 {
  margin: 24px 0 12px;
}
.account-body {
  padding: 24px;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 24px;
  font-weight: 650;
  border-radius: 50%;
  margin: 0 0 24px;
}
.account-body .detail-grid {
  margin: 0;
}
.account-body .note {
  margin: 0;
}
