:root {
  --sb-bg: #0A0A0A;
  --sb-surface: #111111;
  --sb-button: #1D1D1D;
  --sb-button-hover: #262626;
  --sb-border: #222222;
  --sb-text-strong: #EDEDED;
  --sb-text: #A0A0A0;
  --sb-btc: #FF9900;
  --sb-green: #44FF00;
  --sb-yellow: #F6FF00;
  --sb-red: #FF4141;
  --sb-font: "Inter", "Inter Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sb-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--sb-bg);
  color: var(--sb-text);
  font-family: var(--sb-font);
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  font-feature-settings: "calt" 1, "kern" 1;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background-color: var(--sb-bg);
}

.header-inner {
  max-width: 1280px;
  min-height: 56px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--sb-text-strong);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.brand-wordmark {
  height: 20px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.footer-wordmark {
  height: 18px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-divider {
  color: var(--sb-border);
}

.brand-surface {
  font-size: 14px;
  color: var(--sb-text);
  transition: color 200ms ease;
}

.brand:hover .brand-surface {
  color: var(--sb-text-strong);
}

.env-tag {
  font-size: 12px;
  line-height: 16px;
  padding: 4px 10px;
  border: none;
  color: var(--sb-text);
  background-color: var(--sb-button);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.actor-meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.actor-meta-strong {
  color: var(--sb-text-strong);
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  color: var(--sb-text-strong);
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: var(--sb-text-strong);
  text-decoration: none;
  transition: color 200ms ease, opacity 200ms ease;
}

a:hover {
  opacity: 0.85;
}

.heading-with-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chain-mark {
  display: block;
  flex-shrink: 0;
}

.section {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--sb-border);
}

.section-first {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-sub {
  font-size: 14px;
  line-height: 18px;
  color: var(--sb-text);
  margin-top: 8px;
}

.meta-line {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--sb-mono);
  font-size: 13px;
  word-break: break-all;
}

.auth-shell {
  max-width: 460px;
  padding-top: 24px;
}

.auth-lead {
  margin-top: 10px;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 20px;
  color: var(--sb-text);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.field-hint {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  background-color: var(--sb-surface);
  border: 1px solid var(--sb-border);
  color: var(--sb-text-strong);
  font-family: var(--sb-font);
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  font-feature-settings: "calt" 1, "kern" 1;
  outline: none;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

input:focus,
select:focus {
  border-color: var(--sb-text-strong);
}

input::placeholder {
  color: #666666;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 18px;
  background-color: var(--sb-button);
  border: none;
  color: var(--sb-text-strong);
  font-family: var(--sb-font);
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  font-feature-settings: "calt" 1, "kern" 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}

button:hover:not(:disabled),
.btn:hover {
  background-color: var(--sb-button-hover);
  opacity: 1;
}

button:disabled {
  background-color: var(--sb-button);
  color: var(--sb-text);
  cursor: not-allowed;
}

.btn-ghost {
  background-color: var(--sb-button);
  border: none;
  color: var(--sb-text-strong);
  min-height: 32px;
  padding: 7px 13px;
  font-size: 12px;
  line-height: 16px;
}

.btn-confirm {
  background-color: var(--sb-button);
  border: none;
  color: var(--sb-text-strong);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--sb-border);
  border-bottom: 1px solid var(--sb-border);
  background-color: var(--sb-surface);
}

.kpi-cell {
  padding: 20px 20px;
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.kpi-value {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--sb-text-strong);
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
  font-variant-numeric: tabular-nums;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex-shrink: 0;
  background-color: var(--sb-text);
}

.dot-green {
  background-color: var(--sb-green);
}

.dot-yellow {
  background-color: var(--sb-yellow);
}

.dot-red {
  background-color: var(--sb-red);
}

.status-text-green {
  color: var(--sb-green);
}

.status-text-yellow {
  color: var(--sb-yellow);
}

.status-text-red {
  color: var(--sb-red);
}

.kv-list {
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  border-top: 1px solid var(--sb-border);
}

.kv-list dt,
.kv-list dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--sb-border);
}

.kv-list dt {
  font-size: 12px;
  line-height: 18px;
  color: var(--sb-text);
}

.kv-list dd {
  font-size: 14px;
  line-height: 18px;
  color: var(--sb-text-strong);
}

.controls-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.controls-inline .field {
  min-width: 140px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--sb-border);
  font-weight: 400;
}

.data-table th {
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.data-table td {
  font-size: 14px;
  line-height: 18px;
  color: var(--sb-text-strong);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  padding-right: 0;
  padding-left: 16px;
}

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

.setting-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.confirm-bar {
  padding: 16px;
  background-color: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-left: 2px solid var(--sb-yellow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-title {
  color: var(--sb-text-strong);
  font-size: 14px;
  line-height: 18px;
}

.confirm-diff {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

.confirm-diff-value {
  color: var(--sb-text-strong);
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  background-color: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-left: 2px solid var(--sb-text-strong);
  color: var(--sb-text-strong);
  font-size: 14px;
  line-height: 18px;
}

.notice-ok {
  border-left-color: var(--sb-green);
}

.notice-warn {
  border-left-color: var(--sb-yellow);
}

.notice-error {
  border-left-color: var(--sb-red);
}

.totp-block {
  padding: 16px;
  background-color: var(--sb-surface);
  border: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-value {
  padding: 10px 12px;
  background-color: var(--sb-bg);
  border: 1px solid var(--sb-border);
  color: var(--sb-text-strong);
  font-family: var(--sb-mono);
  font-size: 13px;
  line-height: 18px;
  word-break: break-all;
  user-select: all;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-footer {
  background-color: var(--sb-bg);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 16px;
  color: var(--sb-text);
}

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

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sb-text-strong);
}

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

  .kpi-cell {
    border-bottom: 1px solid var(--sb-border);
  }

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

  .kv-list {
    grid-template-columns: 1fr;
  }

  .kv-list dt {
    border-bottom: none;
    padding-bottom: 2px;
  }

  .kv-list dd {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 14px 16px;
  }

  .main-content {
    padding: 24px 16px 48px;
  }

  .footer-inner {
    padding: 20px 16px;
  }

  button,
  .btn,
  .btn-ghost {
    min-height: 44px;
  }

  .controls-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-inline .field {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 20px 14px 44px;
  }

  h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .brand-wordmark {
    height: 17px;
  }

  .footer-wordmark {
    height: 16px;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .kpi-cell {
    border-right: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
