:root {
  color-scheme: light dark;
  --text: #1a1a1a;
  --muted: #555;
  --bg: #fafafa;
  --surface: #ffffff;
  --footer-bg: #f0f0f0;
  --border: #ddd;
  --link: #0b5;
  --brand-purple: #4b3a65;
  --brand-gold: #ffcc33;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --muted: #aaa;
    --bg: #121212;
    --surface: #1e1e1e;
    --footer-bg: #1a1a1a;
    --border: #333;
    --link: #6ec;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  max-width: 48rem;
  margin: 0 auto;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-right: auto;
  text-decoration: none;
}

.site-brand:hover {
  opacity: 0.88;
}

.site-brand-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-purple);
}

.site-mark {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

.home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.home-mark {
  display: block;
  width: 8rem;
  height: 8rem;
  flex-shrink: 0;
  object-fit: contain;
}

.home-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}

.home-title-row h1 {
  margin: 0;
  color: var(--brand-purple);
}

.home-title-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.home-intro .byline {
  margin: 0.5rem 0 0;
}

.home-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.5rem 0 0;
}

.home-badge {
  display: block;
  font-size: 0.9rem;
  line-height: 0;
}

.home-badge img {
  display: block;
  height: auto;
}

.home-badge--peerpush img {
  width: 230px;
  max-width: 100%;
}

.home-badge--docker {
  flex-shrink: 0;
}

.home-version {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
}

.home-section {
  margin-bottom: 1.5rem;
}

.home-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--brand-purple);
}

.home-features,
.home-steps {
  margin: 0;
  padding-left: 1.25rem;
}

.home-steps {
  margin-top: 1rem;
}

.home-features li,
.home-steps li {
  margin-bottom: 0.5rem;
}

.home-features li:last-child,
.home-steps li:last-child {
  margin-bottom: 0;
}

.home-diagram {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--brand-purple) 4%, var(--bg));
  overflow-x: auto;
}

.home-diagram svg {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  height: auto;
}

