/* ===================================================
   BioFigures Interactive Plugin - Main Stylesheet
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bio-bg: #0a0e1a;
  --bio-surface: #111827;
  --bio-surface2: #1a2236;
  --bio-surface3: #1f2d40;
  --bio-border: #243048;
  --bio-border-bright: #2d3d5a;
  --bio-text: #e2e8f4;
  --bio-text-muted: #7a8aaa;
  --bio-text-dim: #4a5a78;
  --bio-accent: #38bdf8;
  --bio-accent2: #34d399;
  --bio-accent3: #f59e0b;
  --bio-accent4: #a78bfa;
  --bio-danger: #f43f5e;
  --bio-radius: 12px;
  --bio-radius-sm: 8px;
  --bio-radius-lg: 18px;
  --bio-shadow: 0 8px 32px rgba(0,0,0,0.5);
  --bio-shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --bio-font: 'Space Grotesk', system-ui, sans-serif;
  --bio-mono: 'JetBrains Mono', monospace;
  --bio-transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

.bio-theme-light {
  --bio-bg: #f0f4ff;
  --bio-surface: #ffffff;
  --bio-surface2: #f5f7ff;
  --bio-surface3: #eef1fa;
  --bio-border: #d0d9f0;
  --bio-border-bright: #b0bde8;
  --bio-text: #1a2236;
  --bio-text-muted: #5a6a8a;
  --bio-text-dim: #9aaac8;
}

/* ===================== LIBRARY WRAPPER ===================== */
.bio-figures-library {
  font-family: var(--bio-font);
  background: var(--bio-bg);
  color: var(--bio-text);
  border-radius: var(--bio-radius-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bio-border);
  box-shadow: var(--bio-shadow);
}

.bfl-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: inherit;
}

/* ===================== HEADER ===================== */
.bfl-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0d1526 0%, #111f38 100%);
  border-bottom: 1px solid var(--bio-border);
  flex-wrap: wrap;
}

.bfl-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bfl-logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(56,189,248,0.5));
}

.bfl-logo-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.bfl-logo-sub {
  font-size: 10px;
  color: var(--bio-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.bfl-header-center {
  flex: 1;
  min-width: 200px;
}

.bfl-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bfl-search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
}

.bfl-search {
  width: 100%;
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  border-radius: 50px;
  padding: 10px 40px 10px 36px;
  color: var(--bio-text);
  font-family: var(--bio-font);
  font-size: 14px;
  outline: none;
  transition: var(--bio-transition);
}

.bfl-search:focus {
  border-color: var(--bio-accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
  background: var(--bio-surface);
}

.bfl-search::placeholder { color: var(--bio-text-dim); }

.bfl-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--bio-text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: 50%;
  display: none;
  line-height: 1;
}

.bfl-search-clear:hover { background: var(--bio-surface3); color: var(--bio-text); }
.bfl-search.has-value ~ .bfl-search-clear { display: block; }

.bfl-grade-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bfl-grade-pill {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text-muted);
  border-radius: 50px;
  padding: 6px 14px;
  font-family: var(--bio-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--bio-transition);
  white-space: nowrap;
}

.bfl-grade-pill:hover, .bfl-grade-pill.active {
  background: var(--bio-accent);
  border-color: var(--bio-accent);
  color: #000;
}

.bfl-grade-pill.bfl-ap.active {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-color: #f59e0b;
  color: #fff;
}

/* ===================== UNIT BAR ===================== */
.bfl-unit-bar {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  background: var(--bio-surface);
  border-bottom: 1px solid var(--bio-border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bio-border) transparent;
}

.bfl-unit-bar::-webkit-scrollbar { height: 3px; }
.bfl-unit-bar::-webkit-scrollbar-track { background: transparent; }
.bfl-unit-bar::-webkit-scrollbar-thumb { background: var(--bio-border); border-radius: 2px; }

.bfl-unit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text-muted);
  border-radius: var(--bio-radius-sm);
  padding: 7px 14px;
  font-family: var(--bio-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--bio-transition);
  white-space: nowrap;
}

.bfl-unit-btn:hover {
  border-color: var(--unit-color, var(--bio-accent));
  color: var(--unit-color, var(--bio-accent));
  background: color-mix(in srgb, var(--unit-color, var(--bio-accent)) 10%, transparent);
}

.bfl-unit-btn.active {
  background: color-mix(in srgb, var(--unit-color, var(--bio-accent)) 20%, transparent);
  border-color: var(--unit-color, var(--bio-accent));
  color: var(--unit-color, var(--bio-accent));
  font-weight: 600;
}

