/* ==========================================================================
   FarmOS v2 — Modern Mobile-First Glassmorphic Design System
   ========================================================================== */

:root {
  --bg-primary: #070b12;
  --bg-secondary: #0d1522;
  --bg-card: rgba(18, 26, 42, 0.75);
  --bg-card-hover: rgba(26, 38, 60, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;

  --glow-emerald: rgba(16, 185, 129, 0.25);
  --glow-amber: rgba(245, 158, 11, 0.25);
  --glow-blue: rgba(59, 130, 246, 0.25);
  --glow-purple: rgba(168, 85, 247, 0.25);

  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-height: 60px;
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 20px) + 20px);
  -webkit-font-smoothing: antialiased;
}

/* ─── Top App Header ────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 12px) + 8px) 16px 10px 16px;
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-emoji {
  font-size: 26px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-v2 {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.quick-status-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-live {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--accent-emerald); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.mode-segmented-ctrl {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2px;
  gap: 2px;
  margin-left: 6px;
}

.mode-seg-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-seg-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.mode-seg-btn:active {
  transform: scale(0.95);
}

.seg-icon {
  width: 12px;
  height: 12px;
}

@media (max-width: 480px) {
  .mode-segmented-ctrl { margin-left: 2px; }
  .mode-seg-btn { padding: 3px 6px; font-size: 10px; }
  .mode-seg-btn span { display: inline; }
}

.pill-icon {
  width: 14px;
  height: 14px;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.refresh-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-refresh:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.15);
}

.btn-refresh.spinning .refresh-spinner-wrap,
.btn-refresh.spinning svg,
.btn-refresh.spinning i,
.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pill-updated {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  transition: all 0.3s ease;
}

/* ─── Main Content Container ─────────────────────────────────────── */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 14px;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Glassmorphic Card Components ───────────────────────────────── */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.panel-card:hover {
  border-color: var(--border-active);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

/* ─── Overview Metrics Grid ──────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card-battery::before { background: var(--accent-emerald); }
.card-solar::before { background: var(--accent-amber); }
.card-weather::before { background: var(--accent-cyan); }
.card-commute::before { background: var(--accent-purple); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-icon {
  width: 16px;
  height: 16px;
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: capitalize;
}

.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.stat-main {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  line-height: 1;
}

.stat-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-bar-bg {
  background: rgba(255, 255, 255, 0.08);
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-amber { background: linear-gradient(90deg, #d97706, #f59e0b); }

/* ─── Power Flow Diagram ─────────────────────────────────────────── */
.power-flow-panel {
  padding-bottom: 20px;
}

.power-flow-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 10px 4px;
}

@media (max-width: 600px) {
  .power-flow-container {
    flex-direction: column;
    gap: 12px;
  }
  .flow-connector {
    transform: rotate(90deg);
    margin: 6px 0;
  }
  .flow-dual-target {
    flex-direction: row;
    gap: 16px;
  }
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.node-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: transform 0.2s;
}

.bg-amber-glow {
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid var(--accent-amber);
  color: var(--accent-amber);
  box-shadow: 0 0 16px var(--glow-amber);
}

.bg-blue-glow {
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 16px var(--glow-blue);
}

.bg-emerald-glow {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 16px var(--glow-emerald);
}

.bg-purple-glow {
  background: rgba(168, 85, 247, 0.15);
  border: 2px solid var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 0 16px var(--glow-purple);
}

.node-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.node-value {
  font-size: 15px;
  font-weight: 800;
  margin-top: 1px;
}

.node-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.flow-connector {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.flow-line {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.flow-dots {
  position: absolute;
  top: -2px;
  left: 0;
  width: 8px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent-amber);
  animation: flowMove 1.5s linear infinite;
}

@keyframes flowMove {
  0% { left: 0%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.flow-dual-target {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Camera Preview Strip & Cards ───────────────────────────────── */
.cam-preview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .cam-preview-strip {
    grid-template-columns: 1fr;
  }
}

.cam-mini-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.cam-mini-card:active {
  transform: scale(0.98);
}

.cam-mini-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #000;
}

.cam-mini-overlay {
  padding: 8px 10px;
  background: rgba(7, 11, 18, 0.85);
  backdrop-filter: blur(8px);
}

.cam-mini-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-mini-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}

/* ─── Camera Full Gallery & Lightbox ─────────────────────────────── */
.camera-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.cam-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.cam-tab-btn.active {
  background: var(--accent-cyan);
  color: #070b12;
  border-color: var(--accent-cyan);
}

.camera-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cam-full-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cam-full-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 66.66%; /* 3:2 aspect */
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.95) 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-full-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.cam-full-card:hover .cam-full-img {
  transform: scale(1.02);
}

