:root {
  --bg: #081224;
  --bg-2: #0c1730;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: rgba(255, 255, 255, 0.78);
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.18);
  --primary: #2563eb;
  --primary-2: #38bdf8;
  --safe: #16a34a;
  --warning: #f59e0b;
  --critical: #dc2626;
  --shadow-lg: 0 28px 70px rgba(2, 8, 23, 0.18);
  --shadow-md: 0 16px 34px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

html { scroll-behavior: smooth; }
body.app-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(56, 189, 248, 0.22), transparent 24%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.20), transparent 18%),
    linear-gradient(180deg, #071120 0%, #0c1630 30%, #edf4fc 30.1%, #eff5fc 100%);
  color: var(--text);
  padding-bottom: calc(5.9rem + env(safe-area-inset-bottom));
}

a { text-decoration: none; }
.app-shell { min-height: 100vh; }
.app-main { padding-top: 1.2rem; padding-bottom: 1.2rem; }

.app-navbar {
  background: rgba(6, 14, 28, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: #fff;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0.08rem;
  border-radius: 0.82rem;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  box-shadow: 0 12px 24px rgba(2, 8, 23, 0.25);
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0.74rem;
}

.brand-copy-wrap {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.02;
}

.brand-copy {
  color: #fff;
  font-weight: 800;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subcopy {
  color: rgba(255,255,255,0.65);
  font-size: 0.73rem;
  font-weight: 600;
  margin-top: 0.14rem;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.btn-nav,
.btn-install,
.btn-update {
  border-radius: 999px;
  font-weight: 700;
}

.btn-nav {
  padding: 0.55rem 1rem;
  color: rgba(255,255,255,0.84);
  border: 1px solid transparent;
  background: transparent;
}

.btn-nav:hover,
.btn-nav.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.btn-install,
.btn-update {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 0.95rem;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(37,99,235,0.14);
  box-shadow: var(--shadow-md);
}

.update-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #0f172a;
  font-weight: 700;
}

.hero-card,
.surface-card,
.metric-card,
.install-card,
.status-panel {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-card,
.surface-card,
.metric-card,
.install-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.46);
  backdrop-filter: blur(16px);
}

.hero-card,
.surface-card,
.metric-card {
  position: relative;
}

.hero-card::before,
.surface-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(56,189,248,0.95), rgba(37,99,235,0.90));
}

.compact-hero {
  padding: 1.35rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(247,250,255,0.90)),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 35%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  gap: 1.2rem;
  align-items: stretch;
}

.eyebrow {
  color: #38bdf8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.hero-title {
  font-size: clamp(1.8rem, 3vw + 0.8rem, 3rem);
  line-height: 1.06;
  font-weight: 900;
  max-width: 13ch;
  margin: 0 0 0.8rem;
}

.hero-copy,
.section-note,
.metric-note,
.install-card-subtitle,
.sheet-copy,
.text-secondary-emphasis {
  color: var(--muted) !important;
}

.hero-copy {
  font-size: 1rem;
  max-width: 60ch;
}

.hero-actions,
.hero-meta,
.status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-actions { margin-top: 1rem; }
.hero-meta { margin-top: 1rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.52rem 0.82rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255,255,255,0.70);
  color: #0f172a;
}

.chip-live {
  color: #fff;
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255,255,255,0.10);
  white-space: nowrap;
}

.chip-soft {
  color: #fff;
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.10);
}

.chip-soft-alt {
  color: #334155;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.16);
}

.chip-progress {
  color: #1d4ed8;
  background: rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.16);
}

.live-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.44);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.44); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.install-card {
  padding: 1.1rem;
  height: 100%;
}

.install-card-app {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,249,255,0.92));
  border-color: rgba(191,219,254,0.65);
  box-shadow: 0 22px 44px rgba(37,99,235,0.14);
}

.install-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.install-card-brand {
  width: 4rem;
  height: 4rem;
  padding: 0.26rem;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.80));
  box-shadow: 0 15px 28px rgba(37,99,235,0.16);
  flex: 0 0 auto;
}