/* ===================== TOOLBAR ===================== */
.bfl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bio-surface);
  border-bottom: 1px solid var(--bio-border);
}

.bfl-results-count {
  font-size: 13px;
  color: var(--bio-text-muted);
}

.bfl-count-num {
  font-weight: 700;
  color: var(--bio-accent);
  font-size: 16px;
}

.bfl-toolbar-right { display: flex; align-items: center; gap: 10px; }

.bfl-sort {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text);
  border-radius: var(--bio-radius-sm);
  padding: 6px 10px;
  font-family: var(--bio-font);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.bfl-view-toggle { display: flex; border: 1.5px solid var(--bio-border); border-radius: var(--bio-radius-sm); overflow: hidden; }

.bfl-view-btn {
  background: var(--bio-surface2);
  border: none;
  color: var(--bio-text-muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--bio-transition);
}

.bfl-view-btn.active {
  background: var(--bio-accent);
  color: #000;
}

/* ===================== BODY LAYOUT ===================== */
.bfl-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ===================== FIGURES PANEL ===================== */
.bfl-figures-panel {
  width: 380px;
  flex-shrink: 0;
  border-right: 1px solid var(--bio-border);
  overflow-y: auto;
  background: var(--bio-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--bio-border) transparent;
}

.bfl-figures-panel::-webkit-scrollbar { width: 4px; }
.bfl-figures-panel::-webkit-scrollbar-track { background: transparent; }
.bfl-figures-panel::-webkit-scrollbar-thumb { background: var(--bio-border); border-radius: 2px; }

/* ===================== GRID VIEW ===================== */
.bfl-figures-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bfl-figures-grid.list-view {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* ===================== FIGURE CARD ===================== */
.bfl-figure-card {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  border-radius: var(--bio-radius);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--bio-transition);
  position: relative;
  overflow: hidden;
}

.bfl-figure-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-color, var(--bio-accent));
  opacity: 0;
  transition: var(--bio-transition);
}

.bfl-figure-card:hover::before,
.bfl-figure-card.active::before { opacity: 1; }

.bfl-figure-card:hover {
  border-color: var(--card-color, var(--bio-accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.bfl-figure-card.active {
  border-color: var(--card-color, var(--bio-accent));
  background: color-mix(in srgb, var(--card-color, var(--bio-accent)) 12%, var(--bio-surface2));
  box-shadow: 0 0 0 1px var(--card-color, var(--bio-accent)), 0 8px 24px rgba(0,0,0,0.3);
}

.bfl-card-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.bfl-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--bio-text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.bfl-card-unit {
  font-size: 10px;
  color: var(--bio-text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bfl-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.bfl-diff-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bfl-diff-basic    { background: rgba(52,211,153,0.15); color: #34d399; }
.bfl-diff-intermediate { background: rgba(245,158,11,0.15); color: #f59e0b; }
.bfl-diff-advanced { background: rgba(244,63,94,0.15); color: #f43f5e; }

.bfl-card-grades {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.bfl-card-grade {
  font-size: 9px;
  color: var(--bio-text-dim);
  background: var(--bio-surface3);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

/* LIST VIEW CARDS */
.list-view .bfl-figure-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.list-view .bfl-card-icon { font-size: 20px; margin: 0; flex-shrink: 0; }

.list-view .bfl-card-body { flex: 1; min-width: 0; }

.list-view .bfl-card-meta { margin-top: 4px; }

/* GROUP HEADERS */
.bfl-group-header {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bio-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bfl-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bio-border);
}

/* LOADING & EMPTY */
.bfl-loading, .bfl-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--bio-text-muted);
  font-size: 14px;
}

.bfl-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bio-border);
  border-top-color: var(--bio-accent);
  border-radius: 50%;
  animation: bfl-spin 0.8s linear infinite;
}

@keyframes bfl-spin { to { transform: rotate(360deg); } }

/* ===================== VIEWER PANEL ===================== */
.bfl-viewer-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bio-bg);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--bio-border) transparent;
}

.bfl-viewer-panel::-webkit-scrollbar { width: 4px; }
.bfl-viewer-panel::-webkit-scrollbar-track { background: transparent; }
.bfl-viewer-panel::-webkit-scrollbar-thumb { background: var(--bio-border); border-radius: 2px; }

/* PLACEHOLDER */
.bfl-viewer-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--bio-text-muted);
  text-align: center;
  padding: 40px;
}

.bfl-placeholder-icon {
  font-size: 56px;
  opacity: 0.3;
  animation: bfl-float 3s ease-in-out infinite;
}

