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

.field label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-input,
.select-input {
  width: 100%;
  min-width: 0;
}

.port-forward-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 860px);
  overflow: hidden;
}

.port-forward-modal .modal-body {
  overflow: auto;
}

.port-forward-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.port-forward-table th,
.port-forward-table td {
  padding-left: 12px;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.port-forward-table th:nth-child(1) { width: 18%; }
.port-forward-table th:nth-child(2) { width: 34%; }
.port-forward-table th:nth-child(3) { width: 17%; }
.port-forward-table th:nth-child(4) { width: 21%; }
.port-forward-table th:nth-child(5) { width: 44px; }

.port-forward-table .forward-action {
  padding-left: 3px;
  padding-right: 3px;
  overflow: visible;
}

.delete-forward {
  color: var(--red);
}

.delete-forward:hover {
  background: #fff1ef;
  color: #a63f3b;
}

.port-forward-form {
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.vnc-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 1040px);
  height: min(84vh, 720px);
  overflow: hidden;
}

.vnc-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  background: #10201f;
}

.vnc-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  background: #10201f;
}

@media (max-width: 760px) {
  .port-forward-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .port-forward-table {
    min-width: 620px;
  }
}

@media (max-width: 520px) {
  .port-forward-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .vnc-modal {
    width: 100%;
    height: 100%;
  }

  .vnc-frame {
    min-height: 0;
  }
}

/* Keep authentication focused on the actual sign-in workflow. */
.auth-view {
  display: block;
  min-height: 100vh;
  background: #f3f6f3;
}

.auth-rail {
  display: none;
}

.auth-panel {
  min-height: 100vh;
  padding: 24px;
  background: #f3f6f3;
}

.auth-card {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(30, 55, 44, .08);
}

.mobile-brand {
  display: block;
  margin-bottom: 34px;
}

.auth-heading h2 {
  font-size: 30px;
}

.sidebar-bottom,
.sync-label {
  display: none;
}

body {
  overflow-x: hidden;
}

