/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: #f4f5f7;
  color: #2e3039;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 57, 70, 0.6);
}

/* Header Banner */
.app-header {
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.logo-img:hover {
  opacity: 0.8;
}

.app-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1d24;
  letter-spacing: 0.5px;
}

.global-direction-selector {
  display: flex;
  background-color: #ffffff; /* White background */
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.dir-btn {
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dir-btn:hover {
  color: #212529;
}

.dir-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

.stats-badge-container {
  display: flex;
  gap: 12px;
}

.stat-badge {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 0 14px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1d3557;
  box-sizing: border-box;
}

.stat-badge span {
  margin-right: 4px;
}

/* Layout */
.main-layout {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Left Sidebar (Controls) */
.control-sidebar {
  width: 320px;
  background-color: #ffffff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 5;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #495057;
  margin-bottom: 12px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-help {
  font-size: 11px;
  color: #6c757d;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Search bar */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

#search-input,
#category-search-input {
  width: 100%;
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  color: #212529;
  padding: 10px 35px 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.3s ease;
}

#search-input:focus,
#category-search-input:focus {
  border-color: #e63946;
  outline: none;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.15);
}

.btn-icon {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #6c757d;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.btn-icon:hover {
  color: #212529;
}

/* Sliders */
.range-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#degree-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  outline: none;
}

#degree-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e63946;
  cursor: pointer;
  transition: transform 0.1s ease;
}

#degree-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.badge {
  align-self: flex-start;
  background: rgba(230, 57, 70, 0.05);
  border: 1px solid #e63946;
  color: #e63946;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* List section (Scrollable Clusters) */
.list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cluster-legend-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cluster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cluster-item:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.cluster-item.active {
  border-color: #e63946;
  background-color: rgba(230, 57, 70, 0.05);
}

.cluster-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cluster-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cluster-name {
  font-size: 12px;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cluster-count {
  font-size: 10px;
  color: #6c757d;
  margin-top: 2px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  background-color: #e63946;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #f75562;
  box-shadow: 0 4px 15px rgba(230, 57, 70, 0.2);
}

/* Canvas Container */
.canvas-container {
  flex: 1;
  position: relative;
  background-color: #F7F8FA;
}

#network-canvas {
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* HUD Overlay */
.graph-hud {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.hud-card {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid #e9ecef;
  padding: 12px 18px;
  border-radius: 8px;
  max-width: 50%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.hud-card p {
  font-size: 12px;
  color: #495057;
  line-height: 1.5;
}

.hud-zoom-controls {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-zoom-controls button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid #ced4da;
  color: #212529;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.hud-zoom-controls button:hover {
  background: #e63946;
  border-color: #e63946;
  color: #ffffff;
  transform: scale(1.05);
}

/* Overlay & Spinner */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(248, 249, 251, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s ease;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(230, 57, 70, 0.1);
  border-top-color: #e63946;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.spinner-container h2 {
  font-family: 'Montserrat', sans-serif;
  color: #1a1d24;
  font-size: 20px;
}

.spinner-container p {
  font-size: 13px;
  color: #6c757d;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Right Sidebar (Article Inspector) */
.inspector-sidebar {
  width: 360px;
  background-color: #ffffff;
  border-left: 1px solid #e9ecef;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: -360px;
  /* Hidden offscreen initially */
  bottom: 0;
  z-index: 8;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.06);
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.inspector-sidebar.open {
  right: 0;
}

.close-inspector {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #6c757d;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.close-inspector:hover {
  color: #212529;
}

.inspector-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
}

.category-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(29, 53, 87, 0.05);
  border: 1px solid rgba(29, 53, 87, 0.15);
  color: #1d3557;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

#inspect-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1d24;
  line-height: 1.4;
  margin-bottom: 20px;
}

.meta-row {
  display: flex;
  gap: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #6c757d;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  color: #1a1d24;
}

.accent-text {
  color: #e63946;
}

/* Stats Cards in Inspector */
.stats-grid {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  flex: 1;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: #e63946;
}

.stat-desc {
  font-size: 10px;
  color: #6c757d;
  margin-top: 4px;
  line-height: 1.3;
}

.inspector-actions {
  margin-bottom: 24px;
}

.btn-primary-link {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #e63946;
  color: #ffffff;
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-primary-link:hover {
  background-color: #f75562;
  box-shadow: 0 4px 15px rgba(230, 57, 70, 0.2);
}

/* Connections Lists Tabs */
.connections-list-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.connections-list-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1a1d24;
  margin-bottom: 12px;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #6c757d;
  padding: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #1a1d24;
}

.tab-btn.active {
  color: #e63946;
  border-bottom-color: #e63946;
}

.tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 4px;
}

.tab-content.active {
  display: flex;
}

.conn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.conn-item {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conn-item:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.conn-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #212529;
  line-height: 1.4;
  margin-bottom: 4px;
}

.conn-item-meta {
  font-size: 10px;
  color: #6c757d;
}

/* Style overrides for the library's built-in tooltip wrapper to remove the ugly dark border/background */
.graph-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Author Select Dropdown */
#author-select {
  width: 100%;
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  color: #212529;
  padding: 10px 32px 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.3s ease;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

#author-select:focus {
  border-color: #e63946;
  outline: none;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.15);
}

