.n-header,
.n-section,
.n-footer {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding-left: var(--n-pad-shell);
  padding-right: var(--n-pad-shell);
}

/* ── HEADER ────────────────────────────────────────────────── */
.n-header {
  padding-top: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--n-border-subtle);
}

.n-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.n-header-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* Minimal product mark — no emoji */
.n-header-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--n-radius-md);
  flex-shrink: 0;
  margin-top: 1px;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.35) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.theme-light .n-header-mark {
  border-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.2) 0%, rgba(14, 165, 233, 0.12) 100%);
}

.n-header-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary, #e8eaed);
}

.theme-light .n-header-title { color: #0f172a; }

.n-header-org {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.01em;
}

.n-header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.n-time-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.n-time-control--section {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--n-border-subtle);
  border-radius: var(--n-radius-md);
  background: var(--n-surface-raised);
}

.n-time-label {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  white-space: nowrap;
}

.n-time-help {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  line-height: 1.35;
}

.n-time-btns {
  display: flex;
  gap: 0;
  background: var(--n-surface-raised);
  border-radius: var(--n-radius-md);
  padding: 3px;
  border: 1px solid var(--n-border-subtle);
}

.n-time-btn {
  background: transparent;
  border: none;
  border-radius: var(--n-radius-sm);
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.n-time-btn:hover { color: var(--text-primary, #e2e8f0); background: rgba(255,255,255,0.06); }
.theme-light .n-time-btn:hover { color: #0f172a; background: rgba(15, 23, 42, 0.05); }

.n-time-btn--active {
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.theme-light .n-time-btn--active {
  background: #ecfdf5;
  color: #166534 !important;
  box-shadow: none;
}

.theme-coastal .n-time-btn--active {
  background: #d9f1f4;
  color: #075985 !important;
  box-shadow: none;
}

.theme-aqi .n-time-btn--active {
  background: #ffedd5;
  color: #9a3412 !important;
  box-shadow: none;
}

.n-connection-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.n-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: background 0.4s;
  flex-shrink: 0;
}

.n-status-dot.connected { background: #22c55e; box-shadow: none; }
.n-status-dot.stale     { background: #f59e0b; }
.n-status-dot.error     { background: #ef4444; }

.n-status-text {
  font-size: 0.77rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  max-width: min(22rem, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.n-connection-status[data-has-stale="true"] .n-status-text {
  color: var(--n-warn-text, #b45309);
}

.n-theme-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--n-surface-raised);
  border: 1px solid rgba(79, 195, 247, 0.45);
  border-radius: var(--n-radius-md);
  color: var(--n-accent-primary, #4fc3f7);
  min-height: 2.5rem;
  padding: 0.25rem 0.45rem 0.25rem 0.75rem;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.15);
}

.n-theme-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.8;
}

.n-theme-select {
  border: 0;
  border-left: 1px solid var(--n-border-subtle);
  background: transparent;
  color: var(--text-primary, #e2e8f0);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  outline: none;
}

.n-theme-select option {
  color: #0f172a;
  background: #ffffff;
}

@media (max-width: 640px) {
  .n-theme-control { width: 100%; justify-content: space-between; }
  .n-theme-select { flex: 1; }
}

.theme-light .n-theme-control,
.theme-coastal .n-theme-control,
.theme-aqi .n-theme-control {
  background: #fff;
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 1px 6px rgba(2, 132, 199, 0.12);
}

.theme-light .n-theme-control { color: #0369a1; }
.theme-coastal .n-theme-control { color: #087f8c; }
.theme-aqi .n-theme-control { color: #b45309; }

.theme-light .n-theme-select,
.theme-coastal .n-theme-select,
.theme-aqi .n-theme-select {
  color: var(--text-primary, #0f172a);
}

.n-theme-control:hover {
  background: rgba(79, 195, 247, 0.12);
  border-color: rgba(79, 195, 247, 0.75);
  box-shadow: 0 4px 14px rgba(79, 195, 247, 0.28);
}
.theme-light .n-theme-control:hover,
.theme-coastal .n-theme-control:hover {
  background: #ecfeff;
  border-color: rgba(2, 132, 199, 0.55);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18);
}
.theme-aqi .n-theme-control:hover {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.38);
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.16);
}

.n-theme-control:focus-within {
  outline: 2px solid var(--n-accent-primary, #4fc3f7);
  outline-offset: 3px;
}

.n-header-desc {
  margin: 1.35rem 0 0;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-muted, #64748b);
  line-height: 1.65;
  max-width: 42rem;
}

/* ── SECTION SCAFFOLD ──────────────────────────────────────── */
.n-section {
  padding-top: var(--n-section-y);
  padding-bottom: var(--n-section-y);
}

.n-section--alt {
  background: var(--bg-alt, rgba(255,255,255,0.02));
  /* Extend full width with side margin negative trick */
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  padding-left: max(2rem, calc(50vw - 760px));
  padding-right: max(2rem, calc(50vw - 760px));
}

.theme-light .n-section--alt { background: rgba(0,0,0,0.025); }

.n-section--collapsed-wrap {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.n-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.n-section-head-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.n-section-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary, #f1f5f9);
}

.theme-light .n-section-title { color: #0f172a; }

.n-section-sub {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted, #64748b);
  line-height: 1.55;
  max-width: 40rem;
}

/* ── PILLS ─────────────────────────────────────────────────── */
