/* Browser Fingerprint Checker - Visual & Minimal UI */
:root {
  --bfp-primary: #007aff;
  --bfp-primary-dark: #005ecb;
  --bfp-indigo: #5856d6;
  --bfp-green: #16a34a;
  --bfp-green-bg: #ecfdf3;
  --bfp-amber: #d97706;
  --bfp-amber-bg: #fffbeb;
  --bfp-red: #dc2626;
  --bfp-red-bg: #fef2f2;
  --bfp-text: #0f172a;
  --bfp-muted: #64748b;
  --bfp-border: #e2e8f0;
  --bfp-surface: #ffffff;
  --bfp-bg: #f4f7fb;
  --bfp-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bfp-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bfp-bg);
  color: var(--bfp-text);
  line-height: 1.45;
  overflow-x: clip;
}

.bfp-main {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 52px;
}

/* Header + Visual Gauge Hero */
.bfp-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--bfp-shadow);
  margin-bottom: 16px;
}

.bfp-hero-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.bfp-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bfp-hero h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.bfp-local-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bfp-green-bg);
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.bfp-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}

.bfp-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bfp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--bfp-border);
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.bfp-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.bfp-btn-primary {
  background: var(--bfp-primary);
  border-color: var(--bfp-primary);
  color: #ffffff;
}

.bfp-btn-primary:hover {
  background: var(--bfp-primary-dark);
  border-color: var(--bfp-primary-dark);
}

.bfp-btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 8px;
}

.bfp-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--bfp-border);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.bfp-mode-toggle input {
  accent-color: var(--bfp-primary);
  width: 14px;
  height: 14px;
}

/* Visual Hero Summary Row */
.bfp-hero-visuals {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
  align-items: stretch;
}

.bfp-ring-card {
  background: #ffffff;
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bfp-ring-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
}

.bfp-ring-wrap svg {
  width: 82px;
  height: 82px;
  transform: rotate(-90deg);
}

.bfp-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.bfp-ring-pct {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.bfp-ring-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--bfp-muted);
  text-transform: uppercase;
}