/* View Mode Selector */
.view-mode-selector {
  display: flex;
  background-color: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.view-mode-btn {
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.view-mode-btn:hover {
  color: #212529;
}

.view-mode-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

/* List View Panel Layout */
#list-view-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
  z-index: 2;
  padding: 24px;
  overflow: hidden;
}

.list-view-layout {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 24px;
}

.list-view-master {
  width: 320px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.list-view-master h3,
.list-view-detail h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #495057;
  margin-bottom: 16px;
  letter-spacing: 0.8px;
}

.clusters-master-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.cluster-master-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #212529;
}

.cluster-master-item:hover {
  background-color: #e9ecef;
  transform: translateY(-1px);
}

.cluster-master-item.active {
  background-color: #e63946;
  color: #ffffff;
  border-color: #e63946;
  box-shadow: 0 4px 10px rgba(230, 57, 70, 0.2);
}

.cluster-master-item .cluster-name {
  font-size: 13px;
  font-weight: 600;
}

.cluster-master-item .cluster-count {
  font-size: 11px;
  font-weight: 700;
  background-color: #e9ecef;
  color: #495057;
  padding: 3px 8px;
  border-radius: 20px;
}

.cluster-master-item.active .cluster-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.list-view-detail {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.articles-detail-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background-color: #f1f3f5;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.col-title {
  flex: 4.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-author {
  flex: 1.5;
  padding-left: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-date {
  flex: 1;
  padding-left: 12px;
}

.col-strength {
  flex: 1.2;
  padding-left: 12px;
}

.col-topics {
  flex: 3.2;
  padding-left: 12px;
}

.col-link {
  width: 45px;
  text-align: center;
}

.articles-detail-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-row-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #212529;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.article-row-item:hover {
  background-color: #f8f9fa;
  border-color: #e9ecef;
}

.article-row-item .title-text {
  flex: 4.2;
  font-weight: 600;
  line-height: 1.4;
  padding-right: 12px;
  word-break: break-word;
}

.article-row-item .author-text {
  flex: 1.5;
  color: #495057;
  padding-left: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-row-item .date-text {
  flex: 1;
  color: #6c757d;
  font-size: 12px;
  padding-left: 12px;
}

.article-row-item .strength-text {
  flex: 1.2;
  padding-left: 12px;
  display: flex;
  align-items: center;
}

.article-row-item .topics-text {
  flex: 3.2;
  padding-left: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.topic-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.topic-pill.very-strong {
  background-color: #b0d5ed;
  color: #1a5d8a;
}

.topic-pill.strong {
  background-color: #a5e7d6;
  color: #006e53;
}

.topic-pill.medium {
  background-color: #eddcaa;
  color: #856610;
}

.topic-pill.weak {
  background-color: #eecaa5;
  color: #894500;
}

.topic-pill.very-weak {
  background-color: #f0adad;
  color: #820000;
}

.strength-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.strength-badge.very-strong {
  background-color: #b0d5ed;
  color: #1a5d8a;
}

.strength-badge.strong {
  background-color: #a5e7d6;
  color: #006e53;
}

.strength-badge.medium {
  background-color: #eddcaa;
  color: #856610;
}

.strength-badge.weak {
  background-color: #eecaa5;
  color: #894500;
}

.strength-badge.very-weak {
  background-color: #f0adad;
  color: #820000;
}

.article-row-item .link-btn {
  width: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #868e96;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.article-row-item .link-btn:hover {
  color: #e63946;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  font-size: 13px;
  gap: 12px;
  text-align: center;
}

.proper-noun-tag {
  background: rgba(108, 117, 125, 0.06);
  border: 1px solid rgba(108, 117, 125, 0.22);
  color: #495057;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Outfit', sans-serif;
  user-select: none;
}

.proper-noun-tag:hover {
  background: rgba(108, 117, 125, 0.14);
  border-color: rgba(108, 117, 125, 0.35);
  color: #212529;
  transform: translateY(-1px);
}

/* Strength Filter Buttons */
.strength-filter-group {
  display: flex;
  background-color: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.strength-filter-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.strength-filter-btn:hover {
  color: #212529;
}

.strength-filter-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

/* Dynamic columns when strength column is hidden */
.no-strength .col-title,
.no-strength .title-text {
  flex: 4.8 !important;
}

.no-strength .col-topics,
.no-strength .topics-text {
  flex: 3.8 !important;
}

/* Mobile block overlay */
.mobile-block-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f8f9fa;
  /* Matches the background of the app body */
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  color: #212529;
  font-family: 'Outfit', sans-serif;
  text-align: center;
}

.mobile-block-content {
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  padding: 40px 32px;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.mobile-block-logo {
  height: 56px;
  width: auto;
  margin-bottom: 20px;
}

.mobile-block-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1d24;
  /* Matches header title */
  margin-top: 0;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mobile-block-content p {
  font-size: 13.5px;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 14px;
}

.mobile-block-content strong {
  color: #1a1d24;
  font-weight: 600;
}

.mobile-block-footer {
  margin-top: 24px;
}

.mobile-block-footer .btn-primary-link {
  display: inline-block;
  background-color: #e63946;
  color: #ffffff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.mobile-block-footer .btn-primary-link:hover {
  background-color: #f75562;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2);
}

/* Media Query to show block overlay on mobile/tablet */
@media (max-width: 1024px) {
  .mobile-block-overlay {
    display: flex !important;
  }

  /* Prevent scrolling of background content */
  body {
    overflow: hidden !important;
  }
}

/* Modal backdrop and window styling */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(26, 29, 36, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  display: flex;
  opacity: 1;
}

.modal-window {
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #868e96;
  cursor: pointer;
  transition: color 0.15s ease;
  line-height: 1;
  padding: 0;
}

.modal-close-btn:hover {
  color: #212529;
}

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-logo {
  height: 36px;
  width: auto;
}

.modal-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1d24;
  margin: 0;
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #e63946;
  margin-top: 0;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section h3 ion-icon {
  font-size: 18px;
}

.modal-section p {
  font-size: 13.5px;
  line-height: 1.6;
  color: #495057;
  margin: 0 0 10px 0;
}

.modal-section ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-section li {
  font-size: 13px;
  line-height: 1.6;
  color: #495057;
}

.modal-section strong {
  color: #1a1d24;
}

/* Info button in header */
.info-btn {
  background: none;
  border: none;
  color: #868e96;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid #dee2e6;
  background-color: #f8f9fa;
  height: 36px;
  width: 36px;
  box-sizing: border-box;
}

.info-btn:hover {
  color: #e63946;
  border-color: rgba(230, 57, 70, 0.3);
  background-color: rgba(230, 57, 70, 0.04);
}

/* Timeline Dual Range Slider */
.timeline-slider-container {
  position: relative;
  height: 24px;
  margin-top: 10px;
}

.timeline-slider-track {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: #dee2e6;
  border-radius: 2px;
  z-index: 1;
}

.timeline-slider-track-highlight {
  position: absolute;
  top: 10px;
  height: 4px;
  background-color: #e63946;
  border-radius: 2px;
  z-index: 2;
}

.timeline-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
}

/* Chrome/Safari webkit styling */
.timeline-range-input::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #e63946;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.timeline-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Firefox styling */
.timeline-range-input::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #e63946;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.timeline-range-input::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Timeline View Panel Layout */
#timeline-view-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
  z-index: 5;
  display: none;
}

.timeline-view-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
}

.timeline-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.timeline-grain-selector {
  display: flex;
  background-color: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.grain-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.grain-btn:hover {
  color: #212529;
}

.grain-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

.timeline-card {
  flex: 1;
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

#timeline-chart-container {
  flex: 1;
  position: relative;
  width: 100%;
}

#timeline-chart-container svg {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

#timeline-chart-container path.area,
#timeline-chart-container path.trend-area {
  stroke: none !important;
  stroke-width: 0 !important;
}

#timeline-chart-container .domain {
  display: none !important;
}

