:root {
  --card-header-bg: #dcefee;
  --table-row-bg: #fafcfb;
  --table-head-bg: #edf4f4;
  --service-not-selected-color: #8a949d;
  --service-radio: darkblue;
  --service-encrypted: darkred;
}

[data-theme="dark"] {
  --axing-shell-background: #121314;
  --card-header-bg: #182627;
  --table-row-bg: #0f1415;
  --table-head-bg: #162122;
  --header-pill-bg: #101819;
  --service-not-selected-color: #7c8b93;
  --service-radio: #8bb7ff;
  --service-encrypted: #ff8f8f;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
  background: var(--axing-shell-background);
}

.page {
  max-width: 1600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.index-page {
  max-width: 1000px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: auto;
}

.viewer-header,
.report-header {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--axing-form-element-border-color);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--axing-background-color) 88%, var(--axing-green-soft) 12%);
  box-shadow: 0 6px 18px rgba(27, 27, 27, 0.06);
}

.viewer-topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.viewer-topbar-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.viewer-copy {
  display: grid;
  gap: 0.25rem;
}

.report-header > h1 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--axing-green);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: 1.8rem;
}

.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}


.subtitle {
  margin: 0;
  color: var(--axing-muted-color);
}

.loader-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.path-group {
  width: 100%;
}

.loader-bar > input[type="file"] {
  width: 100%;
  min-width: 0;
  align-self: end;
}

.path-group > #snapshot-path {
  min-width: 0;
}

.path-group > button[type="submit"] {
  flex: 0 0 auto;
  width: auto;
  min-width: fit-content;
}


.status-line {
  margin: 0.85rem 0 0;
  color: var(--axing-muted-color);
}

.section-nav {
  position: static;
  z-index: 40;
  margin: 0 0 2rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--axing-form-element-border-color);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--axing-background-color) 86%, transparent 14%);
  box-shadow: 0 14px 28px rgba(27, 27, 27, 0.14);
  backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  .section-nav {
    position: sticky;
    top: 0;
  }
}

.section-nav__list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-nav__item {
  margin: 0;
}

.section-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--axing-control-min-height);
  padding: var(--axing-control-padding);
  border: 1px solid transparent;
  border-radius: var(--axing-border-radius);
  background: transparent;
  color: var(--axing-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.section-nav__link:visited {
  color: var(--axing-color);
}

.section-nav__link:is(:hover, :focus, :focus-visible) {
  background: var(--axing-green-soft);
  color: var(--axing-color);
}

.section-nav__link.is-active,
.section-nav__link[aria-current="true"] {
  background: var(--axing-green-soft);
  color: var(--axing-color);
}

.grid {
  display: grid;
  gap: 2rem;
}

.subgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.card {
  scroll-margin-top: 4.75rem;
  overflow: hidden;
  border: 1px solid var(--axing-form-element-border-color);
  border-radius: 0.5rem;
  background: inherit;
  box-shadow: 0 6px 18px rgba(27, 27, 27, 0.08);
}

.card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--axing-form-element-border-color);
  background: var(--card-header-bg);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--axing-form-element-border-color) 85%, transparent 15%);
  border-radius: 999px;
  background: var(--header-pill-bg, color-mix(in srgb, var(--axing-background-color) 70%, white 30%));
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

.card table {
  width: 100%;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  font-size: 1rem;
}

.card th,
.card td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--axing-form-element-border-color) 75%, transparent 25%);
  white-space: nowrap;
}

.card th {
  position: sticky;
  top: 0;
  background: var(--table-head-bg);
  color: var(--axing-color);
  font-weight: 600;
}

.card tbody td {
  background: var(--table-row-bg);
  color: var(--axing-color);
}

.card tbody tr:last-child td,
.card tbody tr:last-child th {
  border-bottom: 0;
}

tbody tr.row-muted td {
  color: var(--axing-muted-color);
}

.output-services tbody tr.row-muted td {
  color: var(--service-not-selected-color);
}

.output-services tbody tr.row-radio td {
  color: var(--service-radio);
}

.output-services tbody tr.row-encrypted td {
  color: var(--service-encrypted);
}

.device-info table,
.device-status table,
.smartportal table,
.snmp table,
.transport-settings table {
  table-layout: auto;
}

.device-info th:first-child,
.device-info td:first-child,
.device-status th:first-child,
.device-status td:first-child,
.smartportal th:first-child,
.smartportal td:first-child,
.snmp th:first-child,
.snmp td:first-child,
.transport-settings th:first-child,
.transport-settings td:first-child {
  width: 1%;
  white-space: nowrap;
}

.empty-state,
.error-state {
  padding: 1rem;
  border: 1px solid var(--axing-form-element-border-color);
  border-radius: 0.5rem;
  background: transparent;
  box-shadow: none;
}

.error-state {
  color: darkred;
}

@media (min-width: 576px) {
  .viewer-topbar,
  .viewer-topbar-actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .section-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 900px) {
  .viewer-header,
  .report-header {
    padding: 1rem;
  }

  .subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-nav {
    top: 0;
    padding: 0.75rem 1rem;
  }
}
