/* ===================================================================
   Endoscopy PACS — Kuro Dark Japanese Minimalist Aesthetic
   Color Palette: Deep Obsidian, Matte Urushi Lacquer, Vermilion (Shu-iro)
   =================================================================== */

:root {
  /* Slate & Navy Surfaces (Human Medical Platform) */
  --kuro-base: #0a0e17;
  --kuro-surface: #101726;
  --kuro-card: #151f32;
  --kuro-card-hover: #1c2940;
  --kuro-border: rgba(255, 255, 255, 0.08);
  --kuro-border-subtle: rgba(255, 255, 255, 0.04);
  --kuro-inner-line: rgba(59, 130, 246, 0.25);

  /* Typography */
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dark: #64748b;

  /* Primary Clinical Blue (Trustworthy, Human Medical Accent) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #93c5fd;
  --primary-bg: rgba(37, 99, 235, 0.12);
  --primary-border: rgba(37, 99, 235, 0.35);

  /* Vermilion / Crimson (Pathology / Alert / Error - Non-neon) */
  --shu-red: #ef4444;
  --shu-rose: #f87171;
  --shu-light: #fca5a5;
  --shu-bg: rgba(239, 68, 68, 0.12);
  --shu-border: rgba(239, 68, 68, 0.35);

  /* Matcha Emerald (Norm / Correct - Calm Clinical Green) */
  --matcha-leaf: #10b981;
  --matcha-green: #10b981;
  --matcha-bg: rgba(16, 185, 129, 0.12);
  --matcha-border: rgba(16, 185, 129, 0.3);

  --radius: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: var(--font-sans);
  --font-main: var(--font-sans);
}

h1, h2, h3, .banner-title, #modalImgTitle, #polypModalTitle, #videoModalTitle {
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-main);
  background-color: var(--kuro-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* Clean solid clinical dark surface */
}

/* TOP KURO WORKSTATION HEADER */
.workstation-header {
  background: rgba(14, 16, 23, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--kuro-border);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1440px;
  margin: 0 auto;
}

.app-brand {
  display: flex;
  align-items: center;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  /* Clean flat title */
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Minimalist Tabs */
.header-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.tab-btn.active {
  background: var(--kuro-card);
  border-color: var(--shu-border);
  color: #ffffff;
  border-color: var(--primary);
}

.tab-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.tab-btn.active .tab-badge {
  background: var(--shu-bg);
  color: var(--shu-light);
  font-weight: 700;
}

/* MAIN WORKSPACE */
.workspace-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.view-section {
  display: none;
}

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

/* BREADCRUMBS & NAVIGATION */
.breadcrumbs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 24px;
}

.breadcrumbs-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}

.btn-back-folders {
  background: var(--shu-bg);
  border: 1px solid var(--shu-border);
  color: var(--shu-light);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-back-folders:hover {
  background: rgba(225, 29, 72, 0.22);
  border-color: var(--shu-rose);
}

.breadcrumb-path {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-path:hover {
  color: var(--shu-light);
}

.breadcrumb-current {
  color: #ffffff;
  font-weight: 700;
}

/* Clinical Banner inside Category */
.folder-info-banner {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-left: 4px solid var(--shu-rose);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.banner-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
}

.banner-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 920px;
  line-height: 1.65;
}

/* CATEGORIES GRID (VIEW 1) */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.category-box {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-top: 3px solid var(--shu-rose);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.category-box.is-norm {
  border-top-color: var(--matcha-green);
}

.category-box.is-pathology {
  border-top-color: var(--shu-rose);
}

.category-box.is-norm:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.16);
}

/* 3-Image Preview Strip */
.folder-mini-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--kuro-base);
  padding: 5px;
  border: 1px solid var(--kuro-border-subtle);
}

.mini-thumb {
  height: 66px;
  border-radius: 4px;
  overflow: hidden;
  background: #000000;
  position: relative;
}

.mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.category-box:hover .mini-thumb img {
  transform: scale(1.09);
}

/* Japanese inner framing border */
.category-box::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--kuro-border-subtle);
  border-radius: 4px;
  pointer-events: none;
  transition: border-color 0.25s;
}