#timeline-chart-container .tick line {
  stroke: #f4f5f7 !important;
}

/* Independent Sliding Drawer Pills on Canvas */
.drawer-pill {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 24px; /* Unified gap between trigger and button groups */
  background-color: #ffffff; /* White background */
  border: 1px solid #dee2e6;
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: none; /* No shadow */
  z-index: 7;
  padding: 4px 16px 4px 0; /* 0 left padding so tab is flush, 16px right padding */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(calc(100% - 28px)); /* default closed: show only the 28px tab */
  pointer-events: auto;
}

.drawer-pill.open {
  transform: translateX(0);
}

.drawer-pill.inspector-open {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Tab handle inside drawer pill */
.drawer-tab {
  width: 28px;
  height: 28px; /* Compact height matching the filter buttons */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  flex-shrink: 0;
}

.drawer-tab:hover {
  color: #1e293b;
}

.drawer-icon {
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotate icon when open */
.drawer-pill.open .drawer-icon {
  transform: rotate(180deg);
}

/* Clickable trigger wrapper inside drawer */
.drawer-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.drawer-trigger:hover .drawer-icon,
.drawer-trigger:hover .color-mode-label {
  color: #1e293b;
}

/* Hover & Onboarding Peek slide-out states (revealing labels only) */
#strength-drawer:not(.open):not(.just-closed):hover,
#strength-drawer.peek {
  transform: translateX(calc(100% - 190px));
}

#color-drawer:not(.open):not(.just-closed):hover,
#color-drawer.peek {
  transform: translateX(calc(100% - 165px));
}