@keyframes bfl-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bfl-placeholder-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--bio-text-dim);
}

.bfl-placeholder-sub {
  font-size: 14px;
  max-width: 280px;
}

.bfl-placeholder-tips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.bfl-placeholder-tips .tip {
  background: var(--bio-surface2);
  border: 1px solid var(--bio-border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--bio-text-muted);
}

/* VIEWER HEADER */
.bfl-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 12px;
  gap: 12px;
}

.bfl-viewer-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bfl-viewer-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 10px rgba(56,189,248,0.4));
}

.bfl-viewer-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--bio-text);
  line-height: 1.2;
}

.bfl-viewer-unit {
  font-size: 12px;
  color: var(--bio-text-muted);
  margin-top: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bfl-viewer-actions { display: flex; gap: 8px; align-items: center; }

.bfl-btn {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text-muted);
  border-radius: var(--bio-radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--bio-font);
  transition: var(--bio-transition);
}

.bfl-btn:hover { border-color: var(--bio-accent); color: var(--bio-accent); }

.bfl-viewer-grades {
  display: flex;
  gap: 6px;
  padding: 0 24px 14px;
  flex-wrap: wrap;
}

.bfl-viewer-grade-badge {
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.3);
  color: var(--bio-accent);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ===================== FIGURE CANVAS ===================== */
.bfl-figure-canvas {
  margin: 0 24px;
  background: var(--bio-surface);
  border: 1px solid var(--bio-border);
  border-radius: var(--bio-radius-lg);
  min-height: 420px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bfl-figure-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===================== INFO TABS ===================== */
.bfl-viewer-info {
  margin: 16px 24px;
  background: var(--bio-surface);
  border: 1px solid var(--bio-border);
  border-radius: var(--bio-radius);
  overflow: hidden;
}

.bfl-info-tabs {
  display: flex;
  border-bottom: 1px solid var(--bio-border);
}

.bfl-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--bio-text-muted);
  padding: 11px 16px;
  cursor: pointer;
  font-family: var(--bio-font);
  font-size: 13px;
  font-weight: 500;
  transition: var(--bio-transition);
  border-bottom: 2px solid transparent;
}

.bfl-tab:hover { color: var(--bio-text); }

.bfl-tab.active {
  color: var(--bio-accent);
  border-bottom-color: var(--bio-accent);
  background: color-mix(in srgb, var(--bio-accent) 5%, transparent);
}

.bfl-tab-content {
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--bio-text-muted);
}

.bfl-label-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.bfl-label-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bio-surface2);
  border: 1px solid var(--bio-border);
  border-radius: var(--bio-radius-sm);
  padding: 8px 10px;
}

.bfl-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bio-accent);
  flex-shrink: 0;
  margin-top: 4px;
}

.bfl-label-name { font-weight: 600; font-size: 12px; color: var(--bio-text); }
.bfl-label-desc { font-size: 11px; color: var(--bio-text-muted); margin-top: 2px; }

/* QUIZ */
.bfl-quiz-q {
  font-weight: 600;
  font-size: 14px;
  color: var(--bio-text);
  margin-bottom: 12px;
}

.bfl-quiz-opts { display: flex; flex-direction: column; gap: 6px; }

.bfl-quiz-opt {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  border-radius: var(--bio-radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--bio-text-muted);
  transition: var(--bio-transition);
  text-align: left;
  font-family: var(--bio-font);
}

.bfl-quiz-opt:hover { border-color: var(--bio-accent); color: var(--bio-text); }
.bfl-quiz-opt.correct { border-color: var(--bio-accent2); background: rgba(52,211,153,0.1); color: var(--bio-accent2); }
.bfl-quiz-opt.wrong { border-color: var(--bio-danger); background: rgba(244,63,94,0.1); color: var(--bio-danger); }

.bfl-quiz-result { margin-top: 10px; font-size: 13px; font-weight: 600; }
.bfl-quiz-next { margin-top: 8px; background: var(--bio-accent); border: none; color: #000; border-radius: var(--bio-radius-sm); padding: 8px 16px; cursor: pointer; font-family: var(--bio-font); font-weight: 600; font-size: 13px; }

/* TAGS */
.bfl-viewer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px 24px;
}

.bfl-viewer-tag {
  background: var(--bio-surface2);
  border: 1px solid var(--bio-border);
  color: var(--bio-text-dim);
  border-radius: 50px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--bio-transition);
}

.bfl-viewer-tag:hover {
  border-color: var(--bio-accent);
  color: var(--bio-accent);
}

