:root {
  color-scheme: light;
  font-family: "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #26342e;
  background: #f4f3ee;
  font-synthesis: none;
  --bg: #f4f3ee;
  --sidebar: #202c26;
  --panel: #fffefa;
  --border: #d9ddd5;
  --text: #26342e;
  --muted: #667269;
  --accent: #244c3a;
  --green: #2f694d;
  --red: #9b3434;
  --ochre: #8f6128;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.role-badge {
  color: var(--muted);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
}

.account-card {
  max-width: 760px;
}

.upload-progress {
  width: 100%;
  height: 14px;
  accent-color: var(--accent);
}

.hash-value {
  max-width: 210px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.node-summary {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.node-summary:last-child {
  border-bottom: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

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

a:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: #fffefa;
  accent-color: var(--accent);
}

textarea {
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #244c3a1c;
}

button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid #a97835;
  outline-offset: 2px;
}

label,
legend {
  display: block;
  margin: 0 0 7px;
  color: #49584e;
  font-size: 12px;
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

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

h1 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.7px;
}

h2 {
  font-size: 18px;
  letter-spacing: -.3px;
}

h3 {
  font-size: 15px;
}

p {
  line-height: 1.55;
}

code {
  font-family: ui-monospace, Consolas, monospace;
}

::selection {
  color: #173e2b;
  background: #d9e5d8;
}

.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;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.fineprint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.spaced {
  margin-top: 16px;
}

.no-margin {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.shell[hidden],
.login-page[hidden],
.boot-page[hidden],
.sidebar-scrim[hidden],
.login-error[hidden] {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  padding: 28px 14px 20px;
  overflow-y: auto;
  border-right: 1px solid #202c26;
  background: var(--sidebar);
  color-scheme: dark;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 28px;
  color: #f0eadc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -.7px;
}

.brand b {
  display: block;
  margin-top: 6px;
  font-family: "Segoe UI", ui-sans-serif, sans-serif;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 3.2px;
  text-transform: uppercase;
}

.brand-symbol {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.sidebar-subtitle,
.nav-heading {
  padding: 7px 13px 12px;
  color: #9caca0;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-heading {
  padding-top: 25px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 13px;
  gap: 12px;
  border: 0;
  border-radius: 4px;
  color: #c3cdc4;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.nav-item:hover {
  color: white;
  background: #2a3930;
}

.nav-item.active {
  color: #fffefa;
  background: #344a3c;
  box-shadow: inset 2px 0 #d4b27d;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 19px;
  color: #a7b6a9;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 19px 12px 0;
  border-top: 1px solid #405044;
}

.sidebar-footer .muted {
  color: #a7b6a9;
}

.server-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #d4ddd3;
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bfd0ad;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 73px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: #fffefa;
}

.breadcrumbs {
  color: #717c72;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
}

.breadcrumbs strong {
  color: var(--text);
  font-weight: 700;
}

.sep {
  padding: 0 12px;
  color: #a0a99d;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-email {
  color: #59685d;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.subtle-button,
.icon-button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #3d5041;
  background: #f6f6f0;
}

.subtle-button:hover,
.icon-button:hover {
  background: #ecefe6;
}

.menu-button,
.menu-close,
.sidebar-scrim {
  display: none;
}

.main-content {
  max-width: 1510px;
  margin: auto;
  padding: 37px 40px 80px;
  outline: none;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.page-intro p {
  max-width: 680px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--ochre);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.card {
  padding: 22px;
  border-right: 1px solid var(--border);
}

.card:last-child {
  border-right: 0;
}

.card-label {
  margin-bottom: 16px;
  color: #5b6a5e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}

.card-number {
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -.9px;
  font-variant-numeric: tabular-nums;
}

.card-caption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  margin-bottom: 20px;
  padding: 23px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 0;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 18px;
}

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

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  min-width: 0;
}

.check-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #49584e;
  font-size: 12px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  min-height: auto;
  flex: 0 0 auto;
}

.permission-group {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.permission-group legend {
  padding: 0 5px;
}

.direct-search {
  max-width: 360px;
}

.btn-row,
.detail-actions,
.pill-row,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-row {
  margin-top: 19px;
}

.table-actions {
  gap: 14px;
}

.primary,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

a.primary:hover,
a.secondary:hover {
  text-decoration: none;
}

.primary {
  color: white;
  background: var(--accent);
}

.primary:hover {
  background: #356149;
}

.secondary {
  border-color: #c9d2c5;
  color: #354b3c;
  background: #f5f6ef;
}

.secondary:hover {
  background: #e7ece1;
}

.danger {
  border-color: #d4b4a9;
  color: #8d3330;
  background: #fff0e9;
}

.danger:hover {
  background: #f5dfd5;
}

.full {
  width: 100%;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  border-radius: 3px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
  font-size: 12px;
}

.table th {
  padding: 13px 12px;
  color: #5b685c;
  background: #f0f2e9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.table td {
  max-width: 420px;
  padding: 15px 12px;
  border-bottom: 1px solid #e2e5dc;
  color: #465548;
  overflow-wrap: anywhere;
}

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

.table tbody tr:hover {
  background: #f6f7f0;
}

.table .strong {
  color: #243b2d;
  font-weight: 700;
}

.hash {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.action-link {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-weight: 700;
}

.action-link:hover {
  text-decoration: underline;
}

.danger-link {
  color: var(--red);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 53px 16px;
  text-align: center;
}

.empty-icon {
  margin-bottom: 16px;
  color: #8c9a7d;
  font-size: 35px;
}

.empty h3 {
  margin-bottom: 5px;
}

.empty p {
  max-width: 390px;
  color: var(--muted);
  font-size: 12px;
}

.code {
  display: block;
  padding: 17px;
  overflow: auto;
  border: 1px solid #c7d2bf;
  border-radius: 4px;
  color: #314b36;
  background: #f0f4ea;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.kv-item {
  min-width: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}

.kv-item span {
  display: block;
  margin-bottom: 8px;
  color: #6b766a;
  font-size: 11px;
}

.kv-item strong {
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.notice {
  padding: 14px 17px;
  border: 1px solid #c7d2bf;
  border-left: 3px solid #879d78;
  border-radius: 4px;
  color: #40543c;
  background: #edf3e7;
  font-size: 12px;
  line-height: 1.65;
}

.notice.warn {
  border-color: #dcc79f;
  border-left-color: #a97835;
  color: #77501f;
  background: #fff6e4;
}

.notice-detail {
  margin-top: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d2d9ce;
  border-radius: 4px;
  color: #5c6e58;
  background: #f0f3eb;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.green {
  border-color: #b5cbb4;
  color: #2e6141;
  background: #eaf2e4;
}

.status-pill.red {
  border-color: #d4b7ae;
  color: #953c35;
  background: #fff0e9;
}

.pill {
  padding: 6px 9px;
  border: 1px solid #dce1d4;
  border-radius: 4px;
  color: #54684d;
  background: #f0f3e9;
  font-size: 11px;
  font-weight: 650;
}

.login-page,
.boot-page {
  display: grid;
  min-height: 100vh;
  padding: 40px 24px;
  place-items: center;
  background: var(--bg);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  width: min(100%, 960px);
  overflow: hidden;
  border: 1px solid #d2d7cb;
  border-radius: 8px;
  box-shadow: 0 15px 45px #202c260b;
}

.login-context {
  display: flex;
  flex-direction: column;
  min-height: 555px;
  padding: 42px;
  color: #f0eadc;
  background: var(--sidebar);
}

.login-index {
  margin-top: 46px;
  color: #c6ad7f;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
}

.login-statement {
  margin: 19px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.5vw, 39px);
  line-height: 1.2;
  letter-spacing: -.9px;
}

.login-description {
  max-width: 300px;
  margin-bottom: 37px;
  color: #b8c5b9;
  font-size: 13px;
  line-height: 1.75;
}

.login-reference {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #53624e;
  color: #b4c1ae;
  font-size: 9px;
  letter-spacing: 1px;
}

.login-card {
  width: 100%;
  align-self: stretch;
  padding: 61px 42px 42px;
  background: var(--panel);
}

.login-card h1 {
  font-size: 29px;
}

.brand-login {
  margin: 0;
  font-size: 35px;
}

.login-card > p {
  font-size: 13px;
}

.login-card form {
  margin-top: 28px;
}

.login-card label {
  margin-top: 19px;
}

.login-card .primary {
  margin-top: 27px;
}

.login-card .fineprint {
  margin-top: 25px;
}

.login-error {
  margin-top: 20px;
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  color: white;
  background: var(--sidebar);
  text-align: center;
}

#toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: none;
  max-width: min(410px, calc(100vw - 36px));
  padding: 13px 18px;
  border: 1px solid #718769;
  border-radius: 5px;
  color: #fffefa;
  background: #2e4d35;
  box-shadow: 0 8px 25px #202c2626;
  font-size: 13px;
}

#toast.show {
  display: block;
}

#toast.error {
  border-color: #b9785c;
  background: #7f392e;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  padding: 18px;
  place-items: center;
  background: #202c26a6;
}