.category-box:hover {
  transform: translateY(-3px);
  border-color: var(--shu-border);
  background: var(--kuro-card-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(225, 29, 72, 0.12);
}

.category-box:hover::after {
  border-color: var(--kuro-inner-line);
}

.category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.category-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  line-height: 1.35;
}

.category-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.organ-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Status Badges */
.folder-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.folder-status-badge.norm {
  background: var(--matcha-bg);
  color: var(--matcha-green);
  border: 1px solid var(--matcha-border);
}

.folder-status-badge.pathology {
  background: var(--shu-bg);
  color: var(--shu-rose);
  border: 1px solid var(--shu-border);
}

.category-pearl-text {
  font-size: 13px;
  color: var(--text-sub);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--kuro-border-subtle);
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.6;
  flex: 1;
}

.category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  border-top: 1px solid var(--kuro-border-subtle);
  padding-top: 12px;
}

.card-count-label {
  color: var(--text-muted);
}

.card-count-label b {
  color: #ffffff;
}

.card-action-link {
  color: var(--shu-light);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* IMAGES GRID (VIEW 2) */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.image-thumb-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.image-thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--shu-rose);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(225, 29, 72, 0.15);
}

.thumb-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000000;
}

.thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-card-footer {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  background: var(--kuro-surface);
  border-top: 1px solid var(--kuro-border-subtle);
}

/* MODULE 2: SEGMENTED POLYPS */
.polyps-seg-header {
  margin-bottom: 24px;
}

.polyps-seg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.polyp-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.polyp-card:hover {
  transform: translateY(-3px);
  border-color: var(--shu-rose);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(225, 29, 72, 0.15);
}

.polyp-img-box {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000000;
  position: relative;
  overflow: hidden;
}

.polyp-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polyp-info-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--kuro-surface);
}

.polyp-mask-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* MODULE 3: CLINICAL PROCEDURES */
/* Video Duration & Registry Overview Dashboard */
.video-stats-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.video-stat-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.video-stat-card:hover {
  border-color: var(--shu-border);
  background: var(--kuro-card-hover);
  transform: translateY(-1px);
}

.video-stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.video-stat-card .stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-stat-card .stat-val.highlight {
  color: var(--shu-rose);
}

.video-stat-card .stat-sub {
  font-size: 11.5px;
  color: var(--text-sub);
}

/* Controls & Toolbar */
.videos-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.videos-search-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.video-search-input {
  flex: 1;
  min-width: 260px;
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.video-search-input:focus {
  border-color: var(--shu-rose);
}

.video-sort-select {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: var(--font-sans);
}

.video-sort-select:focus, .video-sort-select:hover {
  border-color: var(--shu-rose);
}

.video-sort-select option {
  background: var(--kuro-card);
  color: #ffffff;
}

.duration-chips-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px 2px;
  scrollbar-width: none;
}

.duration-chips-bar::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: var(--kuro-card);
  border: 1px solid var(--kuro-border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--kuro-card-hover);
}

.chip-btn.active {
  background: var(--shu-bg);
  border-color: var(--shu-rose);
  color: var(--shu-rose);
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.25);
}

/* Badges on video card */
.duration-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--shu-bg);
  border: 1px solid var(--shu-border);
  border-radius: 4px;
  color: var(--shu-rose);
  font-weight: 600;
}

.duration-badge.extreme {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--shu-rose);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.35);
  font-weight: 700;
}

.duration-badge.major {
  background: rgba(225, 29, 72, 0.16);
  border-color: var(--shu-rose);
  color: var(--shu-light);
  font-weight: 700;
}

.video-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.video-item-box {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.video-item-box:hover {
  transform: translateY(-2px);
  border-color: var(--shu-border);
  background: var(--kuro-card-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(225, 29, 72, 0.12);
}

.video-title-ru {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}

.video-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.video-btn-play {
  background: var(--shu-bg);
  border: 1px solid var(--shu-border);
  color: var(--shu-light);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  transition: background 0.15s;
}

.video-item-box:hover .video-btn-play {
  background: rgba(225, 29, 72, 0.24);
  border-color: var(--shu-rose);
}

/* PAGINATION */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: var(--shu-border);
}

.page-btn.active {
  background: var(--shu-red);
  color: #ffffff;
  border-color: var(--shu-rose);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35);
}

