/* ── Container ── */
.container {
  width: 340px;
  padding: 14px 20px 16px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: background 0.2s, color 0.2s;
}

/* ── Theme ── */
.dark {
  background: #0f172a;
  color: #e2e8f0;
}

.light {
  background: #f8fafc;
  color: #1e293b;
}

/* ── Header ── */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-align: center;
}

.icons {
  display: flex;
  gap: 4px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.icons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.dark .icons button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.light .icons button:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ── Main / Power Button ── */
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.power {
  width: 80px;
  height: 80px;
  font-size: 38px;
  line-height: 1;
  padding-top: 2px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark .power {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

.dark .power:hover {
  transform: scale(1.06);
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.5);
}

.light .power {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.25);
}

.light .power:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

.power:active {
  transform: scale(0.96);
}

/* Power button states */
.power.scanning {
  animation: pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

.dark .power.leak {
  background: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.4);
}

.dark .power.clean {
  background: #22c55e;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

.light .power.leak {
  background: #dc2626;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
}

.light .power.clean {
  background: #16a34a;
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.3);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.7; }
}

.main h2 {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
  text-align: center;
}

/* ── Cards ── */
.card {
  border-radius: 5px;
  padding: 10px 14px;
  margin-top: 8px;
}

.dark .card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.light .card {
  background: #fff;
  border: 1px solid #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
  margin-bottom: 6px;
}

/* ── Settings Labels / Toggles ── */
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  cursor: pointer;
}

label + label {
  border-top: 1px solid rgba(128, 128, 128, 0.1);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.dark input[type="checkbox"] {
  background: rgba(255, 255, 255, 0.12);
}

.light input[type="checkbox"] {
  background: #cbd5e1;
}

input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

input[type="checkbox"]:checked {
  background: #3b82f6;
}

input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

/* ── Background Scan Button ── */
.card button {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.dark .card button {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.dark .card button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.light .card button {
  background: #e2e8f0;
  color: #1e293b;
}

.light .card button:hover {
  background: #cbd5e1;
}

.card button:active {
  transform: scale(0.98);
}

/* ── Scan Data Text ── */
.card p {
  font-size: 12px;
  padding: 3px 0;
  opacity: 0.85;
  word-break: break-all;
}

.card p + p {
  border-top: 1px solid rgba(128, 128, 128, 0.08);
}

.no-data {
  text-align: center;
  opacity: 0.4;
  font-style: italic;
}

/* ── Status Banner ── */
.status-banner {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.status-banner.leak {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-banner.clean {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

/* ── Vector Rows ── */
.vector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
}

.vector-row + .vector-row {
  border-top: 1px solid rgba(128, 128, 128, 0.08);
}

.vector-label {
  font-weight: 600;
  opacity: 0.6;
  min-width: 50px;
  flex-shrink: 0;
}

.vector-value {
  flex: 1;
  word-break: break-all;
  opacity: 0.85;
}

.vector-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.vector-badge.leak {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.vector-badge.clean {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

/* ── Countdown ── */
.countdown {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  margin-top: 6px;
}

/* ── Interval selector ── */
.interval-label {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  margin-top: 4px;
}

.interval-select {
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.2);
  cursor: pointer;
  margin-left: 10px;
  font-family: inherit;
}

.dark .interval-select {
  background: #1e293b;
  color: #e2e8f0;
}

.light .interval-select {
  background: #f1f5f9;
  color: #1e293b;
}