.cam-badge-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.cam-full-info {
  padding: 12px 14px;
}

.cam-full-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cam-full-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.cam-full-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cam-gallery-pagination-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.btn-load-more-photos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 9999px;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more-photos:hover {
  background: var(--accent-cyan);
  color: #070b12;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  font-weight: 600;
  text-align: center;
}

.lightbox-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ─── Weather Tab Styles ─────────────────────────────────────────── */
.weather-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-weather-icon {
  font-size: 52px;
}

.hero-temp-row {
  display: flex;
  align-items: baseline;
}

.hero-temp {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1;
}

.hero-temp-unit {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-condition {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-right strong {
  color: #fff;
}

.hourly-forecast-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 0 4px 0;
  scrollbar-width: none;
}

.hourly-forecast-strip::-webkit-scrollbar {
  display: none;
}

.hourly-item {
  flex: 0 0 62px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.hourly-time {
  font-size: 11px;
  color: var(--text-muted);
}

.hourly-icon {
  font-size: 18px;
}

.hourly-temp {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.hourly-pop {
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 600;
}

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

@media (max-width: 500px) {
  .pws-stations-grid {
    grid-template-columns: 1fr;
  }
}

.pws-station-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pws-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pws-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.pws-dist {
  font-size: 11px;
  color: var(--accent-blue);
}

.pws-rainfall-row {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pws-rainfall-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.pws-rainfall-rate {
  font-size: 12px;
  color: var(--text-muted);
}

.daily-forecast-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.daily-day {
  width: 50px;
  font-weight: 600;
  color: var(--text-primary);
}

.daily-cond-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding-left: 10px;
}

.daily-temps {
  font-weight: 700;
  display: flex;
  gap: 8px;
}

.daily-hi { color: #fff; }
.daily-lo { color: var(--text-muted); }

/* ─── Operations & Tasks Tab ─────────────────────────────────────── */
.task-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.task-input-field {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.task-input-field:focus {
  border-color: var(--accent-emerald);
}

.btn-add-task {
  background: var(--accent-emerald);
  color: #070b12;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-task:active {
  transform: scale(0.97);
}

.task-filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.task-filter-pills {
  display: flex;
  gap: 6px;
}

.task-filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.task-filter-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.btn-sync-tasks {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.task-item.completed {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.02);
}

.task-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.task-item.completed .custom-checkbox {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.task-text {
  font-size: 14px;
  color: #fff;
  transition: color 0.2s;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.btn-delete-task {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.btn-delete-task:hover {
  color: var(--accent-rose);
}

.docs-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
}

.docs-footer-link a {
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ─── AI Assistant & Manuals Tab ─────────────────────────────────── */
.ai-qa-box {
  background: linear-gradient(145deg, rgba(21, 31, 50, 0.8), rgba(13, 21, 34, 0.9));
  border-color: rgba(168, 85, 247, 0.2);
}

.custom-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
}

.qa-input-row {
  display: flex;
  gap: 8px;
}

.qa-input-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.btn-primary-action {
  background: linear-gradient(135deg, var(--accent-purple), #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary-action:active {
  transform: scale(0.97);
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-purple);
  color: #fff;
}

.qa-html-content {
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
}

.qa-html-content h2, .qa-html-content h3 {
  color: #fff;
  margin: 12px 0 6px 0;
  font-size: 16px;
}

.qa-html-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.qa-html-content li {
  margin-bottom: 4px;
}

.manuals-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.manual-item-left {
  display: flex;
  flex-direction: column;
}

.manual-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.manual-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-download-manual {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── Bottom Navigation Bar (Thumb Zone) ─────────────────────────── */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(7, 11, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 900px;
  margin: 0 auto;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.2s;
  flex: 1;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--accent-emerald);
}

.nav-item.active svg {
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.92);
}

/* Utilities */
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-purple { color: var(--accent-purple) !important; }
.fw-bold { font-weight: 700; }
.loading-placeholder { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0; }
.btn-text-action { background: none; border: none; color: var(--accent-cyan); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.btn-icon-close { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.grid-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-3-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) {
  .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
}
.sub-metric-tile { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px; }
.sub-label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: block; }
.sub-value { font-size: 20px; font-weight: 800; margin-top: 4px; display: block; }
.sub-caption { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }
.tile-header-flex { display: flex; justify-content: space-between; align-items: center; }
.stat-highlight-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 600px) { .stat-highlight-row { grid-template-columns: repeat(2, 1fr); } }
.hl-item { display: flex; flex-direction: column; }
.hl-label { font-size: 11px; color: var(--text-muted); }
.hl-value { font-size: 22px; font-weight: 800; color: #fff; margin-top: 2px; }
.astro-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-top: 6px; }
.moon-phase-display { font-size: 14px; color: #fff; display: flex; align-items: center; gap: 6px; }

/* ─── 4-Column Responsive Grid ───────────────────────────────────── */
.grid-4-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 768px) {
  .grid-4-col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-4-col { grid-template-columns: 1fr; }
}

/* ─── NOAA Emergency Severe Weather Alert Banner ─────────────────── */
.emergency-alert-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.95), rgba(225, 29, 72, 0.9));
  border-bottom: 2px solid #fda4af;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
  position: relative;
  z-index: 90;
  animation: alert-pulse 2.5s infinite;
}
.emergency-alert-banner.alert-watch {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.9));
  border-bottom: 2px solid #fde68a;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}
@keyframes alert-pulse {
  0% { box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 25px rgba(244, 63, 94, 0.6); }
  100% { box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
}
.alert-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: 900px;
  margin: 0 auto;
}
.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-pulse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.alert-text-block {
  display: flex;
  flex-direction: column;
}
.alert-headline {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}
.alert-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}
.btn-alert-details {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.alert-expanded-content {
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 18px;
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.6;
}
.alert-expanded-item {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.alert-expanded-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ─── Morning Hub & Daily Console ────────────────────────────────── */
.morning-hub-panel {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.sarcastic-weather-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.sarcastic-icon {
  font-size: 20px;
  line-height: 1;
}
.sarcastic-text {
  font-size: 13px;
  font-weight: 500;
  color: #fef08a;
  line-height: 1.45;
}
.morning-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .morning-grid-split { grid-template-columns: 1fr; }
}
.morning-quote-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quote-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.quote-text {
  font-size: 12px;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.4;
}
.quote-author {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
  margin-top: 6px;
}

/* ─── Joke of the Day Card ───────────────────────────────────────── */
.morning-joke-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.joke-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.joke-header-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-new-joke {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-new-joke:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fff;
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-new-joke:active {
  transform: scale(0.92);
}

.joke-setup {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.45;
  margin: 0 0 6px 0;
}

.joke-punchline-wrap {
  margin-top: 6px;
}

.btn-reveal-punchline {
  background: rgba(16, 185, 129, 0.12);
  border: 1px dashed rgba(16, 185, 129, 0.45);
  color: var(--accent-emerald);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-reveal-punchline:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #fff;
  border-style: solid;
}

.joke-punchline-text {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.08);
  border-left: 2.5px solid var(--accent-emerald);
  border-radius: 0 6px 6px 0;
  margin: 0;
  animation: fadeIn 0.25s ease forwards;
}

.joke-category-tag {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.morning-apod-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  border: 1px solid var(--border-subtle);
  background: #000;
}
.apod-mini-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.morning-apod-card:hover .apod-mini-thumb {
  transform: scale(1.05);
}
.apod-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apod-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}
.apod-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.milestones-ticker-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.milestones-ticker-strip::-webkit-scrollbar {
  display: none;
}
.milestone-item {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.milestone-days {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
  min-width: 32px;
  text-align: center;
}
.milestone-info {
  display: flex;
  flex-direction: column;
}
.milestone-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.milestone-target {
  font-size: 10px;
  color: var(--text-muted);
}

/* ─── Device Battery Registry ────────────────────────────────────── */
.battery-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.battery-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  gap: 12px;
}
.battery-dev-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.battery-dev-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.battery-dev-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.battery-dev-type {
  font-size: 11px;
  color: var(--text-muted);
}
.battery-dev-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.battery-dev-val {
  font-size: 13px;
  font-weight: 700;
  min-width: 45px;
  text-align: right;
}
.badge-low {
  background: rgba(244, 63, 94, 0.15) !important;
  color: var(--accent-rose) !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

/* ─── Generator Flags & Soil Moisture ────────────────────────────── */
.generator-flags-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.gen-flag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.flag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.flag-dot.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.trafficability-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.traffic-title {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}
.traffic-desc {
  font-size: 13px;
  color: var(--accent-emerald);
}

/* ─── EC2 Diagnostics Strip ─────────────────────────────────────── */
.services-status-strip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.services-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.service-pills-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.svc-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.svc-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.svc-inactive {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

/* ─── Monolith Mode Styles ────────────────────────────────────────── */
body.mode-monolith .view-section {
  display: block !important;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  animation: none !important;
  scroll-margin-top: calc(var(--header-height) + 52px);
}

body.mode-monolith .view-section.section-hidden {
  display: none !important;
}

body.mode-monolith .view-section:last-of-type {
  border-bottom: none;
  margin-bottom: 16px;
}

body.mode-monolith .monolith-only-header {
  display: block;
}

body:not(.mode-monolith) .monolith-only-header {
  display: none;
}

/* Monolith Quick-Jump Anchor Bar */
.monolith-quicknav-bar {
  display: none;
  position: sticky;
  top: var(--header-height);
  z-index: 85;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 16px 0;
  width: 100%;
  box-sizing: border-box;
}

.monolith-quicknav-bar::-webkit-scrollbar {
  display: none;
}

body.mode-monolith .monolith-quicknav-bar {
  display: block;
}

.quicknav-inner {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  white-space: nowrap;
}

.quicknav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quicknav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.quicknav-btn.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--accent-emerald);
  font-weight: 600;
}

.quicknav-btn i {
  width: 13px;
  height: 13px;
}

/* Floating Back-to-Top Button */
.btn-back-to-top {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 20px) + 14px);
  z-index: 150;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.25s ease;
}