/* MODAL WINDOWS (KURO OBSIDIAN DESIGN) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content-box {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 12px;
  max-width: 1080px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(225, 29, 72, 0.15);
}

.modal-top-bar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--kuro-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--kuro-surface);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--kuro-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: var(--shu-bg);
  color: var(--shu-light);
  border-color: var(--shu-rose);
}

.modal-inner-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  overflow-y: auto;
  background: var(--kuro-base);
}

.modal-image-stage {
  background: #050508;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 480px;
  border: 1px solid var(--kuro-border);
}

.modal-image-stage img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.modal-nav-arrows {
  position: absolute;
  bottom: 16px;
  display: flex;
  gap: 12px;
  background: rgba(14, 16, 23, 0.9);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--kuro-border);
}

.nav-arrow-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.nav-arrow-btn:hover {
  color: var(--shu-rose);
}

.modal-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--kuro-surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--kuro-border);
}

/* NATIVE HD ENDOSCOPY VIDEO WORKSTATION */
.video-stage-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.procedure-player-box {
  background: #000000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--kuro-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.procedure-video-element {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 65vh;
  display: block;
  background: #000000;
  object-fit: contain;
  outline: none;
}

.video-custom-controls {
  background: rgba(14, 16, 23, 0.98);
  border-top: 1px solid var(--kuro-border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-play-btn {
  background: var(--shu-red);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: transform 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.video-play-btn:hover {
  transform: scale(1.08);
  background: var(--shu-rose);
}

.video-time-code {
  font-family: monospace;
  font-size: 12px;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.video-timeline-scrubber {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.video-timeline-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--shu-rose);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.6);
}

.video-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--kuro-border);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.video-ctrl-btn:hover {
  background: var(--shu-bg);
  border-color: var(--shu-border);
  color: #ffffff;
}

.video-status-bar {
  background: rgba(10, 11, 16, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 11.5px;
}

.video-live-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--shu-rose);
  background: var(--shu-bg);
  border: 1px solid var(--shu-border);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.video-switcher-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-pill-btn {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  color: var(--text-sub);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  text-align: left;
  width: 100%;
}

.video-pill-btn:hover {
  background: var(--kuro-card-hover);
  color: #ffffff;
  border-color: var(--shu-border);
  transform: translateX(2px);
}

.video-pill-btn.active {
  background: var(--shu-bg);
  color: var(--shu-rose);
  border-color: var(--shu-border);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.2);
}

/* RESPONSIVE DESIGN (TABLETS & MOBILE) */
@media (max-width: 900px) {
  .modal-inner-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .modal-image-stage {
    min-height: 340px;
  }
  .procedure-video-element {
    max-height: 50vh;
  }
  .folder-info-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .header-row {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 10px;
    align-items: stretch;
  }
  .workstation-header {
    position: static;
    padding: 0 12px;
    width: 100%;
    overflow: hidden;
  }
  .app-brand {
    justify-content: center;
  }
  .header-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 2px 8px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    justify-content: flex-start;
  }
  .header-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 12px;
  }
  .workspace-container {
    padding: 12px;
  }
  .folders-grid {
    grid-template-columns: 1fr;
  }
  .breadcrumbs-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .modal-overlay {
    padding: 6px;
  }
  .modal-content-box {
    max-height: 96vh;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
  }
  .modal-inner-grid {
    padding: 12px;
    gap: 12px;
  }
  .modal-top-bar {
    padding: 12px 14px;
  }
  .procedure-video-element {
    aspect-ratio: 4 / 3;
    max-height: 42vh;
  }
  .video-custom-controls {
    padding: 8px 10px;
    gap: 8px;
  }
  .video-time-code {
    font-size: 11px;
  }
}