.home-diagram figcaption {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

.diagram-box {
  fill: var(--bg);
  stroke: var(--brand-purple);
  stroke-width: 2;
}

.diagram-box-accent {
  fill: color-mix(in srgb, var(--brand-purple) 12%, var(--bg));
  stroke: var(--brand-purple);
  stroke-width: 2;
}

.diagram-box-muted {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.diagram-lan-zone {
  fill: color-mix(in srgb, var(--brand-purple) 6%, var(--bg));
  stroke: var(--brand-purple);
  stroke-width: 1.5;
  stroke-dasharray: 8 5;
}

.diagram-lan-label {
  fill: var(--brand-purple);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.diagram-text {
  fill: var(--text);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
}

.diagram-text-sub {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.diagram-arrow {
  stroke: var(--muted);
  stroke-width: 1.5;
  fill: none;
  marker-end: url(#diagram-arrowhead);
}

.diagram-arrowhead {
  fill: var(--muted);
}

.diagram-label {
  fill: var(--muted);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 10px;
  text-anchor: middle;
}

.home-cards {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

.home-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.home-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--brand-purple);
}

.home-card p {
  margin: 0 0 0.75rem;
}

.home-card-note {
  font-size: 0.9rem;
  margin-bottom: 1rem !important;
}

.home-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.home-features + .home-card-actions,
.home-steps + .home-card-actions {
  margin-top: 1.25rem;
}

.home-card-actions > :is(a, button).btn-primary,
.home-card-actions > :is(a, button).btn-secondary,
.home-card-actions > :is(a, button).btn-danger {
  flex: 0 0 auto;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.cta-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-radius: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.btn-primary {
  background: var(--brand-purple);
  color: #fff;
  border-color: var(--brand-purple);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  border: 1px solid var(--brand-purple);
  color: var(--brand-purple);
  background: transparent;
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--brand-purple) 12%, transparent);
}

.btn-danger {
  background: #c44;
  color: #fff;
  border-color: #c44;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.home-tech {
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.home-tech summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.home-tech p {
  margin: 0.75rem 0 0;
}

.site-nav a:not(.site-brand) {
  color: var(--link);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-main {
  flex: 1 0 auto;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

body.home-page .site-nav,
body.home-page .site-main,
body.home-page .site-footer-inner,
body.faq-page .site-nav,
body.faq-page .site-main,
body.faq-page .site-footer-inner,
body.auth-page .site-nav,
body.auth-page .site-main,
body.auth-page .site-footer-inner {
  max-width: 60rem;
  width: 100%;
}

body.home-page .home-cards {
  max-width: 35rem;
}

body.home-page .home-cards.pricing-plans {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

body.home-page .home-cards.pricing-plans--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.home-page .home-cards.pricing-plans .home-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.home-page .home-cards.pricing-plans .home-card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

@media (max-width: 768px) {
  body.home-page .home-cards.pricing-plans--dual {
    grid-template-columns: 1fr;
    max-width: 28rem;
  }
}

body.pricing-page .pricing-plans {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

body.pricing-page .pricing-plans--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.pricing-page .pricing-plans:not(.pricing-plans--dual) {
  grid-template-columns: 1fr;
  max-width: 28rem;
}

body.pricing-page .pricing-plans .home-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.pricing-page .pricing-plans .home-card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

@media (max-width: 768px) {
  body.pricing-page .pricing-plans--dual {
    grid-template-columns: 1fr;
    max-width: 28rem;
  }
}

body.portal-page .site-nav,
body.portal-page .site-main,
body.portal-page .site-footer-inner,
body.admin-page .site-nav,
body.admin-page .site-main,
body.admin-page .site-footer-inner,
body.admin-page .admin-subnav {
  max-width: 80%;
  width: 80%;
}

body.admin-page .admin-subnav {
  margin-left: auto;
  margin-right: auto;
}

.site-footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-start,
.footer-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.footer-end {
  justify-content: flex-end;
}

.footer-version,
.footer-copy {
  white-space: nowrap;
}

.footer-changelog {
  position: relative;
}

.footer-changelog summary {
  cursor: pointer;
  color: var(--brand-purple);
  list-style: none;
}

.footer-changelog summary::-webkit-details-marker {
  display: none;
}

.footer-changelog-list {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 10;
  min-width: 18rem;
  max-width: 28rem;
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 0.75rem 1rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--bg);
  box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
}

.footer-changelog-list li {
  margin-bottom: 0.5rem;
}

.footer-changelog-list li:last-child {
  margin-bottom: 0;
}

.footer-powered a,
.footer-copy a,
.footer-legal a {
  color: var(--link);
  text-decoration: none;
}

.footer-powered a:hover,
.footer-copy a:hover,
.footer-legal a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.75rem;
  margin-top: 0;
}

h2 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.lead {
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-size: 0.9em;
}

section {
  margin-top: 1rem;
}

article.legal h1 {
  font-size: 1.5rem;
}

article.legal h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.25rem;
}

article.legal blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

article.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

article.legal th,
article.legal td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

article.legal hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.manual-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.manual-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border);
}

.manual-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.manual-sidebar-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.45;
}

.manual-sidebar-list li {
  margin-bottom: 0.45rem;
}

.manual-sidebar-index {
  display: inline-block;
  min-width: 1.5rem;
  color: var(--muted);
}

.manual-sidebar-list a {
  color: var(--text);
  text-decoration: none;
}

.manual-sidebar-list a:hover {
  color: var(--brand-purple);
  text-decoration: underline;
}

article.manual-content h2 {
  scroll-margin-top: 1rem;
}

@media (max-width: 48rem) {
  .manual-layout {
    grid-template-columns: 1fr;
  }

  .manual-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
  }
}

article.faq h2 {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

article.faq h2:first-of-type {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
}

.faq-cta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.faq-cta h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.portal-user {
  margin-left: auto;
}

.portal-form label {
  display: block;
  margin: 0.75rem 0;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-top: 0.25rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  line-height: 1.5;
}

.portal-form textarea {
  max-width: 40rem;
  min-height: 10rem;
  resize: vertical;
}

.password-policy-checklist {
  margin: 0.25rem 0 0.75rem;
  padding: 0;
  max-width: 24rem;
  list-style: none;
  font-size: 0.9rem;
}

.password-rule {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.2rem 0;
  color: var(--muted, #666);
}

.password-rule--ok {
  color: var(--ok-text, #0d6b2f);
}

.password-rule--fail {
  color: var(--err-text, #9b1c1c);
}

.password-rule-mark {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-weight: 600;
}

.password-match-hint {
  margin: 0.25rem 0 0.75rem;
  max-width: 24rem;
  font-size: 0.9rem;
}

.password-match-hint--ok {
  color: var(--ok-text, #0d6b2f);
}

.password-match-hint--fail {
  color: var(--err-text, #9b1c1c);
}

.recaptcha-notice {
  margin-top: 1rem;
  max-width: 24rem;
  font-size: 0.85rem;
  color: var(--muted, #666);
}

.recaptcha-notice a {
  color: inherit;
}

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 24rem;
}

.checkbox-label-legal {
  max-width: none;
  align-items: center;
}

.checkbox-label-legal .checkbox-label-text {
  white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
  display: inline-block;
  width: auto;
  max-width: none;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.device-table {
  table-layout: fixed;
}

.device-table .col-label {
  width: 12%;
}

.device-table .col-owner {
  width: 16%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-table .col-last-seen {
  width: 10rem;
  white-space: nowrap;
}

.device-table .col-device-id {
  width: 8rem;
}

.device-table .col-status {
  width: 11rem;
  white-space: nowrap;
}

.device-table .col-host-ip {
  width: 9rem;
  white-space: nowrap;
}

.device-table .col-events {
  width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.device-table .col-events th,
.device-table td.col-events {
  text-align: right;
}

.device-table .col-actions {
  width: auto;
}

.device-table-portal .col-label {
  width: 14%;
}

.device-table-portal .col-device-id {
  width: 20%;
}

.device-table-portal .col-status {
  width: 11%;
}

.device-table-portal .col-host-ip {
  width: 9%;
}

.device-table-portal .col-events {
  width: 5%;
}

.device-table-portal .col-actions {
  width: 41%;
}

.device-table-portal th.col-actions {
  text-align: left;
}

.device-table-portal .device-actions-cell {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.device-table-portal .device-actions-cell :is(a, button) {
  flex-shrink: 0;
}

.device-table-portal .device-id {
  font-size: 0.82rem;
}

.device-table .device-id {
  white-space: nowrap;
}

.device-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.page-header .page-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.period-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.device-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.device-actions-cell .inline-form {
  display: contents;
  margin: 0;
}

.device-actions-cell .inline-form button {
  margin: 0;
}

.event-table {
  font-size: 0.88rem;
}

.event-table th:first-child,
.event-table td:first-child {
  white-space: nowrap;
}

.batch-table .batch-detail-row > td {
  padding-top: 0;
  border-top: none;
}

.batch-details {
  margin: 0.25rem 0 0.75rem;
}

.batch-details > summary {
  cursor: pointer;
  font-weight: 600;
}

.batch-events-table {
  margin-top: 0.75rem;
  font-size: 0.84rem;
}

.settings-section {
  margin: 2rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.portal-panel {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  overflow: hidden;
  padding-bottom: 0;
}

.settings-section.portal-panel {
  border-bottom: none;
}

.portal-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.portal-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-width: 9rem;
}

.portal-filter-form label > span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-filter-form select {
  min-width: 10.5rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--surface);
  color: var(--text);
}

.portal-filter-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.portal-panel__body {
  padding: 0 1.25rem 1.25rem;
}

.portal-panel__meta {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.portal-panel__table {
  margin: 1rem 0 0;
}

.portal-panel__pagination {
  margin-top: 0.75rem;
  padding-top: 0;
}

.mfa-qr-wrap svg {
  display: block;
  max-width: 12rem;
  height: auto;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: #fff;
}

.backup-code-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
}

.backup-code-list code {
  display: block;
  padding: 0.35rem 0.5rem;
  background: var(--surface-muted, #f4f4f5);
  border-radius: 0.25rem;
  font-size: 0.95rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.inline-form button {
  margin: 0;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.device-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.device-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.device-card-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}

.device-card-meta {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.device-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-ok {
  background: rgba(0, 180, 80, 0.15);
  color: #2a8;
}

.badge-off {
  background: rgba(127, 127, 127, 0.15);
  color: var(--muted);
}

.badge-warn {
  background: rgba(200, 140, 0, 0.15);
  color: #a67000;
}

@media (prefers-color-scheme: dark) {
  .badge-warn {
    color: #e0b040;
  }
}

.site-nav a.nav-active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-subnav a {
  text-decoration: none;
  font-weight: 600;
}

.admin-subnav a.nav-active {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.page-header + .page-actions {
  margin-top: 0;
}

.page-actions > :is(a, button).btn-primary,
.page-actions > :is(a, button).btn-secondary,
.page-actions > :is(a, button).btn-danger {
  flex: 0 0 auto;
  align-self: center;
}

.page-actions .inline-form {
  display: contents;
}

.page-actions .inline-form input[type="hidden"] {
  display: none;
}

.form-actions .inline-form {
  display: contents;
  margin: 0;
}

.form-actions .inline-form button {
  margin: 0;
}

.pagination {
  margin-top: 1rem;
}

.pagination-meta {
  margin: 0.75rem 0 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin-bottom: 0.35rem;
}

.deploy-key {
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.deploy-key h2 {
  margin-top: 0;
}

.form-section {
  margin: 1.5rem 0;
  padding: 0;
  border: none;
}

.form-section legend {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  padding: 0;
}

.config-preview-panel {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}

.config-preview-panel > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  list-style: none;
}

.config-preview-panel > summary::-webkit-details-marker {
  display: none;
}

.config-preview-panel[open] > summary {
  margin-bottom: 0.5rem;
}

.config-preview-panel .code-block {
  max-height: 24rem;
  overflow: auto;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.alert {
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  margin: 0.75rem 0;
}

.alert-ok {
  border: 1px solid #3a5;
  background: rgba(0, 180, 80, 0.08);
}

.alert-err {
  border: 1px solid #c44;
  background: rgba(200, 40, 40, 0.08);
}

.alert-warn {
  border: 1px solid #c90;
  background: rgba(200, 140, 0, 0.1);
}

.key-box,
.code-block {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.06);
  font-size: 0.85rem;
}

.config-section {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem 1rem;
}

.config-section summary {
  cursor: pointer;
  list-style: disclosure-closed;
}

.config-section[open] summary {
  list-style: disclosure-open;
}

.config-section summary h2,
.config-section summary h3 {
  display: inline;
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.config-section summary h2 {
  font-size: 1.1rem;
}

.deploy-load {
  margin: 1.25rem 0;
}

.deploy-load-label {
  margin: 0 0 0.5rem;
}

.run-command-highlight {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0.5rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-purple);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--brand-purple) 6%, var(--bg));
}

.run-command-highlight > h2 {
  margin-top: 0;
}

.config-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.config-fieldset legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.5rem 1rem;
}

.config-grid-full {
  grid-column: 1 / -1;
}

.config-grid label,
.config-checkbox {
  display: block;
  margin: 0.5rem 0;
}

.config-checkbox input {
  width: auto;
  margin-right: 0.35rem;
  display: inline-block;
}

.config-actions {
  margin-top: 1.25rem;
}

.config-handlers-table,
.config-settings-table {
  margin-top: 0.75rem;
}

.config-handlers-table th[scope="row"],
.config-settings-table th[scope="row"] {
  white-space: nowrap;
  font-weight: 600;
}

.config-settings-table .col-value {
  width: 12rem;
}

.config-field-unit {
  margin-left: 0.35rem;
  color: var(--muted, #666);
  font-size: 0.9rem;
  white-space: nowrap;
}

.config-handlers-table .col-enabled {
  width: 4.5rem;
  text-align: center;
}

.config-handlers-table .col-actions {
  width: 6.5rem;
  white-space: nowrap;
}

.config-handlers-table input[type="text"],
.config-handlers-table input[type="number"],
.config-handlers-table select,
.config-settings-table input[type="text"],
.config-settings-table input[type="number"],
.config-settings-table select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
}

.config-table-checkbox {
  display: flex;
  justify-content: center;
  margin: 0;
}

.config-table-checkbox input {
  width: auto;
  margin: 0;
}

.service-handler-row.is-disabled td:not(.col-enabled) {
  opacity: 0.65;
}

.config-table-actions {
  margin: 0.75rem 0 0;
}

.info-hover {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.3rem;
}

.info-hover-trigger {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted, #666);
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
}

.info-hover-trigger:hover,
.info-hover-trigger:focus-visible {
  color: var(--text);
  border-color: var(--text);
  outline: none;
}

.info-hover-panel {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  width: max-content;
  max-width: 22rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  font-weight: normal;
  font-style: normal;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  opacity: 1;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
  z-index: 20;
  text-align: left;
  white-space: normal;
  line-height: 1.45;
}

.info-hover-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.4rem;
}

.info-hover:hover .info-hover-panel,
.info-hover:focus-within .info-hover-panel {
  display: block;
}

.info-hover-panel code {
  font-size: 0.92em;
}

.btn-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.is-hidden {
  display: none;
}

#config-preview code {
  white-space: pre-wrap;
  word-break: break-word;
}

.docker-snippets {
  margin-top: 1.5rem;
}

.docker-snippets > h2 {
  margin-bottom: 0.35rem;
}

.snippet-block {
  margin: 1rem 0;
}

.snippet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.snippet-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.snippet-oneline code {
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-snippet:disabled {
  opacity: 0.7;
  cursor: default;
}