.install-card-brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 1rem;
}

.install-card-title,
.section-title,
.section-title-lg,
.threshold-title,
.sheet-title {
  font-weight: 800;
}

.install-card-title { font-size: 1.08rem; }
.section-title { font-size: 1.08rem; }
.section-title-lg { font-size: clamp(1.35rem, 1.4vw + 1rem, 2rem); }

.install-quick-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.install-quick {
  padding: 0.76rem 0.6rem;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.1);
  text-align: center;
}

.install-quick small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.install-quick strong {
  display: block;
  font-size: 0.9rem;
}

.status-panel {
  padding: 1.4rem;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

.status-safe { background: linear-gradient(135deg, #15803d, #166534); }
.status-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #1f2937; }
.status-critical { background: linear-gradient(135deg, #dc2626, #991b1b); }
.status-no-reading { background: linear-gradient(135deg, #475569, #334155); }
.status-warning .chip-soft {
  color: #1f2937;
  background: rgba(255,255,255,0.58);
}

.status-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.84;
}

.status-value {
  font-size: clamp(2rem, 4vw + 0.8rem, 3.1rem);
  font-weight: 900;
  line-height: 1;
}

.threshold-box {
  padding: 1rem 1.05rem;
  border-radius: 1.1rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
}

.threshold-line {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.threshold-line + .threshold-line { margin-top: 0.55rem; }

.dot-safe,
.dot-warning,
.dot-critical {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 0.25rem;
}

.dot-safe { background: #22c55e; }
.dot-warning { background: #f59e0b; }
.dot-critical { background: #ef4444; }

.metric-card,
.surface-card { padding: 1.1rem; box-shadow: var(--shadow-md); }

.metric-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.metric-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.95rem;
  display: inline-grid;
  place-items: center;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  font-size: 1.08rem;
}

.metric-title {
  font-size: 1rem;
  font-weight: 800;
  color: #334155;
}

.metric-value {
  font-size: clamp(1.8rem, 1.4vw + 1.3rem, 2.5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 0.45rem;
}

.metric-unit {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.progress-modern {
  height: 0.92rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22,163,74,.14), rgba(245,158,11,.16), rgba(220,38,38,.18));
}

.progress-bar-modern {
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 58%, #ef4444 100%);
  transition: width 0.45s ease;
  box-shadow: 0 10px 24px rgba(37,99,235,0.18);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.health-list {
  display: grid;
  gap: 0;
}

.health-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.32);
}

.health-row:last-child { border-bottom: 0; }

.quick-action-stack {
  display: grid;
  gap: 0.8rem;
}

.quick-link-card {
  width: 100%;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(37,99,235,0.12);
  background: rgba(37,99,235,0.04);
  color: #0f172a;
  text-align: left;
}

.quick-link-card strong { display: block; }
.quick-link-card small { display: block; color: var(--muted); }
.quick-link-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.95rem;
  display: inline-grid;
  place-items: center;
  background: rgba(37,99,235,0.12);
  color: #1d4ed8;
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.chart-wrap { height: 320px; }

.table-modern thead th {
  white-space: nowrap;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom-width: 1px;
  border-color: rgba(148, 163, 184, 0.2);
}

.table-modern tbody td {
  border-color: rgba(148, 163, 184, 0.12);
  vertical-align: middle;
  white-space: nowrap;
}

.badge-soft-safe,
.badge-soft-warning,
.badge-soft-critical,
.badge-soft-no-reading {
  padding: 0.46rem 0.72rem;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge-soft-safe {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.16);
}
.badge-soft-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.18);
}
.badge-soft-critical {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.16);
}
.badge-soft-no-reading {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.18);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.54);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: end center;
  padding: 1rem;
  z-index: 1080;
}

.sheet-card {
  width: min(100%, 560px);
  border-radius: 1.4rem;
  background: #fff;
  box-shadow: 0 35px 70px rgba(2, 8, 23, 0.28);
  padding: 1.2rem;
}

.sheet-steps { display: grid; gap: 0.8rem; }
.sheet-step {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.82rem 0.92rem;
  border-radius: 1rem;
  background: #f8fafc;
}

.sheet-step-number {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
}

.mobile-bottom-nav {
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 1035;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.46rem;
  padding: 0.52rem;
  border-radius: 1.4rem;
  background: rgba(6,17,38,0.94);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(2,8,23,0.34);
}

.mobile-nav-link {
  min-height: 3.1rem;
  border: 0;
  border-radius: 1rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  color: rgba(255,255,255,0.72);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 700;
}

.mobile-nav-link i { font-size: 1rem; }
.mobile-nav-link.active,
.mobile-nav-link:hover {
  background: linear-gradient(135deg, rgba(56,189,248,.18), rgba(37,99,235,.22));
  color: #fff;
}
.mobile-install-trigger { color: #8be3ff; }
.mobile-bottom-nav.mobile-bottom-nav-two { grid-template-columns: repeat(2, 1fr); }

.compact-page-head { padding: 1.1rem; }

@media (max-width: 1199.98px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { max-width: none; }
}

@media (max-width: 991.98px) {
  body.app-body {
    background:
      radial-gradient(circle at top center, rgba(56, 189, 248, 0.20), transparent 23%),
      linear-gradient(180deg, #071120 0%, #0d1729 33%, #eef4fb 33.1%, #eef4fb 100%);
  }

  .app-main { padding-top: 1rem; }
  .nav-wrap { padding-top: 0.72rem; padding-bottom: 0.72rem; }
  .btn-install .install-label { display: none; }
  .btn-install { width: 2.1rem; height: 2.1rem; padding: 0; justify-content: center; }
  .compact-hero,
  .status-panel,
  .surface-card,
  .metric-card,
  .install-card { border-radius: 1.25rem; }
  .compact-hero,
  .surface-card,
  .metric-card { padding: 1rem; }
  .chart-wrap { height: 280px; }
}

@media (max-width: 767.98px) {
  .brand-subcopy { display: none; }
  .brand-copy { font-size: 0.9rem; max-width: 10rem; }
  .brand-mark { width: 1.92rem; height: 1.92rem; padding: 0.06rem; }
  .nav-actions { gap: 0.42rem; }
  .chip-live { padding: 0.44rem 0.68rem; font-size: 0.78rem; }
  .hero-title { font-size: clamp(1.45rem, 6vw, 1.95rem); }
  .hero-copy { font-size: 0.94rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-meta { gap: 0.42rem; }
  .hero-meta .chip { font-size: 0.74rem; padding: 0.42rem 0.6rem; }
  .install-card-head { gap: 0.7rem; }
  .install-card-brand { width: 3.4rem; height: 3.4rem; border-radius: 1rem; }
  .install-card-brand img { border-radius: 0.82rem; }
  .install-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.48rem; }
  .install-quick { padding: 0.68rem 0.4rem; border-radius: 0.9rem; }
  .status-panel { padding: 1rem; }
  .status-value { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .threshold-box { padding: 0.9rem; }
  .metric-value { font-size: 1.8rem; }
  .section-title-lg { font-size: 1.3rem; }
  .chart-wrap { height: 255px; }
  .sheet-card { width: min(100% - 0.4rem, 32rem); border-radius: 1.15rem; }
  .update-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 0.9rem;
  }
  .update-banner .btn-update { width: 100%; }
}

@media (max-width: 575.98px) {
  .app-main { padding-left: 0.75rem; padding-right: 0.75rem; }
  .brand-copy { max-width: 8.7rem; }
  .chip-live-text { max-width: 3.6rem; overflow: hidden; text-overflow: ellipsis; }
  .compact-hero { padding: 0.95rem; }
  .hero-actions { gap: 0.55rem; }
  .hero-meta .chip:nth-child(3) { display: none; }
  .metric-top { margin-bottom: 0.8rem; }
  .metric-icon { width: 2.4rem; height: 2.4rem; }
  .quick-link-card { padding: 0.82rem 0.9rem; }
  .table-responsive { margin-inline: -0.12rem; }
}
