:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #20332c;
  background: #f5f7f4;
  font-synthesis: none;
  --green: #205a44;
  --muted: #6c7870;
  --line: #dfe5de;
  --error: #a32c2c;
  --surface: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #7eb399;
  outline-offset: 3px;
}
.primary {
  background: var(--green);
  color: #fff;
}
.primary:hover:not(:disabled) {
  background: #163f30;
}
.secondary {
  background: white;
  border-color: #d4ded4;
  color: #304b3d;
}
.secondary:hover:not(:disabled),
.quiet:hover {
  background: #edf2eb;
}
.quiet {
  background: transparent;
  color: #506359;
  padding: 8px 11px;
}
.subtle {
  background: transparent;
  color: #40594a;
  padding: 11px 0;
  text-align: left;
}
.wide {
  width: 100%;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: -0.8px;
  font-weight: 650;
  margin-bottom: 10px;
}
h2 {
  font-size: 16px;
  letter-spacing: -0.2px;
  line-height: 1.5;
  font-weight: 650;
  margin-bottom: 0;
}
h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}
p {
  line-height: 1.65;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: #6f8174;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.7px;
  margin-bottom: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 0;
}
.error-text {
  color: var(--error);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  z-index: 5;
  background: #fff;
  padding: 15px;
}
.skip-link:focus {
  top: 8px;
}
.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;
}
.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: #ecf0e9;
  border-right: 1px solid var(--line);
  padding: 32px 18px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  padding: 0 12px 40px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  font-size: 10px;
  color: #718071;
  letter-spacing: 1px;
  font-weight: 400;
  margin-top: 5px;
}
.brand-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--green);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  letter-spacing: -1px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sidebar nav a {
  padding: 13px 14px;
  border-radius: 7px;
  display: flex;
  gap: 12px;
  text-decoration: none;
  font-size: 13px;
  color: #607063;
}
.sidebar nav a:hover {
  background: #e2e9dd;
}
.sidebar nav a[aria-current] {
  background: #dce7d6;
  color: #214f3b;
  font-weight: 600;
}
.nav-icon {
  font-size: 17px;
  width: 18px;
  text-align: center;
  font-weight: 400;
  line-height: 17px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 12px 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #dce2d6;
}
.sidebar-caption {
  color: #7c8779;
  font-size: 10px;
  letter-spacing: 0.6px;
}
.subtle span {
  float: right;
}
.workspace {
  min-width: 0;
  flex: 1;
}
.topbar {
  height: 74px;
  border-bottom: 1px solid var(--line);
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6e7c72;
  font-size: 12px;
  background: #f9faf7;
  gap: 12px;
}
.slash {
  margin: 0 14px;
  color: #b0b8ae;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  color: #758077;
}
.status:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa89b;
}
.status.running {
  color: #337253;
}
.status.running:before {
  background: #4a956a;
}
.status.stopped {
  color: var(--error);
}
.status.stopped:before {
  background: #ba6262;
}
main {
  max-width: 1190px;
  margin: 0 auto;
  padding: 42px 38px 48px;
  min-height: calc(100dvh - 134px);
}
main:focus {
  outline: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}
