:root {
  font-family: system-ui, sans-serif;
  color: #20302e;
  background: #f3f5f1;
}
body {
  margin: 0;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 40px 24px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #c5cfc6;
  padding-bottom: 20px;
}
h1 {
  font-size: 40px;
  margin: 5px 0;
}
h2 {
  margin-top: 32px;
}
small {
  letter-spacing: 0.12em;
  color: #547366;
}
a {
  color: #275e49;
}
p {
  line-height: 1.6;
  max-width: 850px;
  overflow-wrap: anywhere;
}
select {
  max-width: 100%;
  padding: 8px;
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  border: 1px solid #92ab9c;
  border-radius: 6px;
  background: #fff;
  padding: 10px 16px;
  cursor: pointer;
  margin: 6px 6px 6px 0;
  color: #203c2b;
}
button:hover {
  background: #e2ece0;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #35795c;
  outline-offset: 2px;
}
nav {
  margin: 24px 0;
}
label {
  display: block;
  margin: 12px 0;
}
input:not([type='checkbox']) {
  display: block;
  width: min(90%, 500px);
  border: 1px solid #9aac9f;
  padding: 12px;
  margin-top: 5px;
  font-size: 16px;
  border-radius: 5px;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
th,
td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid #dce2db;
  font-size: 14px;
}
th {
  color: #53665b;
}
.table {
  overflow: auto;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #e8ede6;
  padding: 20px;
  border-radius: 6px;
  max-height: 500px;
  overflow: auto;
}
output {
  display: block;
  white-space: pre-wrap;
  background: #e8ede6;
  padding: 16px;
  margin: 10px 0;
}
output:empty {
  display: none;
}
img {
  max-width: 100%;
  max-height: 700px;
  border: 1px solid #b3c3b6;
}
#detail {
  border: 1px solid #c5cfc6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 24px;
}
form {
  max-width: 600px;
  margin-top: 30px;
}

