:root {
  color: #20262d;
  background: #f4f6f8;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  --ink: #20262d;
  --muted: #66727e;
  --line: #d9e0e6;
  --surface: #fff;
  --nav: #18222c;
  --nav-muted: #aeb9c3;
  --primary: #1769aa;
  --primary-dark: #115487;
  --success: #14745e;
  --danger: #b42318;
}
.local-ads-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.local-ad-card { border:1px solid var(--line); border-radius:8px; padding:16px; background:var(--surface); }
.local-ad-card h4 { margin:0 0 12px; }
.local-ad-card img { display:block; width:100%; height:120px; object-fit:contain; background:#f4f6f8; margin-bottom:12px; }
.local-ad-empty { height:120px; display:grid; place-items:center; color:var(--muted); background:#f4f6f8; margin:0 0 12px; }
@media (max-width:800px) { .local-ads-grid { grid-template-columns:1fr; } }
* {
  box-sizing: border-box;
}
body {
  min-width: 320px;
  margin: 0;
  background: #f4f6f8;
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.compact-number {
  width: 104px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}
[hidden] {
  display: none !important;
}
.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #f4f6f8;
  z-index: 20;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d6dde4;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  color: #17202a;
  background: #eaf0f8;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans CJK SC", sans-serif;
}
.login-layout {
  width: min(1320px, 100%);
  min-height: min(760px, calc(100svh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #cfd9e7;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(31, 52, 87, 0.18);
}
.login-intro {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  align-content: center;
  gap: 26px;
  padding: 54px 48px 36px;
  overflow: hidden;
  color: #293542;
  background: #f4f5f7;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-brand > div {
  min-width: 0;
}
.login-brand h1 {
  max-width: 100%;
  margin: 0;
  color: #1688ff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.login-intro-copy {
  padding-top: 30px;
}
.login-intro-copy h2 {
  max-width: 620px;
  margin: 0;
  color: #1688ff;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.35;
}
.login-intro-copy p {
  margin: 10px 0 0;
  color: #263341;
  font-size: 16px;
  line-height: 1.7;
}
.login-capability-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  color: #6e7f98;
  font-size: 15px;
  list-style: none;
}
.login-capability-list li {
  position: relative;
  padding-left: 20px;
}
.login-capability-list li::before {
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px;
  height: 5px;
  background: #78838f;
  border-radius: 50%;
  content: "";
}
.intro-login-button {
  width: 160px;
  height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #1688ff;
  font-size: 15px;
  font-weight: 600;
}
.intro-login-button:hover {
  background: #0875e8;
}
.intro-login-button:focus-visible {
  outline: 3px solid rgba(22, 136, 255, 0.22);
  outline-offset: 3px;
}
.login-intro footer {
  align-self: end;
  color: #a3acb8;
  font-size: 11px;
}
.auth-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 34px clamp(34px, 5vw, 68px) 28px;
  overflow-y: auto;
  color: #263341;
  background: #fff;
}
.auth-workspace-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #536271;
  font-size: 13px;
  font-weight: 400;
}
.login-panel {
  width: min(100%, 430px);
  align-self: center;
  justify-self: center;
  padding: 34px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-panel .auth-section-label {
  margin: 0 0 9px;
  color: #2457df;
  font-size: 12px;
  font-weight: 500;
}
.login-panel h2 {
  margin: 0;
  color: #17202a;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
}
.login-panel .auth-caption {
  margin: 10px 0 28px;
  color: #7a8794;
  font-size: 13px;
  line-height: 1.6;
}
.auth-fields {
  min-width: 0;
}
.eyebrow {
  margin: 0;
  color: #72808c;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-panel label,
.settings-panel label,
dialog label {
  display: grid;
  gap: 7px;
  color: #394550;
  font-size: 13px;
  font-weight: 600;
}
.login-panel input,
.settings-panel input,
.settings-panel select,
.settings-panel textarea,
dialog input,
dialog select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  outline: none;
}
.login-panel .auth-fields label {
  margin: 16px 0 7px;
  color: #43515f;
  font-size: 13px;
  font-weight: 400;
}
.login-panel .auth-fields label:first-child {
  margin-top: 0;
}
.auth-panel input[type="text"],
.auth-panel input[type="password"] {
  height: 48px;
  min-width: 0;
  padding: 0 13px;
  border-radius: 3px;
  font-size: 14px;
}
.auth-panel input::placeholder {
  color: #a0aab5;
}
.login-panel input[readonly] {
  color: #53606b;
  background: #f3f5f7;
}
.settings-panel textarea {
  resize: vertical;
}
.login-panel input:focus,
.settings-panel input:focus,
.settings-panel select:focus,
.settings-panel textarea:focus,
dialog input:focus,
dialog select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 105, 170, 0.12);
}
.primary,
.secondary,
.logout,
.nav-item,
.settings-tab,
.icon-button {
  border: 0;
  border-radius: 4px;
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 650;
}
.primary {
  color: #fff;
  background: var(--primary);
}
.primary:hover {
  background: var(--primary-dark);
}
.secondary {
  color: #26323d;
  background: #fff;
  border: 1px solid #cbd4dc;
}
.login-panel .primary {
  width: 100%;
}
.auth-panel .form-error {
  margin: 13px 0 0;
  padding: 9px 11px;
  color: #a4342a;
  background: #fff4f2;
  border-left: 3px solid #d65245;
  font-size: 12px;
}
.auth-panel .auth-submit {
  height: 48px;
  min-height: 48px;
  margin-top: 20px;
  border: 1px solid #2457df;
  border-radius: 3px;
  background: #2457df;
}
.auth-panel .auth-submit:hover {
  border-color: #1744bb;
  background: #1744bb;
}
.auth-panel .auth-submit:focus-visible {
  outline: 3px solid rgba(36, 87, 223, 0.24);
  outline-offset: 3px;
}
.auth-workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  color: #8b96a2;
  border-top: 1px solid #e1e6ec;
  font-size: 9px;
}
.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.console {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: var(--nav);
  color: #fff;
}
.brand {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #526170;
  border-radius: 4px;
  font-size: 11px;
}
.sidebar nav {
  display: grid;
  gap: 4px;
  margin-top: 22px;
}
.nav-item {
  width: 100%;
  text-align: left;
  color: var(--nav-muted);
  background: transparent;
}
.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: #263542;
}
.logout {
  margin-top: auto;
  color: #c7d0d8;
  background: transparent;
  border: 1px solid #435260;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar h2 {
  margin: 4px 0 0;
  font-size: 20px;
}
.topbar-context {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.software-version {
  min-width: 42px;
  padding: 5px 8px;
  color: #dce8f2;
  background: #24323e;
  border: 1px solid #40505f;
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}
.managed-site {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: right;
}
.managed-site span {
  color: var(--muted);
  font-size: 11px;
}
.managed-site strong {
  max-width: 320px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.state-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
}
.state-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa5af;
}
.state-pill.active {
  color: var(--success);
  border-color: #b8d9cf;
  background: #f2faf7;
}
.state-pill.active span {
  background: var(--success);
}
.state-pill.denied {
  color: var(--danger);
  border-color: #efc3be;
  background: #fff7f6;
}
.state-pill.denied span {
  background: var(--danger);
}
.view {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}
.view.active {
  display: block;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metrics article {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.metrics span,
.metrics small {
  color: var(--muted);
}
.metrics strong {
  font-size: 28px;
  font-weight: 700;
}
.section-block,
.settings-panel {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
}
.user-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.user-search-bar > label {
  color: #394550;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.user-search-field {
  position: relative;
  width: min(420px, 100%);
}
.user-search-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 42px 8px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  outline: none;
}
.user-search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
}
.user-search-field button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  color: #66727d;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.user-search-field button:hover {
  color: var(--ink);
  background: #eef2f5;
}
.user-search-bar > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.marketplace-contract-terms {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.marketplace-contract-terms > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.marketplace-contract-terms span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}
.marketplace-contract-terms h4 {
  margin: 0;
  font-size: 16px;
}
.marketplace-contract-terms ol {
  margin: 9px 0 0;
  padding-left: 21px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.marketplace-contract-warning {
  margin: 9px 0 0;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.7;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.status-grid div {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.status-grid dt {
  color: var(--muted);
  font-size: 12px;
}
.status-grid dd {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  font-weight: 600;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.nodes-table {
  min-width: 1040px;
  table-layout: fixed;
}
.nodes-table th,
.nodes-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.nodes-table th:nth-child(1) { width: 25%; }
.nodes-table th:nth-child(2) { width: 12%; }
.nodes-table th:nth-child(3) { width: 13%; }
.nodes-table th:nth-child(4) { width: 16%; }
.nodes-table th:nth-child(5) { width: 6%; }
.nodes-table th:nth-child(6) { width: 12%; }
.nodes-table th:nth-child(7) { width: 13%; }
.nodes-table th:nth-child(8) { width: 190px; }
.nodes-table td:last-child,
.nodes-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -6px 0 10px rgba(31, 48, 64, 0.06);
}
.nodes-table th:last-child {
  background: #f9fafb;
  z-index: 2;
}
.node-endpoint,
.node-metrics,
.node-status-stack {
  display: grid;
  gap: 4px;
}
.node-endpoint strong {
  overflow: hidden;
  color: #263744;
  text-overflow: ellipsis;
}
.node-endpoint small,
.node-metrics small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}
.node-metrics strong {
  font-size: 12px;
}
.node-group-select {
  width: 100%;
  min-width: 96px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
.node-group-select:disabled {
  color: #7b8791;
  background: #f3f5f7;
  cursor: not-allowed;
}
.node-actions-cell .table-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.node-actions-cell .table-action {
  padding: 5px 8px;
  font-size: 11px;
}
.node-remark-input {
  width: 112px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}
.node-remark-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(23, 105, 170, 0.12);
}
th,
td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid #e5eaee;
}
th {
  color: #5f6b76;
  background: #f9fafb;
  font-size: 12px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  background: #eef2f5;
  color: #53606b;
  font-size: 12px;
}
.badge.good {
  background: #e8f5f0;
  color: var(--success);
}
.badge.warn {
  background: #fff4df;
  color: #946200;
}
.badge.bad {
  background: #fff0ee;
  color: var(--danger);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.identifier-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}
.identifier-code {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  color: #34414c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-action {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  color: #34414c;
  background: #fff;
  font-size: 12px;
}
.table-action:hover {
  border-color: #8fa0ae;
  background: #f6f8fa;
}
.table-action.warning {
  color: #8a5b00;
  border-color: #e1c58d;
}
.table-action.danger {
  color: var(--danger);
  border-color: #e6b8b3;
}
.empty {
  margin: 0;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}
.table-pager { display:flex; justify-content:flex-end; align-items:center; gap:6px; min-height:38px; margin:8px 0 20px; }
.table-pager button { min-width:32px; height:32px; border:1px solid #d8dee6; border-radius:5px; background:#fff; color:#344054; cursor:pointer; }
.table-pager button.active { border-color:#356cff; background:#356cff; color:#fff; }
.table-pager button:disabled { opacity:.45; cursor:not-allowed; }
.log-search-panel {
  margin-bottom: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.log-search-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, 1fr));
  gap: 14px;
}
.log-search-grid label {
  display: grid;
  gap: 7px;
  color: #394550;
  font-size: 12px;
  font-weight: 600;
}
.log-search-grid input,
.log-search-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd4dc;
  border-radius: 4px;
  outline: none;
}
.log-search-grid input:focus,
.log-search-grid select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
}
.log-result-bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  font-size: 12px;
}
.log-result-bar strong { color: var(--ink); }
.connection-log-table { min-width: 1040px; }
.connection-log-table td:nth-child(3),
.connection-log-table td:nth-child(4) { font-family: Consolas, "Courier New", monospace; }
.connection-log-pager span { min-width: 68px; text-align: center; color: var(--muted); font-size: 12px; }
.connection-log-pager button { min-width: 72px; padding: 0 12px; }
.settings-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.settings-tab {
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  border-bottom: 2px solid transparent;
}
.settings-tab.active {
  color: var(--primary);
  border-color: var(--primary);
}
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
}
.home-settings-panel { display:block; max-width:820px; }
.home-setting-intro { display:flex; align-items:flex-start; justify-content:space-between; gap:28px; margin-bottom:24px; padding:20px; background:#f5f8fc; border-left:3px solid var(--primary); }
.home-setting-intro strong { display:block; margin-bottom:8px; font-size:16px; }
.home-setting-intro p { max-width:590px; margin:0; color:var(--muted); font-size:13px; line-height:1.75; }
.home-setting-intro .switch { flex:0 0 auto; }
.home-preview-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.form-hint { margin:14px 0 0; color:var(--muted); font-size:12px; line-height:1.7; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.settings-panel input[readonly] {
  color: #52606d;
  background: #f4f6f8;
}
.settings-test {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}
.settings-test button {
  min-height: 40px;
}
.referral-withdrawal-heading {
  margin-top: 28px;
}
.referral-rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.referral-rate input {
  width: 88px;
}
.scratch-reward-heading { margin-top: 22px; }
.scratch-plan-field { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); }
.scratch-plan-field legend { padding: 0 5px; color: var(--muted); font-size: 13px; }
.scratch-plan-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 8px 14px; }
.scratch-plan-options label { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.scratch-plan-options input { width: 16px; height: 16px; margin: 0; }
.billing-list-heading { margin-top: 28px; }
.scratch-rewards { display: grid; gap: 8px; }
.scratch-reward-row { display: grid; grid-template-columns: minmax(140px,1fr) minmax(140px,1fr) auto; gap: 10px; align-items: end; }
.scratch-reward-row label { display: grid; gap: 6px; }
.scratch-reward-row button { min-height: 40px; }
.switch {
  display: flex !important;
  align-items: center !important;
  grid-template-columns: auto 1fr !important;
  gap: 8px !important;
}
.switch input {
  width: 17px !important;
  min-height: 17px !important;
  margin: 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.form-actions > .danger {
  color: var(--danger);
  border: 1px solid #e6b8b3;
  background: #fff;
}
.form-state {
  min-height: 18px;
  margin: 16px 0 0;
  color: var(--muted);
}
fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
fieldset legend {
  padding: 0 6px;
  font-weight: 700;
}
fieldset > .switch {
  margin: 0 0 14px;
}
.term-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.term-prices label {
  grid-template-columns: auto 54px minmax(90px, 1fr);
  align-items: center;
}
.term-prices label > input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  margin: 0;
}
.dialog-context {
  margin: 0;
  color: var(--muted);
}
dialog {
  width: min(calc(100% - 28px), 580px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(10, 20, 30, 0.25);
}
.wide-dialog {
  width: min(calc(100% - 28px), 1080px);
}
.shield-list {
  max-height: min(59vh, 560px);
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-right: 4px;
  overflow-y: auto;
}
.shield-list[hidden] {
  display: none;
}
.shield-list-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(132px, 0.8fr) minmax(570px, 3.8fr) 176px;
  gap: 16px;
  align-items: center;
  padding: 14px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.shield-list-item:hover {
  border-color: #c8d2dc;
  background: #fbfcfd;
}
.shield-list-item.revoked {
  background: #fafafa;
}
.shield-list-identity {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}
.shield-list-identity > strong {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shield-list-facts {
  min-width: 0;
  display: grid;
  grid-template-columns: 0.75fr 0.72fr 0.72fr 0.9fr 1.15fr 1.15fr 0.9fr;
  gap: 8px;
}
.shield-fact {
  min-width: 0;
}
.shield-fact span,
.shield-fact strong {
  display: block;
}
.shield-fact span {
  margin-bottom: 5px;
  color: #7b8792;
  font-size: 10px;
}
.shield-fact strong {
  overflow: hidden;
  color: #35424d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shield-fact.emphasized strong {
  color: #245f96;
  font-weight: 700;
}
.shield-bandwidth-fact {
  grid-column: span 2;
}
.shield-bandwidth-fact strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.shield-list-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.shield-list-actions .table-action {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}
.shield-history-label {
  grid-column: 1 / -1;
  justify-self: end;
  color: #98a1aa;
  font-size: 11px;
}
.shield-policy-note {
  margin-top: 14px;
  line-height: 1.7;
}
@media (max-width: 900px) {
  .shield-list-item {
    grid-template-columns: minmax(130px, 0.8fr) minmax(0, 3.2fr);
  }
  .shield-list-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(82px, 1fr));
    justify-self: end;
    width: min(100%, 380px);
  }
}
.identity-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.identity-detail-list > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.identity-detail-list dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.identity-detail-list dd {
  min-height: 21px;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 600;
}
.identity-detail-list .sensitive-value,
.identity-detail-list .technical-value {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 500;
}
.connection-log-conclusion {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #23425a;
  background: #eef5fb;
  border-left: 3px solid var(--primary);
  line-height: 1.6;
}
.connection-log-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.connection-log-detail > div {
  min-width: 0;
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.connection-log-detail dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.connection-log-detail dd { margin: 0; overflow-wrap: anywhere; font-family: Consolas, "Courier New", monospace; }
.connection-log-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.connection-stage {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.connection-stage > span { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #8996a3; }
.connection-stage.success > span { background: var(--success); }
.connection-stage.failed > span { background: var(--danger); }
.connection-stage strong,
.connection-stage small { display: block; overflow-wrap: anywhere; }
.connection-stage small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.connection-node-attempt-section { margin-top: 22px; }
.connection-node-attempt-section h4 { margin: 0 0 10px; font-size: 14px; }
.connection-node-attempt-table { min-width: 820px; }
.connection-node-attempt-table td:nth-child(3),
.connection-node-attempt-table td:nth-child(6) { font-family: Consolas, "Courier New", monospace; }
dialog::backdrop {
  background: rgba(12, 19, 26, 0.5);
}
dialog form {
  display: grid;
  gap: 15px;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dialog-heading h3 {
  margin: 0;
  font-size: 18px;
}
.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: #5e6a75;
  background: #eef2f5;
  font-size: 20px;
}
#secret-dialog pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  background: #f4f6f8;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 16px;
  color: #fff;
  background: #263542;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 30;
}
.toast.error {
  background: var(--danger);
}
@media (max-width: 900px) {
	.identity-detail-list {
	  grid-template-columns: 1fr;
	}
  .login-screen {
    padding: 0;
    overflow: visible;
  }
  .login-layout {
    min-height: 100svh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .login-intro {
    min-height: 370px;
    grid-template-rows: auto auto auto auto auto;
    gap: 17px;
    padding: 24px;
  }
  .login-intro-copy {
    padding-top: 12px;
  }
  .login-intro-copy h2 {
    max-width: 520px;
    font-size: 28px;
  }
  .login-capability-list {
    grid-template-columns: 1fr 1fr;
    gap: 9px 14px;
    margin-top: 2px;
    font-size: 12px;
  }
  .intro-login-button {
    width: 140px;
    height: 42px;
  }
  .auth-workspace {
    min-height: calc(100svh - 370px);
    padding: 22px 24px 18px;
  }
  .login-panel {
    padding: 32px 0;
  }
  .console {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .sidebar {
    padding: 12px 8px;
  }
  .brand {
    justify-content: center;
    padding: 0;
  }
  .brand > span:last-child {
    display: none;
  }
  .nav-item {
    padding: 9px 5px;
    text-align: center;
    font-size: 12px;
  }
  .logout {
    padding: 8px 4px;
    font-size: 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .login-intro {
    min-height: 350px;
    padding: 20px 18px 16px;
  }
  .login-brand h1 {
    font-size: 22px;
  }
  .login-intro-copy {
    padding-top: 8px;
  }
  .login-intro-copy h2 {
    font-size: 25px;
  }
  .login-intro-copy p {
    margin-top: 8px;
    font-size: 13px;
  }
  .login-capability-list {
    font-size: 11px;
  }
  .intro-login-button {
    width: 128px;
  }
  .login-intro footer {
    font-size: 9px;
  }
  .auth-workspace {
    min-height: calc(100svh - 350px);
    padding: 18px;
  }
  .auth-workspace-heading {
    padding-bottom: 2px;
  }
  .console {
    display: block;
  }
  .sidebar {
    position: sticky;
    inset: 0 0 auto;
    height: 62px;
    z-index: 10;
    display: grid;
    grid-template-columns: none;
    grid-auto-columns: minmax(92px, 1fr);
    grid-auto-flow: column;
    align-items: center;
    padding: 6px;
    background: var(--nav);
    overflow-x: auto;
  }
  .brand {
    display: none;
  }
  .sidebar nav {
    display: contents;
    margin: 0;
  }
  .nav-item {
    min-height: 48px;
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
  }
  .logout {
    min-height: 48px;
    margin: 0;
    padding: 4px 2px;
  }
  .workspace {
    padding-bottom: 0;
  }
  .topbar {
    height: 72px;
    padding: 0 14px;
  }
  .managed-site strong {
    max-width: 180px;
  }
  .state-pill {
    padding: 7px 9px;
  }
  .view {
    padding: 16px 12px;
  }
  .metrics {
    gap: 8px;
  }
  .metrics article {
    padding: 14px;
  }
  .metrics strong {
    font-size: 23px;
  }
  .section-block,
  .settings-panel {
    padding: 15px;
  }
  .status-grid,
  .form-grid,
  .log-search-grid {
    grid-template-columns: 1fr;
  }
  .connection-log-detail,
  .connection-log-stages {
    grid-template-columns: 1fr;
  }
  .settings-test {
    grid-template-columns: 1fr;
  }
  .term-prices {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .section-heading {
    align-items: flex-start;
  }
  .user-search-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }
  .user-search-field {
    width: 100%;
  }
  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .table-wrap {
    margin: 0 -12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  #user-shields-dialog {
    padding: 18px;
  }
  .shield-list {
    max-height: min(62vh, 600px);
    padding-right: 2px;
  }
  .shield-list-item {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 14px;
  }
  .shield-list-identity {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
  .shield-list-identity > strong {
    width: auto;
  }
  .shield-list-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding-top: 12px;
    border-top: 1px solid #edf0f2;
  }
  .shield-list-actions {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
    padding-top: 4px;
  }
  .shield-policy-note {
    font-size: 11px;
  }
  .settings-tabs {
    overflow: auto;
  }
  .login-panel {
    padding: 28px 0 22px;
  }
  .login-panel h2 {
    font-size: 24px;
  }
  .login-panel .auth-caption {
    margin-bottom: 22px;
  }
}
@media (max-width: 370px) {
  .nav-item,
  .logout {
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .topbar h2 {
    font-size: 18px;
  }
  .state-pill strong {
    font-size: 11px;
  }
  .managed-site span {
    display: none;
  }
  .managed-site strong {
    max-width: 130px;
    font-size: 11px;
  }
}