.btn-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-back-to-top:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-back-to-top:active {
  transform: scale(0.9);
  background: rgba(16, 185, 129, 0.3);
}

.btn-back-to-top svg {
  width: 20px;
  height: 20px;
}



/* ══════════════════════════════════════════════════════════════════════════
   FARMOS V1 PARITY & ENHANCED VISUAL MODULES
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Health & Safety Emergency Card ─────────────────────────────────────── */
.health-safety-card {
  border-color: rgba(244, 63, 94, 0.25);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.04) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.health-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.15));
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.health-call-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.hospital-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.hospital-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hospital-info {
  flex: 1;
}

.hospital-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hospital-dist {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hospital-call-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
  padding: 5px 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.hospital-call-link:hover {
  background: var(--cyan);
  color: #000;
}

.emergency-meta-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 11px;
}

.emergency-meta-tile {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
}

.emergency-meta-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.emergency-meta-val {
  font-weight: 700;
  color: var(--text-bright);
}

.emergency-meta-val a {
  color: var(--cyan);
  text-decoration: none;
}

/* ─── Waze Live Map Button ───────────────────────────────────────────────── */
.waze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.waze-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  color: #fff;
  transform: translateY(-1px);
}

/* ─── Featured Camera Player & Filmstrip ─────────────────────────────────── */
.cam-nav-tab-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-bottom: 12px;
}

