:root {
  color-scheme: dark;
  --bg: #101820;
  --panel: #17232b;
  --panel-soft: #1d2b34;
  --line: #31434e;
  --text: #f3f7f3;
  --muted: #a8b7b7;
  --green: #72d18b;
  --gold: #e7bd66;
  --coral: #e77f6b;
  --sky: #77b7e5;
  --violet: #a892e8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(119, 183, 229, 0.18), transparent 32rem),
    linear-gradient(135deg, #101820 0%, #15251f 45%, #201b22 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 118px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(114, 209, 139, 0.38);
  border-radius: 999px;
  background: rgba(23, 35, 43, 0.72);
  color: #d8f7df;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(114, 209, 139, 0.14);
}

.search-row {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  margin: 28px 0 24px;
  padding: 12px 0;
  backdrop-filter: blur(18px);
}

.search {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(23, 35, 43, 0.82);
}

.search svg,
.device svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search svg {
  color: var(--muted);
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0 0 0 11px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.search input::placeholder {
  color: #7f9091;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  min-width: 46px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(23, 35, 43, 0.82);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.filter.active {
  border-color: rgba(114, 209, 139, 0.6);
  color: var(--text);
  background: rgba(114, 209, 139, 0.15);
}

.section {
  margin: 0 0 24px;
}

.section-title,
.location-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
}

h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.section-title span,
.location-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.locations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.location {
  min-width: 0;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.device {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(23, 35, 43, 0.76);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.device:hover,
.device:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(119, 183, 229, 0.52);
  background: rgba(29, 43, 52, 0.96);
  outline: 0;
}

.icon-box {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.device strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 36px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .search-row {
    grid-template-columns: 1fr;
  }

  .filters {
    justify-content: flex-start;
  }

  .favorites-grid,
  .locations {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .topbar {
    min-height: 98px;
    align-items: flex-start;
  }

  h1 {
    font-size: 4.1rem;
  }

  .status-pill {
    height: 34px;
    min-height: 34px;
    font-size: 0.78rem;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }
}