.server-actions,
.header-actions,
.admin-actions {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .auth-panel {
    display: block;
    padding: 18px;
  }

  .auth-card {
    width: 100%;
    min-height: calc(100vh - 36px);
    padding: 22px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-brand {
    margin-bottom: 42px;
  }

  .auth-heading h2 {
    font-size: 28px;
  }

  .topbar-right {
    gap: 8px;
  }

  .top-user-name {
    max-width: 150px;
  }

  .section-title {
    align-items: flex-start;
  }

  .permission-line {
    grid-template-columns: minmax(100px, 1fr) repeat(5, 40px) !important;
    gap: 2px;
  }

  .permission-line span {
    font-size: 9px;
  }

  .admin-actions {
    justify-content: flex-end;
  }

  .modal-foot .primary-button,
  .modal-foot .danger-button,
  .modal-foot .secondary-button,
  .modal-foot .ghost-button {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .top-user-name {
    max-width: 112px;
  }

  .auth-tabs {
    gap: 20px;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot > button {
    flex: 1 1 auto;
  }

}

.plan-discount {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #f0ddb0;
  border-radius: 7px;
  background: #fff8e8;
  color: #976b1e;
  font-size: 12px;
  font-weight: 800;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #f0ddb0;
  border-radius: 8px;
  background: #fff8e8;
}

.billing-option {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #976b1e;
  font-size: 12px;
  font-weight: 800;
}

.billing-option.active {
  background: #fff;
  color: var(--deep);
  box-shadow: 0 2px 7px rgba(120, 88, 28, .13);
}

.plan-discount svg { width: 15px; height: 15px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid #29413b;
  border-top: 3px solid #13a57b;
  border-radius: 8px;
  background: #17221f;
  color: #e7f1eb;
  box-shadow: 0 14px 34px rgba(18, 42, 35, .14);
}

.plan-card.basic { border-top-color: #2bb487; }
.plan-card.advanced { border-top-color: #55c494; }
.plan-card.pro { border-top-color: #f0b84d; }
.plan-card.top { border-top-color: #ef8d71; }

.plan-card .eyebrow { color: #8ab7a5; }

.plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 50px;
}

.plan-card h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: 19px;
  letter-spacing: -.04em;
}

.stock-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #4a3b1e;
  color: #f2c14c;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.plan-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}

.plan-spec-grid > div {
  min-width: 0;
  min-height: 72px;
  padding: 11px;
  border: 1px solid #2b3a48;
  border-radius: 7px;
  background: #202c39;
}

.plan-spec-grid span,
.plan-spec-grid small {
  display: block;
  color: #92a6b5;
  font-size: 10px;
}

.plan-spec-grid strong {
  display: block;
  margin-top: 7px;
  color: #eef5f2;
  font-size: 17px;
  line-height: 1;
}

.plan-spec-grid small { margin-top: 5px; }

.plan-features {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
  color: #a9b9b2;
  font-size: 11px;
}

.plan-features span { display: flex; align-items: center; gap: 7px; }
.plan-features svg { width: 14px; height: 14px; color: #16ad82; }

.plan-price {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2c3b37;
}

.plan-price > div { display: flex; align-items: baseline; gap: 5px; }
.plan-price span, .plan-price small { color: #8fa39b; font-size: 10px; }
.plan-price strong { color: #14b387; font-size: 27px; letter-spacing: -.05em; }
.plan-price .annual-price { opacity: .94; }
.plan-price .annual-price strong { color: #f0c26a; font-size: 20px; }

.plan-card .primary-button { width: 100%; margin-top: 16px; background: #0aa277; }
.plan-card .primary-button:hover { background: #078863; }

#plansView:not(.annual-selected) .annual-price { display: none; }
#plansView.annual-selected .plan-price > div:first-child { display: none; }
#plansView.annual-selected .annual-price { display: flex; }
#plansView.annual-selected .plan-table td:nth-child(6),
#plansView:not(.annual-selected) .plan-table td:nth-child(7) { color: #a1aaa5; opacity: .58; }
#plansView.annual-selected .plan-table td:nth-child(7),
#plansView:not(.annual-selected) .plan-table td:nth-child(6) { font-weight: 800; }

.plan-table-block { margin-top: 20px; }
.plan-table { min-width: 760px; }
.plan-table td, .plan-table th { text-align: left; }
.plan-table td:last-child strong { color: var(--teal); }

.payment-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid #cfe5d8;
  border-radius: 8px;
  background: #edf8f1;
}

.payment-callout h3 { margin: 7px 0 5px; color: var(--deep); font-size: 16px; }
.payment-callout p { margin: 0; color: #5c7568; font-size: 12px; line-height: 1.7; }
.payment-callout p strong { color: var(--deep); }

.payment-modal { width: min(100%, 760px); }
.payment-modal-body { background: #f8fbf8; }
.payment-price { display: flex; align-items: baseline; gap: 9px; }
.payment-price span { color: #9b6f1e; font-size: 12px; font-weight: 800; }
.payment-price strong { color: var(--teal); font-size: 30px; letter-spacing: -.05em; }
.payment-price small { color: var(--muted); font-size: 12px; }
.payment-tip { margin: 15px 0 20px; color: #5b6f65; font-size: 13px; line-height: 1.7; }
.payment-tip strong { color: var(--deep); }
.payment-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.payment-codes figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.payment-codes img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.payment-codes figcaption { padding: 10px; color: var(--deep); font-size: 12px; font-weight: 800; text-align: center; }

@media (max-width: 1240px) {
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-callout { align-items: flex-start; flex-direction: column; }
  .payment-callout .secondary-button { width: 100%; }
}

@media (max-width: 520px) {
  .plan-grid { grid-template-columns: 1fr; }
  .payment-codes { grid-template-columns: 1fr; }
  .payment-modal { height: auto; max-height: 100vh; }
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 16px;
}

.account-panel .section-title > svg { width: 18px; height: 18px; color: var(--teal); }
.account-form { display: grid; gap: 15px; }
.account-form > .primary-button,
.account-form > .danger-button { justify-self: start; }
.account-danger-panel { border-color: #f0d5d1; }
.account-danger-panel .section-title > svg { color: var(--red); }
.account-danger-panel p { margin: 0 0 18px; color: #6d7772; font-size: 13px; line-height: 1.7; }
.danger-confirm { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; padding: 12px; border: 1px solid #f0d5d1; border-radius: 7px; background: #fff5f3; color: #9c5049; font-size: 12px; line-height: 1.6; }
.danger-confirm svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }

.network-settings-body .detail-list { margin-bottom: 20px; }
.network-rules-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 3px 0 10px; }
.network-rules-heading h3 { margin: 0; color: var(--deep); font-size: 14px; }
.network-rules-heading span { color: var(--muted); font-size: 12px; }
.credentials-body .detail-list { margin-bottom: 18px; }
.secret-placeholder { color: #8c9992 !important; font-weight: 600 !important; }
.credentials-body .security-note { margin: 0 0 18px; }
.credential-locked { padding: 24px 12px; }

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