.probe-long {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Monitoring stays separate from the existing operational controls. */
:root {
  color: #203b38;
  background: #f3f5f4;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}
main {
  max-width: 1440px;
  padding: 32px 36px 70px;
}
header {
  border-color: #d8e0dd;
  gap: 20px;
}
header > div:last-child {
  font-size: 13px;
  line-height: 1.9;
  text-align: right;
}
h1 {
  font-weight: 700;
  letter-spacing: -1.6px;
  font-size: 38px;
}
.title-dot {
  color: #26a37e;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 12px 0 18px;
}
h3 {
  margin: 0 0 16px;
  font-size: 17px;
}
small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}
a {
  text-underline-offset: 4px;
}
button,
input:not([type='checkbox']),
select {
  border-color: #cedbd5;
  border-radius: 8px;
}
button {
  font: inherit;
  font-size: 13px;
  padding: 9px 13px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #35795c;
  outline-offset: 3px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d8e0dd;
  margin: 16px 0 0;
  padding-bottom: 10px;
}
.toolbar a {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-right: 24px;
  padding: 8px 0;
}
.live-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #647772;
  gap: 15px;
  margin: 4px 0 25px;
}
.live-bar label {
  margin: 12px 0;
  white-space: nowrap;
}
.fresh {
  color: #26795e;
}
.stale {
  color: #a14a20;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.section-heading a {
  font-size: 13px;
}
.section-heading h2 {
  margin: 8px 0 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat {
  background: white;
  border: 1px solid #dce5e0;
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-label {
  font-size: 13px;
  color: #536e63;
}
.stat strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: 650;
}
.stat .muted {
  font-size: 12px;
}
.stat.accent {
  background: #163f38;
  border-color: #163f38;
  color: #fff;
}
.stat.accent .stat-label,
.stat.accent .muted {
  color: #b6d6c9;
}
.stat.warning {
  border-color: #e9cea3;
  background: #fffaf0;
}
.muted {
  color: #647772;
  font-size: 13px;
  line-height: 1.5;
}
.search-label {
  margin: 0;
  font-size: 11px;
  color: #647772;
}
.search-label input {
  width: 240px;
  margin: 4px 0 8px;
  padding: 9px 12px;
  font-size: 13px;
  background: #fff;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.filters button {
  margin: 0;
  background: transparent;
  border-color: transparent;
  color: #536e63;
}
.filters button[aria-pressed='true'] {
  background: #dfeae4;
  color: #204f3e;
  border-color: #c9dbd0;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.device-card,
.surface {
  background: white;
  border: 1px solid #dce5e0;
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.device-card {
  display: flex;
  flex-direction: column;
}
.device-card.attention {
  border-color: #e9cea3;
}
.device-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.device-heading h3 {
  font-size: 17px;
  overflow-wrap: anywhere;
  margin: 0;
}
.device-model {
  color: #647772;
  font-size: 12px;
  margin: 8px 0 15px;
}
.pill {
  display: inline-block;
  flex-shrink: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: #eff3f1;
  color: #5a7167;
}
.pill.green {
  color: #216d4f;
  background: #e5f2e9;
}
.pill.amber {
  color: #88581d;
  background: #fcf0d9;
}
.pill.blue {
  color: #2c638c;
  background: #e9f1fa;
}
.pill.gray {
  color: #66746e;
  background: #eff2f0;
}
.workload {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.device-facts {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 9px 12px;
  margin: 5px 0 14px;
  font-size: 12px;
}
.device-facts dt {
  color: #647772;
}
.device-facts dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.consumer-line {
  font-size: 12px;
  font-weight: 600;
  margin: 6px 0;
}
.reason {
  font-size: 11px;
  margin: 4px 0 12px;
}
.device-footer {
  border-top: 1px solid #edf1ee;
  padding-top: 12px;
  margin-top: auto;
}
.device-footer .muted {
  display: block;
  font-size: 11px;
}
.device-footer button {
  margin-bottom: 0;
  margin-top: 12px;
}
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.surface {
  margin: 16px 0;
}
.work-grid .surface {
  margin: 0;
}
.count {
  margin-left: 6px;
  color: #6a7d72;
  font-size: 13px;
}
.work-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #edf1ee;
}
.work-item strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.work-item p {
  font-size: 11px;
  margin: 6px 0 0;
}
.work-item > div {
  min-width: 0;
}
.empty {
  color: #75867b;
  font-size: 13px;
  padding: 20px 0;
  margin: 0;
}
#recentEvents {
  max-height: 420px;
  overflow: auto;
}
.admin-section > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  padding: 2px 0;
}
.admin-section > .table {
  margin-top: 16px;
}
#detail {
  scroll-margin-top: 20px;
}
#login {
  background: white;
  border: 1px solid #dce5e0;
  border-radius: 12px;
  padding: 24px;
}
#login button {
  background: #163f38;
  color: white;
}
@media (max-width: 1100px) {
  .device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 18px 16px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 22px 16px 40px;
  }
  header {
    align-items: flex-start;
  }
  h1 {
    font-size: 30px;
  }
  header > div:last-child {
    max-width: 140px;
    font-size: 11px;
  }
  small {
    font-size: 9px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat strong {
    font-size: 28px;
  }
  .device-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }
  .work-grid {
    gap: 12px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar a {
    margin-right: 16px;
  }
  .live-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .live-bar > span {
    padding-top: 12px;
  }
  .section-heading {
    flex-wrap: wrap;
  }
  .search-label {
    width: 100%;
  }
  .search-label input {
    width: 100%;
  }
  .device-card,
  .surface {
    padding: 18px;
  }
  .work-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  #administration .table {
    max-width: 100%;
  }
  .device-heading {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Each task has its own route; the fleet overview stays compact. */
.app-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 30px;
}
.sidebar {
  border-right: 1px solid #d8e0dd;
  padding: 20px 20px 0 0;
}
.sidebar nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 6px;
  margin: 0;
}
.sidebar a {
  color: #5d716a;
  text-decoration: none;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 550;
  border-radius: 8px;
}
.sidebar a:hover {
  background: #e8efeb;
}
.sidebar a[aria-current='page'] {
  background: #dcebe3;
  color: #174e3b;
}
.sidebar .add-device-link {
  background: #184f3d;
  color: #fff;
  margin-top: 16px;
}
.sidebar .add-device-link:hover,
.sidebar .add-device-link[aria-current='page'] {
  background: #24664e;
  color: #fff;
}
.workspace {
  min-width: 0;
}
.section-path {
  color: #71827c;
  font-size: 12px;
}
.section-path strong {
  font-weight: 550;
  color: #324f43;
}
.workspace .toolbar {
  margin-top: 8px;
}
.workspace > [data-view] {
  min-height: 350px;
}
.workspace > .surface {
  margin-top: 20px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.shortcut {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid #dce5e0;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
}
.shortcut:hover {
  border-color: #9cbeac;
  background: #fafffc;
}
.shortcut strong {
  font-size: 16px;
}
.shortcut span {
  color: #647772;
  font-size: 13px;
  line-height: 1.5;
}
.workspace .device-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.back-link,
.action-link {
  display: inline-block;
  margin: 14px 0;
  font-size: 13px;
}
#detail {
  margin-top: 10px;
  background: #fff;
}
#integrations > .surface,
#updates-view > .surface,
.pairing-card {
  margin: 20px 0;
}
.integration-endpoints {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 12px;
  font-size: 13px;
}
.integration-endpoints dt {
  color: #647772;
}
.integration-endpoints dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.setup-steps {
  padding-left: 22px;
  color: #4c6559;
  font-size: 14px;
  line-height: 1.7;
}
.setup-steps li {
  margin-bottom: 12px;
}
.download-button {
  display: block;
  text-align: center;
  padding: 12px 14px;
  text-decoration: none;
  border-radius: 8px;
  background: #e6f1ea;
  margin-top: 10px;
  font-size: 13px;
}
.download-button.secondary {
  background: #f2f5f3;
}
button.primary {
  color: #fff;
  border-color: #184f3d;
  background: #184f3d;
}
.login-card {
  background: #fff;
  border: 1px solid #dce5e0;
  border-radius: 14px;
  padding: 32px;
  margin: 48px auto;
  max-width: 430px;
}
.login-card h2 {
  margin-top: 12px;
}
.login-card label {
  font-size: 13px;
  margin: 20px 0 0;
}
.login-card input:not([type='checkbox']) {
  width: 100%;
}
.login-card button {
  width: 100%;
  margin-top: 26px;
}
.login-error {
  padding: 12px;
  background: #fff3e8;
  color: #934c20;
  border-radius: 8px;
  font-size: 13px;
}
#pairingResult {
  font-size: 16px;
  line-height: 1.8;
}
@media (max-width: 1050px) {
  .app-layout {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 20px;
  }
  .sidebar {
    padding-right: 14px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 30px;
  }
}
@media (max-width: 800px) {
  .app-layout {
    display: block;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8e0dd;
    padding: 8px 0 16px;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: static;
  }
  .sidebar a {
    padding: 10px 12px;
    font-size: 12px;
  }
  .sidebar .add-device-link {
    margin-top: 0;
  }
  .workspace .toolbar {
    margin-top: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .workspace .device-grid,
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    margin: 30px auto;
    padding: 24px;
  }
  .integration-endpoints {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .integration-endpoints dd {
    margin-bottom: 12px;
  }
}

.section-picker {
  display: none;
}
@media (max-width: 600px) {
  .sidebar nav {
    display: none;
  }
  .section-picker {
    display: block;
    margin: 0;
    font-size: 12px;
    color: #647772;
  }
  .section-picker select {
    display: block;
    width: 100%;
    background: #fff;
    margin-top: 6px;
    padding: 12px;
  }
}