/* ===================== FULLSCREEN ===================== */
.bfl-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #050810;
  z-index: 999999;
  display: flex;
  flex-direction: column;
}

.bfl-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--bio-border);
  background: var(--bio-surface);
}

.bfl-fullscreen-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--bio-text);
}

.bfl-btn-exit-fullscreen {
  background: var(--bio-surface2);
  border: 1.5px solid var(--bio-border);
  color: var(--bio-text-muted);
  border-radius: var(--bio-radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--bio-font);
  font-size: 13px;
  font-weight: 500;
  transition: var(--bio-transition);
}

.bfl-btn-exit-fullscreen:hover { border-color: var(--bio-danger); color: var(--bio-danger); }

.bfl-fullscreen-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bfl-fullscreen-canvas svg {
  max-width: 100%;
  max-height: 100%;
}

/* ===================== SVG FIGURE STYLES ===================== */
.bio-svg-figure {
  width: 100%;
  height: 100%;
}

.bio-svg-label {
  font-family: var(--bio-font);
  font-size: 11px;
  fill: var(--bio-text-muted);
  cursor: pointer;
  transition: fill 0.2s;
}

.bio-svg-label:hover { fill: var(--bio-accent); }

.bio-hotspot {
  cursor: pointer;
  transition: all 0.2s;
}

.bio-hotspot:hover circle { filter: brightness(1.3); }

.bio-tooltip {
  background: var(--bio-surface);
  border: 1px solid var(--bio-border);
  border-radius: 8px;
  padding: 10px 14px;
  position: absolute;
  pointer-events: none;
  z-index: 100;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}

.bio-tooltip.visible { display: block; }

.bio-tooltip-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--bio-text);
  margin-bottom: 4px;
}

.bio-tooltip-desc {
  font-size: 12px;
  color: var(--bio-text-muted);
  line-height: 1.5;
}

/* ANIMATIONS */
@keyframes bio-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes bio-flow {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

@keyframes bio-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.bio-anim-pulse { animation: bio-pulse 2s ease-in-out infinite; }
.bio-anim-rotate { animation: bio-rotate 4s linear infinite; }
.bio-anim-flow { animation: bio-flow 2s linear infinite; stroke-dasharray: 10; }
.bio-anim-bounce { animation: bio-bounce 1.5s ease-in-out infinite; }

/* ===================== SINGLE FIGURE EMBED ===================== */
.bio-figure-single {
  font-family: var(--bio-font);
  background: var(--bio-bg);
  border: 1px solid var(--bio-border);
  border-radius: var(--bio-radius-lg);
  overflow: hidden;
  box-shadow: var(--bio-shadow);
}

.bfs-inner { display: flex; flex-direction: column; height: 100%; }

.bfs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bio-surface);
  border-bottom: 1px solid var(--bio-border);
  border-left: 4px solid;
}

.bfs-icon { font-size: 26px; }
.bfs-title { font-size: 16px; font-weight: 700; color: var(--bio-text); }
.bfs-unit { font-size: 11px; color: var(--bio-text-muted); font-weight: 500; }
.bfs-grades { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.bfs-grade-badge { background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3); color: var(--bio-accent); border-radius: 50px; padding: 3px 9px; font-size: 11px; font-weight: 700; }

.bfs-canvas { flex: 1; min-height: 350px; background: var(--bio-surface); display: flex; align-items: center; justify-content: center; }

.bfs-info {
  padding: 14px 18px;
  background: var(--bio-surface);
  border-top: 1px solid var(--bio-border);
  font-size: 13px;
  color: var(--bio-text-muted);
}

.bfs-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.bfs-tag { background: var(--bio-surface2); border: 1px solid var(--bio-border); color: var(--bio-text-dim); border-radius: 50px; padding: 3px 9px; font-size: 11px; }

/* ===================== ADMIN SHORTCODE HELPER ===================== */
.bio-error {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.3);
  color: #f43f5e;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--bio-font);
  font-size: 13px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .bfl-body { flex-direction: column; }
  .bfl-figures-panel { width: 100%; max-height: 320px; border-right: none; border-bottom: 1px solid var(--bio-border); }
  .bfl-header { flex-direction: column; align-items: stretch; }
  .bfl-header-center { order: -1; }
  .bfl-figures-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 600px) {
  .bfl-figures-grid { grid-template-columns: 1fr 1fr; }
  .bfl-unit-bar { gap: 4px; padding: 8px 12px; }
  .bfl-viewer-header { flex-direction: column; }
  .bfl-label-list { grid-template-columns: 1fr; }
}