/* ========================================================================== */
/* SUBTABS NAVIGATION & VERIFIED CLINICAL WORKSTATION                         */
/* ========================================================================== */
.video-subtabs-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--kuro-border);
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.video-subtab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.video-subtab-btn:hover {
  background: var(--kuro-card-hover);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.video-subtab-btn.active {
  background: var(--shu-bg);
  border-color: var(--shu-border);
  color: var(--shu-rose);
  box-shadow: 0 2px 12px rgba(225, 29, 72, 0.15);
}

.video-subtab-btn .subtab-counter {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 500;
}

.video-subtab-btn.active .subtab-counter {
  background: rgba(225, 29, 72, 0.2);
  color: var(--shu-rose);
  font-weight: 700;
}

/* VERIFIED VIDEO CARDS */
.verified-video-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.verified-video-card:hover {
  background: var(--kuro-card-hover);
  border-color: var(--shu-border);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.verified-video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: transparent;
  transition: background 0.2s ease;
}

.verified-video-card:hover::before {
  background: var(--shu-rose);
}

.duration-pill-gold {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.duration-pill-cyan {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.duration-pill-emerald {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ARCHIVE NOTICE BANNER */
.archive-notice-banner {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ===================================================================
   3-SCENE ARCHITECTURE & MULTI-CENTER PATHOLOGY ARCHIVE STYLES
   =================================================================== */

.scenes-nav-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  background: rgba(18, 20, 29, 0.85);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--kuro-border);
  overflow-x: auto;
}

.scene-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.scene-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.scene-nav-btn.active {
  background: var(--shu-bg);
  border-color: var(--shu-border);
  color: #ffffff;
}

.scene-nav-btn .scene-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.scene-nav-btn.active .scene-badge {
  background: rgba(225, 29, 72, 0.3);
  color: var(--shu-light);
}

.scene-block-header {
  margin: 32px 0 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--kuro-border);
  padding-bottom: 14px;
}

.scene-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scene-number-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shu-rose);
}

.scene-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.03em;
}

.scene-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Scene 2: Multi-Center Pathology Grid & Cards */
.multicenter-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.multicenter-chips-bar {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.multicenter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

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

.multicenter-card {
  background: var(--kuro-card);
  border: 1px solid var(--kuro-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.multicenter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.2s ease;
}

.multicenter-card:hover {
  border-color: var(--shu-border);
  background: var(--kuro-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.multicenter-card:hover::before {
  background: var(--shu-rose);
}

.multicenter-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.center-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.center-pill.sun {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.center-pill.capsule {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.4);
  color: #7dd3fc;
}

.center-pill.gastrohun {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.4);
  color: #fde047;
}

.center-pill.videogie {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.multicenter-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
}

.multicenter-diagnosis {
  font-size: 12.5px;
  color: var(--shu-light);
  line-height: 1.45;
  background: rgba(225, 29, 72, 0.08);
  border-left: 2px solid var(--shu-rose);
  padding: 7px 10px;
  border-radius: 3px;
}

.classif-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.classif-tag {
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
}

.classif-tag.paris {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.classif-tag.kudo {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.classif-tag.jnet {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.classif-tag.saurin, .classif-tag.forrest {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.multicenter-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--kuro-border-subtle);
  font-size: 11.5px;
  color: var(--text-dark);
}

/* Scene 3: Source Attribution Box inside Modal */
.source-attribution-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--kuro-border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-attr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.source-center-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.source-doi-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #38bdf8;
  text-decoration: none;
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.15s ease;
}

.source-doi-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.pathology-detail-banner {
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid var(--shu-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}



/* ========================================================================== */
/* NATIVE CLINICAL TRAINER STYLES (KURO MEDICAL AESTHETIC)                   */
/* ========================================================================== */
.trainer-hero-card {
  background: linear-gradient(180deg, #131c2e 0%, #0f1624 100%);
  border: 1px solid var(--kuro-border);
  border-radius: 12px;
  padding: 28px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.trainer-hero-left {
  max-width: 680px;
}

.trainer-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.trainer-main-title {
  font-family: 'Zen Kaku Gothic New', -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 10px;
}

.trainer-main-desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 18px;
}

.trainer-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.trainer-stat-pill {
  background: var(--kuro-base);
  border: 1px solid var(--kuro-border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.trainer-stat-pill b {
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
}

.btn-trainer-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  font-family: inherit;
}

.btn-trainer-primary:hover {
  background: #f43f5e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
}

/* Сетка режимов тренировки */
.trainer-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.t-mode-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.22s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.t-mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--m-accent, var(--shu-red));
}

.t-mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--kuro-card-hover);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.t-mode-icon {
  font-size: 26px;
  margin-bottom: 12px;
}

.t-mode-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.t-mode-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.t-mode-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--kuro-border);
}

.t-mode-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dark);
}