#direction-drawer:not(.open):not(.just-closed):hover,
#direction-drawer.peek {
  transform: translateX(calc(100% - 170px));
}

/* Gradient Legend for Time Coloring Mode (fixed in bottom-right corner) */
.color-time-legend {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 6; /* behind drawers and inspector, but above canvas */
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.color-time-legend.inspector-open {
  right: 384px; /* 360px inspector sidebar + 24px padding */
}

.color-mode-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-mode-label {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  user-select: none;
  transition: color 0.2s ease;
}

.color-mode-btn {
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.color-mode-btn:hover {
  color: #212529;
}

.color-mode-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inspector-header .close-inspector {
  position: static;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #868e96;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  height: 36px;
  width: 36px;
  font-size: 20px;
  font-weight: 600;
  box-sizing: border-box;
  flex-shrink: 0;
}

.inspector-header .close-inspector:hover {
  color: #e63946;
  border-color: rgba(230, 57, 70, 0.3);
  background-color: rgba(230, 57, 70, 0.04);
}

/* Inspector Mode Tabs */
.inspector-mode-tabs {
  display: flex;
  background-color: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  gap: 4px;
  flex: 1;
}

.inspector-mode-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  text-align: center;
  box-sizing: border-box;
}

.inspector-mode-btn:hover {
  color: #212529;
}

.inspector-mode-btn.active {
  background-color: #e63946;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

/* Chronology Timeline */
.chronology-list-container {
  padding-left: 4px;
  position: relative;
}

.chronology-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

/* Vertical line */
.chronology-timeline-list::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  background-color: #dee2e6;
}

.chronology-item {
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chronology-item:hover .chronology-dot {
  border-color: #e63946;
  background-color: #ffffff;
}

.chronology-item:hover .chronology-card {
  border-color: #cbd5e1;
  background-color: #f8f9fa;
}

.chronology-dot {
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 3px solid #cbd5e1;
  z-index: 2;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.chronology-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
  transition: all 0.2s ease;
}

.chronology-item.active .chronology-dot {
  border-color: #e63946;
  background-color: #e63946;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

.chronology-item.active .chronology-card {
  border: 1px solid rgba(230, 57, 70, 0.25);
  background-color: rgba(230, 57, 70, 0.03);
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.05);
}

.chronology-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #1a1d24;
  line-height: 1.4;
}

.chronology-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 600;
}

/* Collapsible Sidebar Sections */
.sidebar-section.collapsible {
  padding: 0;
}

.sidebar-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.sidebar-section-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-icon {
  font-size: 16px;
  color: #64748b;
  transition: transform 0.2s ease;
}

.sidebar-section-body {
  margin-top: 12px;
  transition: all 0.2s ease;
  overflow: visible;
}

/* Collapsed state */
.sidebar-section.collapsible.collapsed .sidebar-section-body {
  display: none;
}

.sidebar-section.collapsible.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.sidebar-section.list-section .sidebar-section-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section.list-section.collapsed {
  flex: none;
}