.dialog {
  position: relative;
  width: min(100%, 650px);
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
  border: 1px solid #c8d2be;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 25px 80px #202c264d;
}

.dialog > h2 {
  padding-right: 42px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #f0f3e9;
  font-size: 22px;
}

.dialog .code {
  max-height: 240px;
}

.secret-value {
  font-family: ui-monospace, Consolas, monospace;
  overflow-wrap: anywhere;
}

.clipboard-helper {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.loading {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card:nth-child(2n) {
    border-right: 0;
  }

  .card:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }

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

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

  .main-content {
    padding: 25px;
  }

  .topbar {
    padding: 0 25px;
  }
}

@media (max-width: 760px) {
  body.menu-open {
    overflow: hidden;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 15;
    width: min(290px, 86vw);
    transform: translateX(-110%);
    transition: transform .2s ease;
    box-shadow: 15px 0 50px #202c264d;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-close {
    display: inline-grid;
    flex: 0 0 auto;
    width: 40px;
    padding: 0;
    place-items: center;
    font-size: 22px;
    border-color: #61765c;
    color: #f0eadc;
    background: #344a3c;
  }

  .sidebar-scrim:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 14;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #202c267f;
  }

  .topbar {
    min-height: 65px;
    padding: 0 16px;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
  }

  .breadcrumbs {
    margin-right: auto;
  }

  .breadcrumbs > span:first-child,
  .breadcrumbs .sep,
  .admin-email {
    display: none;
  }

  .header-right {
    gap: 8px;
  }

  .main-content {
    padding: 24px 15px 70px;
  }

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

  .card {
    padding: 17px;
  }

  .card-number {
    font-size: 21px;
  }

  .grid-2,
  .grid-3,
  .kv,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-intro {
    display: block;
  }

  .page-intro > .primary,
  .page-intro > .secondary,
  .page-intro > .btn-row,
  .page-intro > .detail-actions {
    margin-top: 15px;
  }

  .panel {
    padding: 17px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .panel-head .detail-actions,
  .panel-head .pill-row {
    width: 100%;
  }

  .login-page {
    padding: 24px 15px;
  }

  .login-layout {
    max-width: 460px;
    grid-template-columns: 1fr;
  }

  .login-context {
    min-height: 0;
    padding: 26px;
  }

  .login-index {
    margin-top: 29px;
  }

  .login-statement {
    margin-bottom: 0;
    font-size: 29px;
  }

  .login-description,
  .login-reference {
    display: none;
  }

  .login-card {
    padding: 30px 26px 23px;
  }

  .dialog {
    padding: 24px 19px;
  }

  .direct-search {
    max-width: none;
  }

  .btn-row > .primary,
  .btn-row > .secondary,
  .btn-row > .danger {
    flex-grow: 1;
  }
}

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

  .card {
    border-right: 0;
  }

  .card + .card {
    border-top: 1px solid var(--border);
  }

  .breadcrumbs {
    font-size: 11px;
  }

  .header-right .role-badge {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