.page-heading p:last-child {
  font-size: 13px;
  margin-bottom: 0;
}
.version {
  font-size: 11px;
  color: #859080;
  font-family: ui-monospace, monospace;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  padding: 25px 27px;
  margin-bottom: 22px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.panel-heading p {
  margin-top: 6px;
  margin-bottom: 0;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
}
.engine-panel {
  border-top: 3px solid #668269;
  padding-top: 23px;
}
.engine-message {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin-bottom: 26px;
}
.detail-list {
  margin: 0;
  font-size: 12px;
}
.detail-list > div {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 14px 0;
  align-items: baseline;
}
.detail-list dt {
  color: #7a857b;
  flex-shrink: 0;
}
.detail-list dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 75%;
  line-height: 1.6;
}
.certificate-panel .detail-list {
  margin-top: 27px;
}
.certificate-panel .hint {
  padding-top: 20px;
  margin-top: 22px;
  border-top: 1px solid #eef0eb;
}
.exits-panel {
  padding-bottom: 7px;
}
.exit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 21px 0;
  border-top: 1px solid #edf0e9;
}
.exit-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: #eef3eb;
  display: grid;
  place-items: center;
  color: #49694d;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  flex-shrink: 0;
}
.exit-mark.residential {
  color: #857b50;
  background: #f5f2e7;
}
.exit-description {
  flex: 1;
}
.exit-description p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.probe-result {
  font-size: 12px;
  color: #73816f;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 220px;
  line-height: 1.6;
}
.probe-result.error-text {
  color: var(--error);
}
.tag {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #f0f2ec;
  color: #73806c;
  margin-left: 6px;
  font-weight: 400;
  white-space: nowrap;
}
.tag.enabled {
  background: #e5f2e6;
  color: #3a6a40;
}
.recovery {
  padding: 6px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.recovery h2 {
  font-size: 13px;
}
.recovery p {
  margin: 6px 0 0;
}
.form-panel {
  display: grid;
  grid-template-columns: 175px 1fr;
  gap: 25px;
}
.section-intro p {
  font-size: 11px;
  color: #83907f;
  margin-top: 8px;
}
.safety-note {
  display: block;
  font-size: 11px;
  color: #67805f;
  line-height: 1.8;
  margin-top: 30px;
}
.form-fields {
  max-width: 650px;
}
.field {
  margin-bottom: 19px;
  min-width: 0;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 8px;
  color: #425344;
}
input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  border: 1px solid #d9e1d6;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: #263d2c;
  min-height: 41px;
  font-size: 13px;
}
input::placeholder,
textarea::placeholder {
  color: #a2aaa0;
}
input:disabled,
select:disabled {
  background: #f5f6f3;
  color: #899284;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 1px 0 0;
}
input:invalid:not(:placeholder-shown) {
  box-shadow: none;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 24px;
  font-size: 13px;
  cursor: pointer;
}
.toggle-label small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.7;
  margin-top: 5px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
}
.check-label input {
  margin: 0;
}
fieldset {
  padding: 0;
  border: 0;
  margin: 0;
  min-width: 0;
}
fieldset:disabled {
  opacity: 0.65;
}
.save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 2px 0 14px;
}
.save-bar p {
  margin: 0;
}
.device-create {
  display: flex;
  align-items: end;
  gap: 14px;
}
.device-create .field {
  flex: 1;
  margin: 0;
  max-width: 480px;
}
.device-row {
  display: flex;
  gap: 18px;
  padding: 19px 0;
  align-items: center;
  border-top: 1px solid #edf0e9;
}
.device-name {
  font-size: 14px;
  font-weight: 550;
  margin: 0;
  overflow-wrap: anywhere;
}
.device-meta {
  font-size: 11px;
  color: #83907f;
  margin: 5px 0 0;
}
.device-info {
  flex: 1;
  min-width: 0;
}
.device-actions {
  display: flex;
  gap: 8px;
}
.danger {
  color: #9e5651;
}
.device-panel {
  padding-bottom: 8px;
}
.empty {
  padding: 35px 0 43px;
  text-align: center;
  color: #83907f;
  font-size: 13px;
  line-height: 1.9;
}
.empty strong {
  display: block;
  color: #4d6551;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
.footnote {
  font-size: 12px;
  color: #7c8977;
  padding: 0 2px;
  line-height: 1.8;
}
.notice {
  padding: 13px 16px;
  border: 1px solid #b8d1bc;
  background: #edf5eb;
  color: #39613e;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 7px;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}
.notice.error {
  background: #fff1ed;
  border-color: #ebc8be;
  color: #963e35;
}
footer {
  height: 60px;
  display: flex;
  justify-content: space-between;
  padding: 0 38px;
  align-items: center;
  color: #98a18f;
  font-size: 10px;
  border-top: 1px solid var(--line);
  letter-spacing: 0.4px;
}
.login-view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 22px;
  background: #f0f3ed;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 30px;
}
.login-card {
  max-width: 460px;
  width: 100%;
  padding: 38px;
  border: 1px solid #dbe3d6;
  border-radius: 14px;
  background: #fff;
}
.login-card h1 {
  font-size: 26px;
}
.login-card > .muted {
  font-size: 13px;
  margin-bottom: 26px;
}
.login-card form label {
  margin-top: 4px;
}
.login-card button {
  margin-top: 22px;
}
.login-foot {
  font-size: 11px;
  color: #8c9885;
  margin-top: 24px;
}
dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  color: #20332c;
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: rgba(24, 39, 29, 0.35);
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 15px;
}
.dialog-heading .eyebrow {
  margin-bottom: 6px;
}
dialog textarea,
dialog input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 12px;
  resize: vertical;
}
#subscription-section {
  margin-top: 25px;
}
#copy-status {
  min-height: 20px;
  margin-top: 15px;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 190px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .topbar {
    padding: 0 26px;
  }
  main {
    padding: 32px 26px;
  }
  .form-panel {
    grid-template-columns: 140px 1fr;
  }
  .exit-row {
    gap: 12px;
  }
  .probe-result {
    max-width: 160px;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 17px 22px 11px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0 0 16px;
    font-size: 20px;
  }
  .brand small {
    display: none;
  }
  .brand-symbol {
    width: 31px;
    height: 31px;
    font-size: 12px;
    border-radius: 8px;
  }
  .sidebar nav {
    flex-direction: row;
    gap: 7px;
  }
  .sidebar nav a {
    padding: 10px 13px;
    font-size: 12px;
    gap: 7px;
  }
  .nav-icon {
    font-size: 15px;
  }
  .sidebar-bottom {
    position: absolute;
    right: 24px;
    top: 20px;
    padding: 0;
    border: 0;
  }
  .sidebar-caption {
    display: none;
  }
  .subtle {
    font-size: 12px;
    padding: 6px 0;
  }
  .subtle span {
    margin-left: 10px;
  }
  .topbar {
    height: 58px;
    padding: 0 24px;
  }
  .topbar > span {
    display: none;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  main {
    padding: 30px 24px;
    min-height: calc(100dvh - 230px);
  }
  h1 {
    font-size: 26px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    padding: 23px;
  }
  .engine-panel {
    padding-top: 21px;
  }
  .certificate-panel .detail-list {
    margin-top: 0;
  }
  .certificate-panel .hint {
    padding-top: 14px;
    margin-top: 15px;
  }
  .form-panel {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .section-intro {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .section-intro p {
    margin: 0;
  }
  .safety-note {
    width: 100%;
    margin-top: 0;
  }
  .safety-note br {
    display: none;
  }
  .safety-note br:after {
    content: " · ";
  }
  .recovery {
    align-items: start;
  }
  .exit-description {
    flex-basis: calc(100% - 70px);
  }
  .exit-row {
    flex-wrap: wrap;
  }
  .probe-result {
    max-width: calc(100% - 110px);
    flex: 1;
    text-align: left;
    padding-left: 52px;
  }
  .exit-row button {
    margin-left: auto;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  footer {
    padding: 0 24px;
  }
  .device-actions {
    gap: 0;
  }
  .device-row {
    gap: 10px;
  }
}
@media (max-width: 480px) {
  main {
    padding: 26px 16px;
  }
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .sidebar-bottom {
    right: 17px;
  }
  .topbar {
    padding: 0 16px;
  }
  .sidebar nav a {
    padding: 10px;
    font-size: 12px;
  }
  .sidebar nav {
    justify-content: space-between;
    gap: 2px;
  }
  .nav-icon {
    display: none;
  }
  .panel {
    padding: 21px 18px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .save-bar,
  .recovery {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .save-bar button,
  .recovery button {
    width: 100%;
  }
  .device-create {
    align-items: stretch;
    flex-direction: column;
  }
  .device-row {
    flex-wrap: wrap;
  }
  .device-info {
    flex-basis: 100%;
  }
  .device-actions {
    margin-left: auto;
  }
  .device-actions button {
    font-size: 12px;
  }
  .login-card {
    padding: 28px 24px;
  }
  .login-card h1 {
    font-size: 24px;
  }
  footer {
    padding: 0 16px;
  }
  footer span {
    font-size: 9px;
  }
  .version {
    display: none;
  }
  dialog {
    padding: 23px 20px;
  }
  .entry-address {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