.cam-nav-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cam-nav-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.cam-nav-tab.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--cyan);
}

.cam-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
  transition: all 0.2s;
}

.cam-tab-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.cam-tab-dot.offline {
  background: #ef4444;
}

.cam-telemetry-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .cam-telemetry-panel {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cam-stat-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
}

.cam-stat-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.cam-stat-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cam-stat-val {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-bright);
}

.cam-stat-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-viewport-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  margin-bottom: 10px;
}

.cam-viewport-container #cam-active-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 440px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cam-viewport-container:hover #cam-active-img {
  transform: scale(1.008);
}

.cam-fs-btn-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.cam-fs-btn-overlay:hover {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

.cam-filmstrip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cam-thumbs-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.cam-thumb-card {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  transition: all 0.2s ease;
}

.cam-thumb-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.cam-thumb-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.4);
}

.cam-thumb-card img {
  width: 80px;
  height: 52px;
  object-fit: cover;
  display: block;
}

.cam-thumb-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  font-size: 9px;
  color: #fff;
  padding: 1px 4px;
  text-align: center;
  font-family: var(--font-mono);
}

/* ─── UV Index Rich Card & Spectrum ──────────────────────────────────────── */
.uv-source-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.uv-source-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.uv-source-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-bright);
}

.uv-hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.uv-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.uv-score-val {
  font-size: 26px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--emerald);
  line-height: 1;
}

