:root {
  font:
    15px/1.55 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #192e2b;
  background: #f3f6f4;
  --green: #126754;
  --ink: #18352f;
  --line: #d8e2dc;
  --muted: #52675f;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #5db699;
  outline-offset: 2px;
}
.top {
  background: #14342f;
  color: #f4fcf7;
}
.bar,
.titlebar,
.panel-head,
.account,
.brand,
.device-head,
.dialog-foot,
.dialog-head,
.detail-head,
.device-row,
.row-base {
  display: flex;
  align-items: center;
}
.bar {
  max-width: 1320px;
  margin: auto;
  height: 66px;
  padding: 0 42px;
  justify-content: space-between;
}
.brand {
  gap: 12px;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.brand b {
  font-weight: 680;
}
.brand .slash {
  font-weight: 300;
  color: #6c8b83;
}
.logo {
  width: 29px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #c1eed5;
  border-radius: 7px;
}
.logo i {
  display: block;
  width: 3px;
  background: #174a3e;
  border-radius: 2px;
  height: 11px;
}
.logo i:nth-child(2) {
  height: 18px;
}
.logo i:nth-child(3) {
  height: 7px;
}
.account {
  gap: 22px;
  font-size: 13px;
}
.signal {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2c8765;
  vertical-align: 1px;
}
.account .signal {
  background: #a6e6ba;
}
.amber {
  background: #b87b19;
}
.red {
  background: #b15d51;
}
.signout {
  background: transparent;
  color: #d2ded8;
  border-left: 1px solid #44605a;
  padding: 2px 0 2px 19px;
}
main,
.bar {
  width: 100%;
}
#dashboard {
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px 42px 60px;
}
.titlebar,
.panel-head,
.device-head,
.dialog-foot,
.dialog-head,
.detail-head,
.device-row {
  justify-content: space-between;
  gap: 12px;
}
.titlebar {
  margin-bottom: 22px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-weight: 680;
  letter-spacing: -0.045em;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.25;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 16px;
}
.muted,
.help,
.sub,
.intro {
  color: var(--muted);
}
button.primary,
button.secondary,
button.destructive {
  border-radius: 7px;
  padding: 9px 15px;
  font-weight: 620;
  font-size: 14px;
}
.primary {
  background: var(--green);
  color: white;
}
.primary:hover {
  background: #0b5041;
}
.secondary {
  background: white;
  border: 1px solid #bfcdc5;
  color: var(--ink);
}
.secondary:hover,
.ghost:hover,
.action:hover {
  background: #edf4ef;
}
.ghost,
.action {
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  border-radius: 5px;
  padding: 5px 8px;
}
.destructive {
  background: #a13e36;
  color: white;
}
.warn {
  color: #9c423a;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
.metrics > div {
  padding: 15px 23px;
  position: relative;
}
.metrics > div + div:before {
  position: absolute;
  left: 0;
  top: 19px;
  bottom: 19px;
  width: 1px;
  background: var(--line);
  content: "";
}
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.metrics strong {
  display: block;
  font: 600 31px/1.3 var(--mono);
  letter-spacing: -2px;
  margin-top: 5px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(395px, 1.5fr);
  gap: 18px;
  align-items: start;
}
.panel,
.login-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  overflow: hidden;
}
.panel-head,
.detail-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  min-height: 72px;
}
.panel-head h2 {
  font-size: 17px;
}
.empty {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 150px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.empty b {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 16px;
}
.node-row {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  text-align: left;
  background: white;
  color: inherit;
}
.node-row:last-child {
  border-bottom: 0;
}
.node-row:hover {
  background: #f6f9f6;
}
.node-row.selected {
  border-left-color: var(--green);
  background: #edf6f0;
}
.row-base {
  justify-content: space-between;
  gap: 10px;
}
.node-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.sub {
  font-size: 13px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef1ef;
  color: #56665f;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}
.badge:before {
  content: "";
  height: 6px;
  width: 6px;
  background: currentColor;
  border-radius: 50%;
}
.badge.ok {
  background: #dff1e5;
  color: #216449;
}
.badge.busy {
  background: #fff0d8;
  color: #82530c;
}
.badge.bad {
  background: #f8e7e4;
  color: #973e35;
}
.detail-head > div {
  min-width: 0;
}
.detail-head h2 {
  overflow-wrap: anywhere;
}
.details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 20px;
  margin: 0;
  padding: 20px 22px;
}
.details dt {
  font-size: 12px;
  color: var(--muted);
}
.details dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.mono {
  font-family: var(--mono);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 20px;
}
.progress,
.problem {
  margin: 18px 22px 0;
  padding: 10px 13px;
  border-radius: 6px;
  font-size: 14px;
  background: #eef3ed;
  overflow-wrap: anywhere;
}
.problem,
.error {
  color: #86362f;
  background: #faeae7;
}
.device-head {
  padding: 16px 22px 9px;
  border-top: 1px solid var(--line);
}
#device-list {
  padding: 0 22px 15px;
}
.device-row {
  padding: 9px 0;
  border-bottom: 1px solid #e6ece8;
}
.device-row:last-child {
  border-bottom: none;
}
.device-row > span {
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 14px;
}
.device-row > div {
  display: flex;
  flex-shrink: 0;
}
.placeholder {
  font-size: 14px;
  color: var(--muted);
  padding: 13px 0;
}
.notice,
.error {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.notice {
  margin: 0 0 15px;
  background: #e0efe5;
}
.notice.failure {
  background: #faeae7;
  color: #86362f;
}
#boot-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  animation: boot-appear 120ms ease-out 400ms both;
}
#boot-progress::before {
  content: "";
  display: block;
  width: 25%;
  height: 100%;
  background: var(--green);
  animation: boot-travel 1.5s ease-in-out 400ms infinite both;
}
@keyframes boot-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes boot-travel {
  from { transform: translateX(-100%); }
  to { transform: translateX(400%); }
}
@media (prefers-reduced-motion: reduce) {
  #boot-progress { animation: boot-appear 0s 400ms both; }
  #boot-progress::before { width: 100%; animation: none; }
}
#boot-error {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--muted);
}
#boot-error p { margin: 0; }
#login {
  padding: clamp(48px, 12vh, 130px) 20px;
}
.login-card {
  max-width: 398px;
  margin: auto;
  padding: 32px;
}
.login-card h1 {
  font-size: 30px;
}
.login-card .muted {
  margin: 10px 0 20px;
}
.login-card label {
  margin-bottom: 16px;
}
.login-card .error {
  margin-bottom: 13px;
}
.wide {
  width: 100%;
}
dialog {
  width: min(570px, calc(100% - 24px));
  max-height: min(88vh, 850px);
  max-height: min(88dvh, 850px);
  padding: 0;
  background: white;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 20px 90px #0d302f30;
}
dialog.small {
  width: min(420px, calc(100% - 24px));
}
dialog::backdrop {
  background: #09252270;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dialog-head,
.dialog-foot {
  padding: 15px 22px;
  flex-shrink: 0;
}
.dialog-head {
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 22px;
}
.dialog-body {
  overflow-y: auto;
  min-height: 0;
  padding: 17px 22px;
}
.dialog-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}
.close {
  font-size: 23px;
  line-height: 1;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #f1f5f2;
  border-radius: 50%;
}
.intro {
  font-size: 14px;
  margin-bottom: 12px;
}
fieldset {
  margin: 14px 0 16px;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
  font-weight: 660;
  font-size: 15px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 9px 0 0;
  color: #38534a;
  font-size: 13px;
  font-weight: 550;
}
input,
textarea,
select {
  width: 100%;
  background: #fff;
  border: 1px solid #bdcdc3;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 400;
  color: #17372d;
}
textarea {
  resize: vertical;
}
.private-key {
  -webkit-text-security: disc;
}
.help {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.55;
}
code {
  display: block;
  font: 12px/1.55 var(--mono);
  overflow-wrap: anywhere;
  padding: 3px 0;
}
.dialog-body .error {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .bar {
    height: 56px;
    padding: 0 18px;
  }
  #dashboard {
    padding: 25px 16px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .metrics {
    margin-bottom: 16px;
  }
  .metrics > div {
    padding: 12px;
  }
  .metrics strong {
    font-size: 26px;
  }
  .panel-head,
  .detail-head {
    padding: 14px 16px;
    min-height: 55px;
  }
  .node-row {
    padding: 11px 13px;
  }
  .details dl {
    padding: 14px 16px;
  }
  .detail-actions {
    padding: 0 16px 14px;
  }
  .device-head {
    padding: 13px 16px 8px;
  }
  #device-list {
    padding: 0 16px 12px;
  }
  .titlebar .primary {
    padding: 8px 11px;
  }
  .empty {
    min-height: 115px;
  }
  .account > span {
    display: none;
  }
  .signout {
    border: 0;
  }
  .grid {
    gap: 9px;
  }
  .dialog-body,
  .dialog-head,
  .dialog-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 390px) {
  .metrics > div {
    padding: 9px;
  }
  .metrics span {
    font-size: 12px;
  }
  .details dl {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

#console-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 19px;
  margin: 0 auto 0 38px;
}
#console-nav a {
  display: grid;
  align-content: center;
  position: relative;
  padding: 0 3px;
  color: #bfd1ca;
  text-decoration: none;
  font-size: 14px;
  font-weight: 580;
}
#console-nav a:hover,
#console-nav a[aria-current="page"] {
  color: white;
}
#console-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #bceacb;
}
#user-workspace.no-selection {
  grid-template-columns: minmax(0, 1fr);
}
.list-total {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.user-list-loading {
  margin: 18px 22px;
  color: var(--muted);
  font-size: 14px;
}
.user-filter {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.user-filter input {
  background: #f8faf8;
}
.login-devices {
  padding: 6px 22px 20px;
  display: grid;
  gap: 12px;
}
.login-device {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.device-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f6faf7;
  border-bottom: 1px solid var(--line);
}
.device-card-head h4 {
  font-weight: 620;
  font-size: 15px;
  margin: 0 auto 0 0;
  overflow-wrap: anywhere;
}
.device-icon {
  display: grid;
  place-items: center;
  height: 36px;
  width: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #e1efe6;
  position: relative;
  color: #386c56;
}
.device-icon::before {
  content: "";
  width: 17px;
  height: 12px;
  border: 1.6px solid currentColor;
  border-radius: 2px;
}
.device-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  background: currentColor;
  bottom: 7px;
}
.device-icon.phone::before {
  width: 11px;
  height: 18px;
  border-radius: 3px;
}
.device-icon.phone::after {
  width: 4px;
  bottom: 11px;
  height: 1px;
}
.details .login-device dl {
  padding: 14px 16px 8px;
}
.login-device dl > div:nth-child(3) {
  grid-column: 1 / -1;
}
.grant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.grant-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.grant-row:last-child {
  border-bottom: none;
}
.user-email {
  min-width: 0;
}
@media (max-width: 760px) {
  .login-devices {
    padding: 6px 16px 16px;
  }
  #console-nav {
    margin-left: 18px;
    gap: 12px;
  }
  .brand {
    gap: 6px;
    font-size: 17px;
  }
}
@media (max-width: 480px) {
  .bar:has(#console-nav:not([hidden])) {
    flex-wrap: wrap;
    height: auto;
    padding-top: 14px;
  }
  #console-nav {
    order: 1;
    flex-basis: 100%;
    height: 44px;
    gap: 22px;
    margin-left: 0;
  }
}