.t-mode-btn {
  color: var(--m-accent, var(--shu-light));
  font-weight: 700;
  font-size: 12.5px;
}

/* Активный экран тестирования */
.trainer-top-status-bar {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.t-progress-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--kuro-base);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--kuro-border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.t-progress-line-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-bottom: 18px;
  overflow: hidden;
}

.t-progress-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--shu-red), var(--matcha-leaf));
  width: 0%;
  transition: width 0.3s ease;
}

.trainer-workstation-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .trainer-workstation-grid {
    grid-template-columns: 1fr;
  }
}

/* Эндоскопический монитор (Чистые натуральные цвета) */
.t-monitor-frame {
  background: #000000;
  border: 2px solid var(--kuro-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  position: relative;
}

.t-monitor-osd-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.t-osd-tag {
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
}

.t-osd-tag.organ {
  background: var(--shu-red);
  border-color: var(--shu-red);
}

.t-monitor-viewport {
  aspect-ratio: 4/3;
  width: 100%;
  background: #020306;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: crosshair;
}

.t-monitor-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.t-monitor-img.zoom-active {
  transform: scale(2.0);
  cursor: grab;
}

.t-monitor-osd-bottom {
  background: var(--kuro-base);
  padding: 10px 14px;
  border-top: 1px solid var(--kuro-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.t-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--kuro-border);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.t-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.t-tool-btn.active {
  background: var(--matcha-leaf);
  color: #000;
  font-weight: 700;
}

/* Колонка взаимодействия: Вопрос и варианты */
.t-interaction-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.t-question-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 10px;
  padding: 14px 18px;
}

.t-question-text {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 10px;
}

.t-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-option-btn {
  background: var(--kuro-card);
  border: 1px solid var(--kuro-border);
  border-radius: 8px;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  color: var(--text-sub);
  font-family: inherit;
}

.t-option-btn:hover:not(:disabled) {
  background: var(--kuro-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateX(4px);
}

.t-opt-key {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--kuro-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  flex-shrink: 0;
}

.t-opt-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
}

.t-option-btn.correct {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: var(--matcha-leaf) !important;
  color: #a7f3d0 !important;
}

.t-option-btn.correct .t-opt-key {
  background: var(--matcha-leaf);
  color: #000;
}

.t-option-btn.wrong {
  background: rgba(225, 29, 72, 0.16) !important;
  border-color: var(--shu-red) !important;
  color: #fecdd3 !important;
}

.t-option-btn.wrong .t-opt-key {
  background: var(--shu-red);
  color: #fff;
}

/* Карточка клинического обоснования */
.t-rationale-card {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 10px;
  padding: 14px 16px;
  animation: slideUp 0.25s ease-out;
}

.t-rationale-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.t-rationale-status.correct {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.t-rationale-status.wrong {
  background: rgba(225, 29, 72, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.t-signs-ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.t-signs-ul li {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.t-signs-ul li::before {
  content: '•';
  color: var(--shu-light);
  font-size: 13px;
}

.btn-trainer-next {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-trainer-next:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Итоговый экран результатов */
.t-results-box {
  background: var(--kuro-surface);
  border: 1px solid var(--kuro-border);
  border-radius: 14px;
  padding: 36px 28px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.t-results-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  border: 3px solid var(--matcha-leaf);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
}

.t-mistake-card {
  background: var(--kuro-card);
  border: 1px solid var(--kuro-border);
  border-left: 3px solid var(--shu-red);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.t-mistake-thumb {
  width: 64px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.brand-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--kuro-border);
}
.tab-badge.primary {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600;
}

.t-mode-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}


/* ========================================================================= */
/* РАЗДЕЛ ГАЙДЛАЙНОВ & КЛИНИЧЕСКИХ РУКОВОДСТВ (220 ДОКУМЕНТОВ)              */
/* ========================================================================= */
.guidelines-hero {
  background: linear-gradient(135deg, rgba(21, 28, 51, 0.95) 0%, rgba(17, 22, 39, 0.98) 100%);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.guidelines-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.guidelines-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}
.guidelines-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}
.guidelines-hero-desc {
  color: var(--text-secondary, #cbd5e1);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px 0;
  max-width: 950px;
}
.guidelines-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.g-stat-card {
  background: rgba(17, 22, 39, 0.75);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 12px;
  padding: 14px 18px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.g-stat-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}
.g-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace, monospace;
  margin-bottom: 4px;
}
.g-stat-lbl {
  font-size: 12px;
  color: var(--text-muted, #8292b0);
  line-height: 1.3;
}
.guidelines-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn-g-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-g-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-g-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
}
.btn-g-secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border-color, #202b4d);
  color: #cbd5e1;
}
.btn-g-secondary:hover {
  background: rgba(40, 53, 76, 0.9);
  color: #f8fafc;
  border-color: #3b82f6;
}
.btn-g-outline {
  background: transparent;
  border-color: var(--border-color, #202b4d);
  color: #8292b0;
}
.btn-g-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  border-color: #60a5fa;
}

/* ФИЛЬТРЫ И ПОИСК */
.guidelines-filter-panel {
  background: var(--panel-surface, #111627);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.g-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}
.g-search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  color: var(--text-muted, #8292b0);
  pointer-events: none;
}
.g-search-input {
  width: 100%;
  background: #07090f;
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 12px;
  padding: 12px 42px 12px 44px;
  color: #f8fafc;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}
.g-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
.g-search-clear {
  position: absolute;
  right: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #8292b0;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

.g-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.g-chip {
  background: #07090f;
  border: 1px solid var(--border-color, #202b4d);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.g-chip:hover {
  border-color: #3b82f6;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.5);
}
.g-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}
.g-chip-count {
  font-size: 11px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 10px;
}

.g-filter-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.g-controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.g-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8292b0;
}
.g-control-group select {
  background: #07090f;
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 8px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.g-control-group select:focus {
  border-color: #3b82f6;
}
.g-count-indicator {
  font-size: 13px;
  color: #cbd5e1;
}
.g-count-indicator strong {
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace;
}

/* КАРТОЧКИ ГАЙДЛАЙНОВ */
.guidelines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.guideline-card {
  background: rgba(21, 28, 51, 0.65);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}
.guideline-card:hover {
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: rgba(28, 37, 68, 0.8);
}
.g-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.g-badges-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.g-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.g-badge-soc {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.g-badge-soc.soc-esge, .g-badge-soc.soc-asge, .g-badge-soc.soc-jges {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.g-badge-soc.soc-easl, .g-badge-soc.soc-aasld, .g-badge-soc.soc-apasl {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}
.g-badge-soc.soc-rf {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.g-badge-soc.soc-rome {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
.g-badge-year {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
}
.g-badge-size {
  font-size: 11px;
  color: #8292b0;
  font-family: 'JetBrains Mono', monospace;
}
.g-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.45;
  margin: 0 0 10px 0;
  word-break: break-word;
}
.g-card-title mark {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
  padding: 0 2px;
  border-radius: 2px;
}
.g-card-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-card-open {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-card-open:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.btn-card-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #07090f;
  border: 1px solid var(--border-color, #202b4d);
  color: #8292b0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-card-copy:hover {
  border-color: #3b82f6;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.8);
}

/* TOAST */
.g-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  padding: 12px 18px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
}
.g-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.g-toast-icon {
  color: #10b981;
  font-weight: bold;
}


/* =================================================================== */
/* IN-APP MODAL PDF VIEWER & CARD ACTIONS */
/* =================================================================== */
.btn-card-read {
  flex: 1.2 !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
  cursor: pointer;
}
.btn-card-read:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px);
}
.btn-card-download {
  flex: 0.9 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color, #202b4d);
  color: var(--text-secondary, #94a3b8);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-card-download:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* PDF Modal Backdrop & Dialog */
.pdf-reader-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: pdfModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pdfModalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.pdf-reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pdf-reader-dialog {
  position: relative;
  z-index: 1;
  width: 95vw;
  max-width: 1360px;
  height: 92vh;
  background: #0b1021;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(37, 99, 235, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-reader-header {
  padding: 16px 24px;
  background: linear-gradient(180deg, #11182e 0%, #0d1326 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.pdf-reader-meta {
  flex: 1;
  min-width: 0;
}
.pdf-reader-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.pdf-live-indicator {
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.pdf-reader-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.pdf-reader-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.btn-pdf-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-pdf-header:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-pdf-header.primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}
.btn-pdf-header.primary:hover {
  background: #1d4ed8;
}
.btn-pdf-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-pdf-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Frame Wrap & Loading */
.pdf-reader-frame-wrap {
  flex: 1;
  position: relative;
  background: #060913;
  overflow: hidden;
}
.pdf-reader-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #94a3b8;
  font-size: 13px;
  background: #0b1021;
  z-index: 2;
}
.pdf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: pdfSpin 0.7s linear infinite;
}
@keyframes pdfSpin {
  to { transform: rotate(360deg); }
}
#pdfViewerFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  display: block;
}


/* =================================================================== */
/* GUIDELINES SOCIETY FOLDERS ARCHITECTURE */
/* =================================================================== */
.guidelines-view-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.7);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-color, #202b4d);
  width: fit-content;
}
.view-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-switch-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}
.view-switch-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.view-switch-btn .badge-mini {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
}
.view-switch-btn.active .badge-mini {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Folders Search Bar */
.folders-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.folders-search-input-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.folders-search-input {
  width: 100%;
  padding: 13px 40px 13px 42px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 12px;
  color: #f8fafc;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.folders-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(17, 24, 46, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.folders-count-badge {
  padding: 8px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Folders Grid */
.guidelines-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.guideline-folder-card {
  background: linear-gradient(135deg, rgba(17, 24, 46, 0.92) 0%, rgba(13, 19, 38, 0.96) 100%);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.guideline-folder-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(37, 99, 235, 0.15);
}
.guideline-folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.guideline-folder-card:hover::before {
  opacity: 1;
}

/* Society Color Accents */
.guideline-folder-card.soc-esge::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.guideline-folder-card.soc-easl::before { background: linear-gradient(90deg, #10b981, #34d399); }
.guideline-folder-card.soc-acg::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.guideline-folder-card.soc-rf::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.guideline-folder-card.soc-rome::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.guideline-folder-card.soc-wgo::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.guideline-folder-card.soc-ecco::before { background: linear-gradient(90deg, #ec4899, #f472b6); }

.folder-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.folder-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.folder-region-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.folder-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.folder-code-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}
.folder-badge-count {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.folder-fullname {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  line-height: 1.35;
}
.folder-desc-text {
  font-size: 12px;
  color: var(--text-secondary, #8292b0);
  line-height: 1.45;
  margin-bottom: 16px;
}
.folder-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.folder-size-tag {
  color: var(--text-secondary, #94a3b8);
  font-weight: 500;
}
.folder-open-action {
  color: #60a5fa;
  font-weight: 600;
  transition: transform 0.2s;
}
.guideline-folder-card:hover .folder-open-action {
  transform: translateX(3px);
  color: #93c5fd;
}

/* Folder Detail Header Card */
.folder-detail-header-card {
  background: linear-gradient(135deg, rgba(17, 24, 46, 0.95) 0%, rgba(13, 19, 38, 0.98) 100%);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 16px;
  padding: 22px 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.folder-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
}
.btn-breadcrumb-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #93c5fd;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-breadcrumb-back:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
  border-color: #3b82f6;
  transform: translateX(-2px);
}
.breadcrumb-separator {
  color: var(--text-secondary, #64748b);
}
.breadcrumb-current {
  font-weight: 700;
  color: #f8fafc;
}

.folder-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.folder-hero-main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex: 1;
  min-width: 280px;
}
.folder-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.folder-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.folder-hero-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
}
.folder-hero-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  max-width: 750px;
}
.folder-hero-stats {
  display: flex;
  gap: 14px;
}
.folder-hero-stats .f-stat {
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
}
.folder-hero-stats .f-stat b {
  color: #60a5fa;
  font-size: 17px;
  font-weight: 800;
  margin-right: 4px;
}

.folder-detail-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.folder-search-box {
  flex: 1;
  min-width: 240px;
}
.g-search-input-sm {
  width: 100%;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 13px;
  box-sizing: border-box;
}
.g-search-input-sm:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.btn-copy-folder {
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy-folder:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.folders-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
.folders-empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* =================================================================== */
/* БИБЛИОТЕКА КЛИНИЧЕСКИХ ГАЙДЛАЙНОВ (ЧЕЛОВЕЧНЫЙ МЕДИЦИНСКИЙ ИНТЕРФЕЙС) */
/* =================================================================== */
.lib-header {
  margin-bottom: 20px;
}
.lib-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lib-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}
.lib-subtitle {
  margin: 5px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary, #8292b0);
  line-height: 1.4;
}
.lib-counter-badge {
  font-size: 13px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.lib-counter-badge strong {
  color: #f8fafc;
}

/* Society Filters (Папки обществ текстом) */
.lib-societies-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.lib-societies-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.lib-societies-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lib-pill {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lib-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}
.lib-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}
.lib-pill-count {
  font-size: 10px;
  opacity: 0.75;
}
.lib-pill.active .lib-pill-count {
  opacity: 0.9;
}

/* Controls */
.lib-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lib-search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}
.lib-search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: #64748b;
  pointer-events: none;
}
.lib-search-input {
  width: 100%;
  padding: 10px 36px 10px 34px;
  background: #0d1222;
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.lib-search-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.lib-search-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
}
.lib-search-clear:hover {
  color: #f8fafc;
}
.lib-filters-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lib-select {
  padding: 9px 12px;
  background: #0d1222;
  border: 1px solid var(--border-color, #202b4d);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
}
.lib-select:focus {
  outline: none;
  border-color: #3b82f6;
}
.lib-btn-reset {
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.lib-btn-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

/* Results Row */
.lib-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.lib-results-info strong {
  color: #cbd5e1;
}
.lib-btn-copy-list {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-size: 12px;
  cursor: pointer;
}
.lib-btn-copy-list:hover {
  text-decoration: underline;
}

/* Grid & Cards */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.lib-card {
  background: #0d1326;
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease;
}
.lib-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}
.lib-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.lib-tag-soc {
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
}
.lib-tag-year {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}
.lib-tag-size {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
}
.lib-card-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
}
.lib-card-file {
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 14px;
}
.lib-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.lib-btn-read {
  flex: 1;
  padding: 7px 12px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.lib-btn-read:hover {
  background: #1d4ed8;
}
.lib-btn-dl {
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s;
}
.lib-btn-dl:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.lib-btn-copy {
  padding: 6px 8px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.lib-btn-copy:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 13px;
}

/* Modal PDF Reader (Чистый, без лишнего декора) */
.pdf-reader-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.pdf-reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.pdf-reader-dialog {
  position: relative;
  z-index: 1;
  width: 96vw;
  max-width: 1300px;
  height: 94vh;
  background: #0b1021;
  border: 1px solid #1e293b;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.pdf-reader-header {
  padding: 12px 18px;
  background: #0f1527;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.pdf-reader-meta {
  flex: 1;
  min-width: 0;
}
.pdf-reader-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.pdf-reader-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-reader-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-pdf-header {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
}
.btn-pdf-header:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.btn-pdf-header.primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}
.btn-pdf-header.primary:hover {
  background: #1d4ed8;
}
.btn-pdf-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-pdf-close:hover {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.2);
}
.pdf-reader-frame-wrap {
  flex: 1;
  position: relative;
  background: #1e293b;
}
.pdf-reader-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 13px;
  background: #0b1021;
}
.pdf-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: pdfSpin 0.7s linear infinite;
}
@keyframes pdfSpin {
  to { transform: rotate(360deg); }
}
#pdfViewerFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Toast */
.g-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 10px 16px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 999999;
}
.g-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.g-toast-icon {
  color: #10b981;
}