.uv-score-label {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.uv-meta-container {
  flex: 1;
  min-width: 0;
}

.uv-cat-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.uv-peak-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-weight: 700;
  font-family: var(--font-mono);
}

.uv-advice-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.uv-spectrum-wrapper {
  margin-bottom: 14px;
  padding: 0 4px;
}

.uv-spectrum-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #10b981 0%, #10b981 25%, #f59e0b 25%, #f59e0b 50%, #f97316 50%, #f97316 67%, #ef4444 67%, #ef4444 90%, #8b5cf6 90%, #8b5cf6 100%);
  margin-bottom: 8px;
}

.uv-marker {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #fff;
  line-height: 1;
  transition: left 0.5s ease;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

.uv-spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.uv-forecast-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.uv-forecast-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  flex-shrink: 0;
}

.uv-f-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.uv-f-val {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* ─── AQI Rich Card & 6 Pollutants Grid ──────────────────────────────────── */
.aqi-hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.aqi-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.aqi-score-val {
  font-size: 26px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--emerald);
  line-height: 1;
}

.aqi-score-label {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.aqi-meta-container {
  flex: 1;
  min-width: 0;
}

.aqi-cat-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aqi-advice-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.aqi-spectrum-wrapper {
  margin-bottom: 14px;
  padding: 0 4px;
}

.aqi-spectrum-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #10b981 0%, #10b981 25%, #f59e0b 25%, #f59e0b 50%, #f97316 50%, #f97316 75%, #ef4444 75%, #ef4444 100%);
  margin-bottom: 8px;
}

.aqi-marker {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #fff;
  line-height: 1;
  transition: left 0.5s ease;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

.aqi-spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.aqi-pollutants-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 520px) {
  .aqi-pollutants-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.aqi-pollutant-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
}

.aqi-p-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aqi-p-type {
  font-size: 8px;
  color: var(--text-muted);
  font-weight: normal;
}

.aqi-p-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-bright);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.aqi-p-aqi {
  font-size: 9px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-top: 1px;
}

/* ─── Task Completion Progress Bar ───────────────────────────────────────── */
.tasks-progress-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tasks-progress-bar-wrap {
  flex: 1;
  margin-left: 12px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.tasks-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ─── Debug & Feeds Utility Section ──────────────────────────────────────── */
.debug-feeds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .debug-feeds-grid {
    grid-template-columns: 1fr;
  }
}