.bfp-ring-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bfp-id-code {
  font-family: var(--bfp-mono);
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.bfp-hero-identity {
  background: #ffffff;
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.bfp-mini-stat {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.bfp-stat-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.bfp-stat-k {
  font-size: 11px;
  font-weight: 700;
  color: var(--bfp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bfp-stat-v {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bfp-stat-s {
  font-size: 11.5px;
  color: var(--bfp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* IP & Location Strip */
.bfp-ip-strip {
  background: var(--bfp-surface);
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 13px 16px;
  box-shadow: var(--bfp-shadow);
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.bfp-ip-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bfp-ip-k {
  font-size: 11px;
  font-weight: 700;
  color: var(--bfp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bfp-ip-v {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visual Infographic Widget Grid */
.bfp-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.bfp-widget {
  background: var(--bfp-surface);
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: var(--bfp-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.bfp-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bfp-widget-title {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Visual Screen Mockup */
.bfp-screen-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
}

.bfp-screen-frame {
  width: 92px;
  height: 58px;
  border: 2px solid #334155;
  border-radius: 6px;
  background: #dbeafe;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bfp-screen-inner {
  background: #ffffff;
  border: 1px solid #3b82f6;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Visual Hardware Bars */
.bfp-hw-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bfp-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.bfp-bar-label {
  width: 44px;
  color: var(--bfp-muted);
  flex-shrink: 0;
}

.bfp-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bfp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #007aff, #5856d6);
  width: 0%;
  transition: width 0.5s ease;
}

.bfp-bar-val {
  min-width: 52px;
  text-align: right;
  color: #0f172a;
}

/* Visual Battery + Signal */
.bfp-power-net-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bfp-visual-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Visual Analog Clock + Timezone */
.bfp-clock-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
}

.bfp-clock-svg {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

/* Pills & Tags Row */
.bfp-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bfp-chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
}

.bfp-chip-yes {
  background: var(--bfp-green-bg);
  color: #166534;
}

.bfp-chip-no {
  background: #f1f5f9;
  color: #94a3b8;
}

.bfp-chip-warn {
  background: var(--bfp-red-bg);
  color: var(--bfp-red);
}

/* Live Visual Probes Row (Canvas / WebGL / Audio) */
.bfp-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.bfp-visual-card {
  background: var(--bfp-surface);
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--bfp-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bfp-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bfp-visual-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.bfp-preview-box {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 98px;
  overflow: hidden;
}

.bfp-preview-box canvas,
.bfp-preview-box svg {
  max-width: 100%;
  height: auto;
  border-radius: 7px;
  display: block;
}

.bfp-visual-foot {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bfp-visual-hash {
  font-family: var(--bfp-mono);
  font-size: 11px;
  background: #f1f5f9;
  padding: 5px 8px;
  border-radius: 7px;
  word-break: break-all;
}

/* Compact Details Drawer + Filter Strip */
.bfp-details-box {
  background: var(--bfp-surface);
  border: 1px solid var(--bfp-border);
  border-radius: 20px;
  box-shadow: var(--bfp-shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.bfp-details-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--bfp-border);
}

.bfp-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bfp-cat-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bfp-cat-pill.active {
  background: var(--bfp-primary);
  border-color: var(--bfp-primary);
  color: #ffffff;
}

.bfp-search-input {
  width: 220px;
  max-width: 100%;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.bfp-search-input:focus {
  border-color: var(--bfp-primary);
}

.bfp-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #e2e8f0;
}

.bfp-compact-cell {
  background: #ffffff;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bfp-compact-cell[hidden] {
  display: none;
}

.bfp-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bfp-cell-k {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bfp-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.bfp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bfp-dot-high { background: var(--bfp-red); }
.bfp-dot-medium { background: var(--bfp-amber); }
.bfp-dot-protected { background: var(--bfp-green); }
.bfp-dot-low { background: #94a3b8; }

.bfp-cell-v {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.bfp-cell-api {
  font-family: var(--bfp-mono);
  font-size: 10.5px;
  color: #64748b;
  word-break: break-word;
}

.bfp-chip-panel {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fafcff;
}

.bfp-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.bfp-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 170px;
  overflow-y: auto;
}

.bfp-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
}

/* Badges */
.bfp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.bfp-badge-high { background: var(--bfp-red-bg); color: var(--bfp-red); }
.bfp-badge-medium { background: var(--bfp-amber-bg); color: var(--bfp-amber); }
.bfp-badge-low { background: #f1f5f9; color: #475569; }
.bfp-badge-protected { background: var(--bfp-green-bg); color: var(--bfp-green); }

/* Developer Strip & Diff */
.bfp-tech-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #c7d2fe;
}

.bfp-tech-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.bfp-hash-full {
  font-family: var(--bfp-mono);
  font-size: 11.5px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 9px;
  word-break: break-all;
}

.bfp-subhash-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.bfp-subhash-item {
  background: #f8fafc;
  border: 1px solid var(--bfp-border);
  border-radius: 9px;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}

.bfp-subhash-name {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--bfp-muted);
}

.bfp-subhash-code {
  display: block;
  font-family: var(--bfp-mono);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bfp-diff-panel {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 12px 14px;
}

.bfp-diff-panel[hidden],
.bfp-dev-only[hidden] {
  display: none !important;
}

.bfp-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.bfp-diff-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.bfp-diff-item {
  font-size: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 8px;
}

.bfp-diff-old { color: var(--bfp-red); font-family: var(--bfp-mono); }
.bfp-diff-new { color: var(--bfp-green); font-family: var(--bfp-mono); }

/* Tiny Collapsible FAQ */
.bfp-faq-wrap {
  background: #ffffff;
  border: 1px solid var(--bfp-border);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--bfp-shadow);
}

.bfp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.bfp-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.bfp-faq-q {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.bfp-faq-a {
  display: none;
  padding: 0 14px 12px;
  font-size: 13px;
  color: #475569;
}

.bfp-faq-item.open .bfp-faq-a {
  display: block;
}

.bfp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}

.bfp-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.bfp-disclaimer {
  max-width: 1160px;
  margin: 0 auto 20px;
  padding: 10px 16px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

@media (max-width: 1024px) {
  .bfp-hero-visuals {
    grid-template-columns: 1fr;
  }
  .bfp-ip-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bfp-hero-identity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bfp-widget-grid,
  .bfp-visual-grid {
    grid-template-columns: 1fr;
  }
  .bfp-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bfp-subhash-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bfp-main {
    padding: 12px 10px 40px;
  }
  .bfp-hero {
    padding: 15px 14px;
  }
  .bfp-hero-identity,
  .bfp-ip-strip,
  .bfp-compact-grid,
  .bfp-power-net-stage {
    grid-template-columns: 1fr;
  }
  .bfp-search-input {
    width: 100%;
  }
  .bfp-subhash-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