.region-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.region-table th,
.region-table td {
  text-align: left;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.region-table th {
  background: #f6faf7;
  font-size: 13px;
  color: var(--muted);
  font-weight: 550;
}
.region-table td:first-child {
  font-weight: 600;
}
.region-table tr:last-child td {
  border-bottom: 0;
}
.region-table th:last-child {
  text-align: right;
}
.region-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}
.region-actions button:disabled {
  cursor: not-allowed;
}
.worker-note-detail {
  grid-column: 1 / -1;
}
.worker-note-detail dd {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#manage-worker-regions {
  color: var(--green);
}
@media (max-width: 480px) {
  .region-table td,
  .region-table th {
    padding: 10px;
  }
  .region-actions {
    gap: 0;
  }
}

.routing-table td { overflow-wrap: anywhere; }
#routing-list { overflow-x: auto; }
.routing-check { display: flex; align-items: center; gap: 10px; }
.routing-check input { width: auto; margin: 0; }

.routing-filters { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(100px, 150px)); gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line, #d8e3df); }
.routing-filters input, .routing-filters select { margin: 0; }
.routing-pagination { display:flex; align-items:center; gap:10px; padding:16px 22px; border-top:1px solid #d8e3df; }
.routing-pagination span { margin-right:auto; color:#586c64; }
.routing-table { min-width:690px; }
.routing-table td:first-child { max-width:320px; }
.routing-help { margin:16px 0 24px; }
.routing-distribution-panel { padding:20px 22px; margin-top:20px; }
.routing-distribution-panel summary { cursor:pointer; font-weight:650; }
#routing-distribution { margin-top:20px; }
#console-nav a { white-space:nowrap; }
@media(max-width:900px) {
 .bar:has(#console-nav:not([hidden])) { flex-wrap:wrap; height:auto; padding-top:14px; }
 #console-nav { order:2; flex-basis:100%; height:44px; margin-left:0; gap:20px; overflow-x:auto; }
 .routing-filters { grid-template-columns:repeat(3, 1fr); }
 #routing-search { grid-column:1/-1; }
 .routing-metrics { grid-template-columns:repeat(2,1fr); }
 .routing-pagination { flex-wrap:wrap; }
 #routing-version { flex-basis:100%; }
 #routing-page .panel-head { flex-wrap:wrap; }
}

#upgrade-confirm-label:not([hidden]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
#upgrade-confirm { width: auto; margin: 0; }