.debug-feed-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.debug-feed-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.debug-link-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.debug-link-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.debug-link-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── API Intelligence & Latency Plotter ──────────────────────────── */
.api-intelligence-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.api-intel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.api-intel-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.api-intel-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.api-intel-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-benchmark-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-benchmark-all:hover {
  background: var(--accent-cyan);
  color: #020617;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.api-intel-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .api-intel-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

.api-kpi-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.api-kpi-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-kpi-num {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-latency-plot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.api-plot-row {
  display: grid;
  grid-template-columns: 180px 1fr 75px 65px 60px 28px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.api-plot-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .api-plot-row {
    grid-template-columns: 130px 1fr 60px 52px 24px;
  }
  .api-plot-row .plot-size-text {
    display: none;
  }
}

.plot-name-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.plot-api-link {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plot-api-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.plot-category-tag {
  font-size: 8.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

.plot-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.plot-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
}

.bar-emerald {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.6), #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.bar-cyan {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.6), #06b6d4);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.bar-amber {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.6), #f59e0b);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.bar-rose {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.6), #f43f5e);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.plot-ms-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.plot-status-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.plot-status-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.plot-status-err {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.plot-size-text {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
}

.btn-single-test {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-single-test:hover {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
}

.raw-apis-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.api-pill-link {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 3px 8px;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.2s;
}

.api-pill-link:hover {
  background: var(--cyan);
  color: #000;
}

/* ==========================================================================
   SYSTEM SETTINGS MODAL & WIDGET CUSTOMIZATION
   ========================================================================== */

.btn-settings {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-settings:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--cyan);
}

.btn-settings:active {
  transform: scale(0.9);
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.settings-modal-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 22px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  color: #fff;
  scrollbar-width: thin;
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.settings-modal-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.3px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-close-x {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-close-x:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-label {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
}

.settings-num-input {
  width: 76px;
  padding: 6px 10px;
  background: #121826;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.settings-num-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.settings-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
  cursor: pointer;
  border-radius: 4px;
}

.settings-emergency-wrap {
  margin: 18px 0 16px 0;
}

.settings-call-911-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(239, 68, 68, 0.14);
  border: 1.5px solid #ef4444;
  color: #f87171;
  padding: 13px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}

.settings-call-911-btn:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px 0 16px 0;
}

.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-reset-order {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-order:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.settings-section-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.settings-subtabs-wrap {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-subtab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.settings-subtab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.widget-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.widget-reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.widget-reorder-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.widget-reorder-item.disabled-widget {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.2);
}

.widget-reorder-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.widget-reorder-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-reorder-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-arrow-move {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-arrow-move:hover:not(:disabled) {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

.btn-arrow-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.settings-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-settings-cancel {
  background: #151a26;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-settings-cancel:hover {
  background: #1e2433;
  color: #fff;
}

.btn-settings-save {
  background: var(--cyan);
  border: none;
  color: #020617;
  padding: 9px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.btn-settings-save:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Quick Hide Eye Icon on Cards */
.btn-widget-quick-hide {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.2s ease;
  margin-left: 6px;
}

.btn-widget-quick-hide:hover {
  opacity: 1;
  color: var(--rose);
  background: rgba(244, 63, 94, 0.12);
}

.btn-widget-quick-hide svg {
  width: 14px;
  height: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  animation: slideUpToast 0.25s ease forwards;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-undo-btn {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.toast-undo-btn:hover {
  background: var(--cyan);
  color: #000;
}

/* ══════════════════════════════════════════════════════════════════════════
   DAILY DEVOTIONAL & THIS DAY IN HISTORY
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Daily Devotional & Scripture ───────────────────────────────── */
.devotional-panel {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.08), rgba(15, 23, 42, 0.8));
  border-color: rgba(6, 182, 212, 0.25);
}

.devotional-votd-box {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.votd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.votd-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 5px;
}

.votd-ref {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.votd-text {
  font-size: 13px;
  font-style: italic;
  color: #f1f5f9;
  line-height: 1.5;
  margin: 0;
  border-left: 3px solid var(--accent-cyan);
  padding-left: 10px;
}

.devotional-reflection-body {
  display: flex;
  flex-direction: column;
}

.devotional-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.devotional-meta-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.devotional-text {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0 0 10px 0;
}

.devotional-prayer-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.prayer-label {
  font-size: 11px;
  font-weight: 700;
  color: #fef08a;
  display: block;
  margin-bottom: 3px;
}

.prayer-text {
  font-size: 12px;
  color: #e2e8f0;
  font-style: italic;
  line-height: 1.45;
  margin: 0;
}

.devotional-footer-links {
  display: flex;
  justify-content: flex-end;
}

.btn-devotional-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-devotional-link:hover {
  background: var(--accent-cyan);
  color: #020617;
}

/* ─── This Day in History ────────────────────────────────────────── */
.history-panel {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.08), rgba(15, 23, 42, 0.8));
  border-color: rgba(245, 158, 11, 0.25);
}

.history-events-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.history-event-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  align-items: flex-start;
  transition: all 0.2s ease;
  overflow: hidden;
}

.history-event-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(245, 158, 11, 0.3);
}

.history-event-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 58px;
}

.history-year-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.history-event-content {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
  overflow: hidden;
}

.history-event-thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-event-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 48px !important;
  max-height: 48px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 5px;
}

.history-event-text-block {
  flex: 1;
  min-width: 0;
}

.history-event-text {
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.45;
  margin: 0;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.history-event-link {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.history-event-link:hover {
  text-decoration: underline;
}

.history-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history-source-tag {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-history-shuffle {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-history-shuffle:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fff;
}

