/**
 * Custom Topic Page — ESPN-style layout
 *
 * Sticky nav bar with topic branding + tab links,
 * full-page collection rendering below.
 */

/* =============================================================================
   Page Container
   ============================================================================= */

/* Disable sticky on the global nav bar for custom topic pages */
.page-topic-custom .top-nav-bar {
  position: relative;
}

/* Break out of Pico .container max-width */
.topic-custom-page {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: 100vh;
}

/* Override sticky top values to account for taller topic custom nav (~113px) */
.page-topic-custom .library-preview-panel {
  top: 180px;
  max-height: calc(100vh - 200px);
}

.page-topic-custom .timeline-legend {
  top: 180px;
}

/* =============================================================================
   Sticky Nav Bar
   ============================================================================= */

.topic-custom-nav {
  position: relative;
  z-index: 1100;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: none;
}

/* Tabs bar when moved outside nav by JS — sticky on its own */
.topic-custom-nav-tabs.sticky-tabs {
  position: sticky;
  top: 0;
  z-index: 1100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-left: 3.5rem;
}

.topic-custom-nav-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 1.5rem 0 3.5rem;
}

/* Brand row (Logo + Name + Actions) */
.topic-custom-nav-brand-row {
  display: flex;
  align-items: center;
  padding: 12px 0 8px;
  gap: 1rem;
}

/* Brand (Logo + Name) */
.topic-custom-nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.topic-custom-nav-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
}

.topic-custom-nav-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.topic-custom-nav-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.topic-custom-nav-name {
  font-size: 1.35rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* =============================================================================
   Tab Links
   ============================================================================= */

.topic-custom-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.topic-custom-nav-tabs::-webkit-scrollbar {
  display: none;
}

.topic-custom-nav-tabs .topic-custom-tab:first-child,
.topic-custom-nav-tabs .topic-custom-tab-dropdown:first-child .topic-custom-tab {
  padding-left: 0;
}

.topic-custom-tab {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.75));
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s;
  outline: none;
}

.topic-custom-tab:focus,
.topic-custom-tab:focus-visible,
.topic-custom-tab:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

.tab-inline-rename,
.tab-inline-rename:focus,
.tab-inline-rename:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  border: none !important;
  border-bottom: 1px solid var(--accent-color, #3b82f6) !important;
  border-radius: 0;
}

.topic-custom-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.topic-custom-tab.active {
  color: white;
  font-weight: 600;
}

/* Active underline */
.topic-custom-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 0.15s, box-shadow 0.15s;
}

.topic-custom-nav-tabs .topic-custom-tab:first-child::after,
.topic-custom-nav-tabs .topic-custom-tab-dropdown:first-child .topic-custom-tab::after {
  left: 0;
}

.topic-custom-tab.active::after {
  background: white;
}

/* Add tab button */
.topic-custom-tab.add-tab-btn {
  color: rgba(255, 255, 255, 0.5);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.topic-custom-tab.add-tab-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}
.topic-custom-tab.add-tab-btn::after {
  display: none;
}
.topic-custom-tab.add-tab-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* Community dropdown tab */
.topic-custom-tab-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  /* Extra bottom padding creates a hover bridge to the menu */
  padding-bottom: 4px;
  margin-bottom: -4px;
}

.topic-tab-dropdown-chevron {
  margin-left: 3px;
  opacity: 0.6;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.topic-custom-tab-dropdown:hover .topic-tab-dropdown-chevron,
.topic-custom-tab-dropdown.dropdown-open .topic-tab-dropdown-chevron {
  transform: rotate(180deg);
}

.topic-tab-dropdown-menu {
  display: none;
  position: fixed;
  z-index: 200;
  min-width: 140px;
  background: var(--color-bg-base-mid, #1e2028);
  border: 1px solid var(--color-border-secondary, rgba(255, 255, 255, 0.06));
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.topic-tab-dropdown-menu.open {
  display: block;
}

.topic-tab-dropdown-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.75));
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}

.topic-tab-dropdown-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.topic-tab-dropdown-option.active {
  color: white;
  font-weight: 600;
}

/* =============================================================================
   Admin Controls (Right side of nav)
   ============================================================================= */

.topic-custom-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 0.5rem;
}

.topic-custom-edit-btn,
.topic-custom-gear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  outline: none;
}

.topic-custom-edit-btn svg,
.topic-custom-gear-btn svg {
  stroke: rgba(255, 255, 255, 0.6);
  fill: none;
  flex-shrink: 0;
  pointer-events: none;
}

.topic-custom-edit-btn:hover,
.topic-custom-gear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white !important;
}

.topic-custom-edit-btn:hover svg,
.topic-custom-gear-btn:hover svg {
  stroke: white;
}

/* Gear Dropdown */
.topic-custom-gear-wrapper {
  position: relative;
}

.topic-custom-gear-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #1e2430;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.25rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.gear-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  outline: none;
}

.gear-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.gear-dropdown-item-warn {
  color: rgba(255, 160, 100, 0.9);
}

.gear-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.25rem 0;
}

/* =============================================================================
   Content Area
   ============================================================================= */

.topic-custom-content {
  min-height: calc(100vh - 40px);
  padding-top: 24px;
}

/* Loading state */
.topic-custom-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Coming soon state */
.topic-custom-coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1rem;
}

/* Empty state */
.topic-custom-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.topic-custom-empty h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
}

.topic-custom-empty p {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.topic-custom-empty-action {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: rgba(0, 168, 255, 0.15);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 6px;
  color: #00a8ff;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.topic-custom-empty-action:hover {
  background: rgba(0, 168, 255, 0.25);
}

/* Logo shape modifier */
.topic-custom-nav-logo.logo-circle {
  border-radius: 50%;
  object-fit: cover;
  width: 56px;
  height: 56px;
}

/* =============================================================================
   Settings Modal
   ============================================================================= */

.tc-settings-section {
  margin-bottom: 1.5rem;
}

.tc-settings-section:last-child {
  margin-bottom: 0.5rem;
}

.tc-settings-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tc-settings-sublabel {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 0.75rem;
}

.tc-settings-logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tc-settings-logo-preview {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tc-settings-logo-img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

.tc-settings-logo-img.logo-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  max-width: none;
  max-height: none;
}

.tc-settings-logo-placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.tc-settings-logo-controls {
  display: flex;
  gap: 0.5rem;
}

.tc-settings-shape-row {
  display: flex;
  align-items: center;
  margin-top: 0.6rem;
}

.tc-settings-shape-options {
  display: flex;
  gap: 0.35rem;
}

.tc-settings-shape-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.4) !important;
  cursor: pointer;
  transition: all 0.15s;
}

.tc-settings-shape-btn svg {
  stroke: rgba(255, 255, 255, 0.4);
  fill: none;
}

.tc-settings-shape-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7) !important;
}

.tc-settings-shape-btn:hover svg {
  stroke: rgba(255, 255, 255, 0.7);
}

.tc-settings-shape-btn.active {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 168, 255, 0.4);
  color: #00a8ff !important;
}

.tc-settings-shape-btn.active svg {
  stroke: #00a8ff;
}

.tc-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.tc-settings-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tc-settings-btn-subtle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.tc-settings-btn-subtle:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tc-settings-btn-warn {
  background: rgba(255, 160, 100, 0.08);
  border-color: rgba(255, 160, 100, 0.25);
  color: rgba(255, 160, 100, 0.9);
}

.tc-settings-btn-warn:hover {
  background: rgba(255, 160, 100, 0.15);
}

.tc-settings-danger {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tc-settings-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.tc-settings-thumbnail-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tc-settings-thumbnail-img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =============================================================================
   Topic Page Discovery Bars — match portfolio page container styling
   ============================================================================= */

.topic-custom-page .library-topic-filter-section .discovery-bar {
  background: transparent;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md, 8px);
  padding: 0.5rem 0.75rem;
  min-height: 36px;
}

.topic-custom-page .library-topic-filter-section .discovery-link {
  font-size: 0.75rem;
}

.topic-custom-page .filter-pill {
  padding: 0;
  padding-inline: 8px;
  height: 20px;
  border-radius: 3px;
  background: rgba(0, 168, 255, 0.12);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: #00a8ff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  box-sizing: border-box;
}

.topic-custom-page .filter-pill-remove {
  color: rgba(0, 168, 255, 0.6);
}

.topic-custom-page .filter-pill-remove:hover {
  color: #00a8ff;
}

/* =============================================================================
   Inline Timeline View
   ============================================================================= */

.topic-custom-timeline-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.topic-custom-timeline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.5);
}

.topic-custom-timeline-wrapper .timeline-sort-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0 1rem;
}

.topic-custom-timeline-wrapper .timeline-sort-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-secondary, #aaa);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.topic-custom-timeline-wrapper .timeline-sort-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

/* Sticky dropdowns row (zoom/sort/type) below the sticky tabs bar */
.topic-custom-timeline-wrapper .library-dropdowns-row {
  position: sticky;
  top: 37px;
  z-index: 89;
  background: #1a1c22;
  padding-top: 8px;
  padding-bottom: 8px;
  margin-bottom: 0;
}

.topic-custom-timeline-wrapper .library-dropdowns-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: inherit;
  z-index: -1;
}

/* Legend sticks below tabs (37px) + dropdowns row (~44px) */
.topic-custom-timeline-wrapper .timeline-legend {
  top: 81px;
  max-height: calc(100vh - 95px);
  margin-left: -150px;
}

@media (max-width: 900px) {
  .topic-custom-timeline-wrapper .timeline-legend {
    margin-left: 0;
  }
}


/* =============================================================================
   Inline Library View
   ============================================================================= */

/* Library wrapper uses .topic-page class so entity-page.css styles apply */
/* Horizontal padding comes from child .section-container (2rem) — don't double it */
.topic-custom-library-wrapper {
  padding: 1rem 0;
}

/* Ensure the section-container doesn't get constrained by parent */
.topic-custom-library-wrapper .section-container {
  margin: 0 auto;
}

/* Override entity-page.css CSS Grid — masonry JS uses absolute positioning */
.topic-custom-library-wrapper.topic-page .library-grid {
  display: block;
  position: relative;
  padding: 0;
  min-height: 200px;
}

.topic-custom-library-wrapper.topic-page .library-grid .masonry-item {
  position: absolute;
  box-sizing: border-box;
}

/* =============================================================================
   Header Style Toggle (Settings Modal)
   ============================================================================= */

.tc-settings-toggle-row {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-settings-toggle-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tc-settings-toggle-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}

.tc-settings-toggle-btn.active {
  background: rgba(0, 168, 255, 0.12);
  color: #00a8ff;
  font-weight: 600;
}

/* =============================================================================
   Athlete Header Bar (Nav Context)
   ============================================================================= */

.topic-custom-athlete-header {
  display: flex;
  align-items: stretch;
  padding: 0;
  gap: 0;
  position: relative;
  overflow: hidden;
  margin-left: -3.5rem;
  margin-right: -1.5rem;
  padding-left: 3.5rem;
  padding-right: 1.5rem;
  min-height: 145px;
}

.topic-custom-athlete-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.tca-inner {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  gap: 0;
}

/* Image section */
.tca-image-section {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.tca-bg-image {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80px;
  right: -40px;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
  clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
}

.tca-image {
  width: 130px;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.tca-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.tca-image .ah-image-placeholder {
  color: rgba(255, 255, 255, 0.25);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.tca-image .ah-image-placeholder svg {
  width: 48px;
  height: 48px;
}

/* Identity section */
.tca-identity-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 64px;
  padding-bottom: 16px;
  min-width: 0;
  position: relative;
}

.tca-name {
  line-height: 1;
}

.tca-first-name {
  font-size: 18px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.tca-last-name {
  font-size: 34px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: white;
  line-height: 1.1;
}

.tca-last-name.tca-placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.tca-team-line {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}

.tca-org-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

/* Org mode — smaller image */
.tca-org-mode .tca-image-section {
  width: 200px;
  align-items: center;
}

.tca-org-mode .tca-image {
  width: 130px;
  height: 130px;
  align-items: center;
  overflow: visible;
}

.tca-org-mode .tca-image img {
  border-radius: 4px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.tca-org-mode .tca-name .tca-last-name {
  text-transform: none;
  letter-spacing: normal;
}

.tca-org-mode .tca-image .ah-image-placeholder svg {
  width: 32px;
  height: 32px;
}

/* Org identity — nudge name + socials down */
.tca-org-mode .tca-identity-section {
  padding-top: 21px;
}

/* Org image — circular shape option */
.tca-org-mode .tca-image.org-image-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px;
}

.tca-org-mode .tca-image.org-image-circle img {
  border-radius: 50%;
  object-fit: cover;
}

/* Org image shape toggle in editor */
.org-image-shape-toggle {
  text-align: center;
}

.org-image-shape-toggle label {
  font-size: 0.6rem !important;
  margin-bottom: 3px !important;
}

.org-shape-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 3px 10px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.org-shape-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.org-shape-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.org-shape-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

/* Circle preview in editor */
.athlete-header-image.org-image-circle {
  border-radius: 50% !important;
  overflow: hidden;
}

.athlete-header-image.org-image-circle img {
  border-radius: 50%;
  object-fit: cover;
}

/* Org decals row (view) */
.tca-org-decals {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 4px;
  flex-wrap: wrap;
}

.tca-org-decal {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.tca-org-decal-dot {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 6px;
}

/* Org decals editor */
.org-decals-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org-decal-item {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.org-decal-value {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px 0 0 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  outline: none;
  line-height: 1.3;
}

.org-decal-value:focus {
  border-color: rgba(0, 168, 255, 0.4);
}

.org-decal-value:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.25);
}

.org-decal-item .wysiwyg-remove-btn {
  width: 28px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.org-decal-item .wysiwyg-remove-btn:hover {
  background: #005a9e;
}

/* Timeline featured cards in library (table preview) */
.library-preview-content .timeline-featured-card {
  position: relative;
  width: 100%;
  min-height: 240px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.tca-identity-section > .ah-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 6px;
}

.tca-identity-section > .ah-social .ah-social-link {
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.15s;
}

.tca-identity-section > .ah-social .ah-social-link svg {
  width: 18px;
  height: 18px;
}

.tca-identity-section > .ah-social .ah-social-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Divider */
.tca-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.08);
  margin: 16px 0;
  flex-shrink: 0;
}

/* Fields section */
.tca-fields-section {
  padding: 16px 64px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.tca-bio-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tca-bio-table .ah-bio-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1px 0;
}

.tca-bio-table .ah-bio-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  min-width: 70px;
  flex-shrink: 0;
}

.tca-bio-table .ah-bio-value {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
  position: relative;
  top: -2px;
  white-space: nowrap;
}

.tca-bio-table .ah-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tca-bio-table .ah-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.tca-bio-table .ah-status-dot.injured { background: #f87171; }
.tca-bio-table .ah-status-dot.inactive { background: #94a3b8; }

/* Stats section */
.tca-stats-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tca-stats-section {
  padding: 16px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.tca-stats-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding-bottom: 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tca-stats-grid {
  display: flex;
  gap: 40px;
}

.tca-stat {
  text-align: center;
}

.tca-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.1;
}

.tca-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Stats card variant */
.tca-stats-section.tca-stats-card {
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.tca-stats-card .tca-stats-card-header {
  min-height: 6px;
  width: 100%;
  text-align: center;
  padding: 0;
}

.tca-stats-card .tca-stats-card-header:has(.tca-stats-card-title:not(:empty)),
.tca-stats-card .tca-stats-card-header:has(.tca-stats-card-subtitle:not(:empty)) {
  padding: 5px 16px;
}

.tca-stats-card-title {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.tca-stats-card-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  margin-top: 1px;
  line-height: 1.2;
}

.tca-stats-card .tca-stats-grid {
  padding: 6px 40px 10px;
  gap: 40px;
}

/* Admin actions within athlete header */
.tca-actions {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* =============================================================================
   WYSIWYG Athlete Header Editor (mirrors collection-editor-unified.css)
   ============================================================================= */

/* Overlay */
.athlete-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

/* Container */
.wysiwyg-editor-container {
  width: 100%;
  margin: 10px;
  background: var(--color-bg-elevated, #141416);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 95vh;
}

.wysiwyg-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wysiwyg-editor-type-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: capitalize;
}

.wysiwyg-editor-actions {
  display: flex;
  gap: 8px;
}

.athlete-editor-cancel,
.athlete-editor-save {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.athlete-editor-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.athlete-editor-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.athlete-editor-save {
  background: rgba(0, 168, 255, 0.15);
  border: 1px solid rgba(0, 168, 255, 0.3);
  color: #00a8ff;
}

.athlete-editor-save:hover {
  background: rgba(0, 168, 255, 0.25);
  border-color: rgba(0, 168, 255, 0.5);
}

/* Block wrapper */
.wysiwyg-editor-block-wrapper {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Athlete header block (reuse collection editor classes) */
.wysiwyg-editor-block-wrapper .athlete-header-block {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  overflow: visible;
  min-height: 120px;
}

.wysiwyg-editor-block-wrapper .athlete-header-image-section {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

/* Faded background image in editor */
.wysiwyg-editor-block-wrapper .ath-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
}

/* Background image upload button (top-right corner) */
.wysiwyg-editor-block-wrapper .ath-bg-upload {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.15s;
  opacity: 0;
}

.wysiwyg-editor-block-wrapper .athlete-header-image-section:hover .ath-bg-upload {
  opacity: 1;
}

.wysiwyg-editor-block-wrapper .ath-bg-upload:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.wysiwyg-editor-block-wrapper .athlete-header-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

/* Org header editor: rectangular by default, circle only when toggled */
#orgHeaderEditorModal .athlete-header-image {
  border-radius: 8px;
  background: transparent;
}
#orgHeaderEditorModal .athlete-header-image.org-image-circle {
  border-radius: 50%;
}

.wysiwyg-editor-block-wrapper .athlete-header-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wysiwyg-editor-block-wrapper .athlete-header-image-placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.wysiwyg-editor-block-wrapper .wysiwyg-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 50%;
  cursor: pointer;
}

.wysiwyg-editor-block-wrapper .wysiwyg-image-upload:hover .wysiwyg-image-overlay {
  opacity: 1;
}

/* Org header editor: match overlay border-radius to image shape */
#orgHeaderEditorModal .wysiwyg-image-overlay {
  border-radius: 8px;
}
#orgHeaderEditorModal .org-image-circle .wysiwyg-image-overlay {
  border-radius: 50%;
}

/* Reposition button in editor */
.image-reposition-btn {
  margin-top: 8px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  z-index: 2;
}

.image-reposition-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Image Repositioner Overlay */
.image-repositioner-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.image-repositioner-panel {
  background: var(--color-bg-base-mid, #1e2028);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 360px;
  max-width: 90vw;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-repositioner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.image-repositioner-actions {
  display: flex;
  gap: 8px;
}

.image-repositioner-cancel,
.image-repositioner-save {
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.image-repositioner-cancel {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.image-repositioner-cancel:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.image-repositioner-save {
  color: #fff;
  background: var(--color-accent, #00a8ff);
}

.image-repositioner-save:hover {
  background: #0090e0;
}

.image-repositioner-preview-area {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.image-repositioner-container {
  width: 200px;
  height: 200px;
  overflow: hidden;
  border-radius: 4px;
  cursor: grab;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.image-repositioner-container:active {
  cursor: grabbing;
}

.image-repositioner-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.image-repositioner-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
}

.image-repositioner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
}

.image-repositioner-zoom-label {
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.image-repositioner-zoom {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
}

.image-repositioner-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.image-repositioner-zoom::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.wysiwyg-editor-block-wrapper .athlete-header-info-section {
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wysiwyg-editor-block-wrapper .athlete-header-name {
  margin-bottom: 4px;
}

.wysiwyg-editor-block-wrapper .athlete-header-first-name {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.wysiwyg-editor-block-wrapper .athlete-header-last-name {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#orgHeaderEditorModal .athlete-header-last-name {
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.1;
}

/* Contenteditable states */
.wysiwyg-editor-block-wrapper [contenteditable="true"] {
  outline: none;
  cursor: text;
  border-radius: 3px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  min-width: 20px;
}

.wysiwyg-editor-block-wrapper [contenteditable="true"]:hover {
  background: rgba(0, 168, 255, 0.06);
}

.wysiwyg-editor-block-wrapper [contenteditable="true"]:focus {
  background: rgba(0, 168, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.25);
}

.wysiwyg-editor-block-wrapper [contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

/* Field rows */
.wysiwyg-editor-block-wrapper .athlete-header-fields-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.wysiwyg-editor-block-wrapper .athlete-header-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.wysiwyg-editor-block-wrapper .athlete-header-field-row .athlete-header-bio-label {
  min-width: 80px;
  flex-shrink: 0;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.wysiwyg-editor-block-wrapper .athlete-header-field-row .athlete-header-bio-value {
  flex: 1;
  color: #fff;
  font-weight: 500;
}

.wysiwyg-editor-block-wrapper .athlete-header-field-row .athlete-header-team-line {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.wysiwyg-separator {
  color: rgba(255, 255, 255, 0.3);
  user-select: none;
}

/* Status */
.athlete-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.athlete-header-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.athlete-header-status-dot.inactive { background: #ef4444; }
.athlete-header-status-dot.injured { background: #f59e0b; }
.athlete-header-status-dot.retired { background: #6b7280; }

/* Field remove button */
.wysiwyg-field-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 60, 60, 0.15);
  color: rgba(255, 60, 60, 0.6);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.athlete-header-field-row:hover .wysiwyg-field-remove {
  opacity: 1;
}
.wysiwyg-field-remove:hover {
  background: rgba(255, 60, 60, 0.35);
  color: #ff4040;
}

/* Field drag handle */
.wysiwyg-field-drag-handle {
  cursor: grab;
  color: rgba(255, 255, 255, 0.15);
  font-size: 12px;
  line-height: 1;
  user-select: none;
  padding: 2px 0;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.athlete-header-field-row:hover .wysiwyg-field-drag-handle {
  opacity: 1;
}
.wysiwyg-field-drag-handle:active {
  cursor: grabbing;
}

/* Drag states */
.athlete-header-field-row.field-row-dragging {
  opacity: 0.3;
}
.athlete-header-field-row.field-row-drag-over {
  border-top: 2px solid rgba(0, 168, 255, 0.6);
}

/* Add field button & dropdown */
.wysiwyg-add-field-wrapper {
  position: relative;
}
.wysiwyg-add-field-btn {
  padding: 4px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}
.wysiwyg-add-field-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.8);
}

/* Native select dropdown for add field */
.athlete-editor-overlay .wysiwyg-add-field-select {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: var(--color-bg-elevated, #1a1c22);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  outline: none;
}
.athlete-editor-overlay .wysiwyg-add-field-select:focus {
  border-color: rgba(0, 168, 255, 0.5);
}
.athlete-editor-overlay .wysiwyg-add-field-select option,
.athlete-editor-overlay .wysiwyg-add-field-select optgroup {
  background: #0c0c0e;
  color: #fff;
}

.wysiwyg-add-field-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  max-height: calc(3 * 33px + 8px); /* 3 items + padding */
  overflow-y: auto;
  background: var(--color-bg-elevated, #1a1c22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.wysiwyg-add-field-dropdown::-webkit-scrollbar {
  width: 4px;
}

.wysiwyg-add-field-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.wysiwyg-add-field-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.wysiwyg-field-option {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.wysiwyg-field-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Social links */
.wysiwyg-editor-block-wrapper .athlete-header-social {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.wysiwyg-editor-block-wrapper .athlete-header-social-link {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
  cursor: pointer;
}
.wysiwyg-editor-block-wrapper .athlete-header-social-link.has-value {
  color: #00a8ff;
}
.wysiwyg-editor-block-wrapper .athlete-header-social-link:hover {
  color: #00a8ff;
}
.wysiwyg-editor-block-wrapper .athlete-header-social-link svg {
  width: 20px;
  height: 20px;
}

/* Generic link add button (inline with social icons) */
.wysiwyg-editor-block-wrapper .tca-add-generic-link {
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: color 0.2s ease;
}

.wysiwyg-editor-block-wrapper .tca-add-generic-link:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Inline URL popover */
.wysiwyg-inline-popover {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--color-bg-elevated, #1a1c22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.wysiwyg-inline-popover input {
  width: 240px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: white;
  font-size: 13px;
  outline: none;
}

.wysiwyg-inline-popover input:focus {
  border-color: rgba(0, 168, 255, 0.4);
}

.wysiwyg-inline-popover button {
  padding: 6px 12px;
  background: rgba(0, 168, 255, 0.15);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 4px;
  color: #00a8ff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.wysiwyg-inline-popover button:hover {
  background: rgba(0, 168, 255, 0.25);
}

/* Team topic link button (in editor) */
.wysiwyg-team-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wysiwyg-team-topic-link,
.wysiwyg-league-topic-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.wysiwyg-team-topic-link:hover,
.wysiwyg-league-topic-link:hover {
  background: rgba(0, 168, 255, 0.15);
  color: #00a8ff;
}

.wysiwyg-team-topic-link.has-topic,
.wysiwyg-league-topic-link.has-topic {
  background: rgba(0, 168, 255, 0.15);
  color: #00a8ff;
}

/* Team link in view */
.tca-team-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.tca-team-link:hover {
  color: white;
}

/* Topic search popover */
.wysiwyg-topic-search-popover {
  width: 280px;
  background: var(--color-bg-elevated, #1a1c22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.topic-search-header {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topic-search-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: white;
  font-size: 13px;
  outline: none;
}

.topic-search-input:focus {
  border-color: rgba(0, 168, 255, 0.4);
}

.topic-search-unlink {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: 4px;
  color: #ff5050;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
}

.topic-search-unlink:hover {
  background: rgba(255, 80, 80, 0.2);
}

.topic-search-results {
  max-height: 240px;
  overflow-y: auto;
}

.topic-search-hint {
  padding: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
}

.topic-search-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: white;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.topic-search-option:first-child {
  border-top: none;
}

.topic-search-option:hover {
  background: rgba(0, 168, 255, 0.08);
}

.topic-search-name {
  font-weight: 500;
}

.topic-search-type {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: capitalize;
}

/* Stats header block (in editor) */
.wysiwyg-editor-block-wrapper .stats-header-block {
  padding: 0;
}

.wysiwyg-editor-block-wrapper .stats-header-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 8px 16px 4px;
}

.wysiwyg-editor-block-wrapper .stats-header-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px;
  align-items: flex-start;
}

.wysiwyg-editor-block-wrapper .stats-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  position: relative;
  padding: 4px 8px;
}

.wysiwyg-editor-block-wrapper .stats-header-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.wysiwyg-editor-block-wrapper .stats-header-value {
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-align: center;
  line-height: 1.1;
}

/* Tiny dot remove for stats in athlete header editor */
.athlete-editor-overlay .stats-header-stat .wysiwyg-remove-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px;
  max-width: 14px;
  padding: 0;
  border: 1px solid rgba(255, 80, 80, 0.25);
  background: rgba(255, 80, 80, 0.15);
  color: rgba(255, 80, 80, 0.7);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.stats-header-stat:hover .wysiwyg-remove-btn {
  opacity: 1;
}
.stats-header-stat .wysiwyg-remove-btn:hover {
  background: rgba(255, 80, 80, 0.3);
  color: #ff5050;
}

/* Stats editor header row (label + style toggle + color picker) */
.tca-editor-stats-section {
  margin-top: 16px;
}

.tca-editor-stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tca-editor-stats-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tca-stats-style-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.tca-stats-style-btn {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tca-stats-style-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.tca-stats-style-btn.active {
  background: rgba(0, 168, 255, 0.15);
  border-color: rgba(0, 168, 255, 0.4);
  color: #00a8ff;
}

.tca-editor-stats-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.tca-stats-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tca-stats-color-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.tca-stats-color-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.tca-stats-color-swatch {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  top: -5px;
}

/* Stats editor subtitle */
.tca-editor-stats-subtitle {
  text-align: center;
  padding: 0 16px;
}
.tca-editor-stats-subtitle [contenteditable] {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  outline: none;
  display: inline-block;
  min-width: 80px;
}

.wysiwyg-add-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin-top: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.wysiwyg-add-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.8);
}

/* Small input for team color */
.tc-settings-input {
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s;
}

.tc-settings-input:focus {
  border-color: rgba(0, 168, 255, 0.4);
}

.tc-settings-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* =============================================================================
   Tablet Responsive — athlete header at intermediate widths
   ============================================================================= */

@media (max-width: 1100px) {
  .tca-image-section {
    width: 160px;
  }
  .tca-image {
    width: 110px;
    height: 110px;
  }
  .tca-identity-section {
    padding: 12px 20px;
    padding-bottom: 24px;
  }
  .tca-first-name { font-size: 14px; }
  .tca-last-name { font-size: 24px; }
  .tca-fields-section {
    padding: 12px 20px;
  }
  .tca-stats-section {
    padding: 12px 20px;
  }
  .tca-stat-value { font-size: 22px; }
  .tca-stat-label { font-size: 10px; }
  .tca-stats-card .tca-stats-grid {
    gap: 12px;
  }
  .tca-identity-section > .ah-social {
    gap: 0.4rem;
  }
  .tca-identity-section > .ah-social .ah-social-link svg {
    width: 16px;
    height: 16px;
  }
  .tca-bg-image {
    left: -40px;
    right: -20px;
  }
}

@media (max-width: 900px) {
  .topic-custom-athlete-header {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1rem;
  }
  .tca-image-section {
    width: 130px;
  }
  .tca-image {
    width: 90px;
    height: 90px;
  }
  .tca-identity-section {
    padding: 8px 12px;
    padding-bottom: 16px;
  }
  .tca-first-name { font-size: 12px; }
  .tca-last-name { font-size: 20px; }
  .tca-team-line { font-size: 12px; }
  .tca-fields-section {
    padding: 8px 12px;
  }
  .tca-bio-table .ah-bio-label {
    font-size: 0.6rem;
    min-width: 55px;
  }
  .tca-bio-table .ah-bio-value {
    font-size: 0.6rem;
  }
  .tca-identity-section > .ah-social {
    gap: 0.3rem;
  }
  .tca-identity-section > .ah-social .ah-social-link svg {
    width: 14px;
    height: 14px;
  }
  .tca-bg-image {
    left: -20px;
    right: -10px;
  }
  .tca-stats-section {
    padding: 8px 8px;
  }
  .tca-stats-card .tca-stats-grid {
    gap: 8px;
  }
  .tca-stat-value { font-size: 18px; }
  .tca-stat-label { font-size: 9px; }
}

/* =============================================================================
   Mobile Responsive
   ============================================================================= */

@media (max-width: 768px) {
  /* Topic page discovery bars — match portfolio mobile sizing */
  .topic-custom-page .library-topic-filter-section {
    padding: 0.25rem 0 0.5rem;
  }

  /* Mobile overrides for sticky tabs */
  .topic-custom-nav-tabs.sticky-tabs {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-left: 0.75rem;
  }

  .topic-custom-nav-inner {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .topic-custom-nav-name {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topic-custom-nav-brand::after {
    display: none;
  }

  .topic-custom-tab {
    padding: 0 0.75rem;
    font-size: 0.78rem;
  }

  /* Timeline wrapper: no horizontal padding, items-list handles content margins */
  .topic-custom-timeline-wrapper {
    padding: 1rem 0;
  }

  /* Filter bars: match section-container padding */
  .topic-custom-timeline-wrapper .library-filters-container {
    padding: 0 1rem;
  }

  /* Timeline content: fill viewport on mobile */
  .topic-custom-timeline-wrapper .timeline-viewer-main {
    width: 100%;
    padding: 0;
  }

  /* ---- Athlete Header: mobile grid layout ---- */

  .topic-custom-athlete-header {
    min-height: auto;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0;
    padding-right: 0;
  }

  .tca-inner {
    display: grid;
    grid-template-columns: 36% minmax(0, 1fr);
    overflow: hidden;
  }

  /* Image: spans rows 1-3, contained within cell (no clipping) */
  .tca-image-section {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 100%;
    align-items: flex-end;
    justify-content: flex-start;
  }
  .tca-image {
    width: 100%;
    height: 100%;
  }
  .tca-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom left;
  }
  .tca-bg-image {
    left: 0;
    right: -20px;
    clip-path: polygon(0% 0%, 100% 0%, 65% 100%, 0% 100%);
  }

  /* Row 1: Name + team line */
  .tca-identity-section {
    grid-column: 2;
    grid-row: 1;
    padding: 24px 16px 1px;
    padding-bottom: 1px;
    position: static;
    text-align: left;
    align-items: flex-start;
  }
  .tca-first-name { font-size: 18px; }
  .tca-last-name { font-size: 28px; }
  .tca-team-line { font-size: 13px; margin-top: 2px; }

  /* Row 2: Bio fields — CSS grid for guaranteed column alignment */
  .tca-fields-section {
    display: block;
    grid-column: 2;
    grid-row: 2;
    padding: 1px 16px 12px;
    min-width: 0;
    overflow: hidden;
  }
  .tca-bio-table {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1px 0.75rem;
    text-align: left;
  }
  .tca-bio-table .ah-bio-row {
    display: contents;
  }
  .tca-bio-table .ah-bio-label {
    font-size: 0.65rem;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
  }
  .tca-bio-table .ah-bio-value {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    top: -1px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* Social links — inside identity section, no grid override needed */
  .tca-identity-section > .ah-social {
    margin-top: 4px;
    justify-content: flex-start;
  }

  .tca-identity-section > .ah-social .ah-social-link svg {
    width: 15px;
    height: 15px;
  }

  /* Dividers hidden on mobile */
  .tca-divider { display: none; }

  /* Stats: full width below header, spanning both columns */
  .tca-stats-wrapper,
  .tca-inner > .tca-stats-section {
    display: flex;
    justify-content: center;
    grid-column: 1 / -1;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0;
  }
  .tca-stats-section { padding: 8px 16px; }
  .tca-stats-section.tca-stats-card { width: 90%; margin: 0 auto; }
  .tca-stats-grid { gap: 24px; justify-content: center; }
  .tca-stat-value { font-size: 20px; }
  .tca-stat-label { font-size: 9px; }

  /* ---- Editor modal: stack vertically on mobile ---- */
  .wysiwyg-editor-block-wrapper .athlete-header-block {
    flex-direction: column;
  }
  .wysiwyg-editor-block-wrapper .athlete-header-image-section {
    width: 100%;
    padding: 12px;
  }
  .wysiwyg-editor-block-wrapper .athlete-header-image {
    width: 80px;
    height: 80px;
  }
}


/* =============================================================================
   Dataset Manager
   ============================================================================= */

.dataset-manager-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dataset-manager-content {
  background: rgba(42, 44, 48, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg, 0.75rem);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(var(--color-primary-rgb, 0, 168, 255), 0.08);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dataset-editor-content {
  max-width: 850px;
}

.dataset-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-xl, 1.5rem);
  border-bottom: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.2);
}

.dataset-manager-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary, #e0e0e0);
}

.dataset-manager-close {
  background: none;
  border: none;
  color: var(--color-text-secondary, #999);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.dataset-manager-close:hover {
  color: var(--color-text-primary, #e0e0e0);
  background: rgba(255, 255, 255, 0.05);
}

.dataset-manager-body {
  padding: var(--spacing-xl, 1.5rem);
  overflow-y: auto;
  flex: 1;
}

.dataset-manager-body::-webkit-scrollbar {
  width: 8px;
}

.dataset-manager-body::-webkit-scrollbar-track {
  background: rgba(24, 34, 54, 0.5);
  border-radius: var(--radius-sm, 0.25rem);
}

.dataset-manager-body::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.3);
  border-radius: var(--radius-sm, 0.25rem);
}

.dataset-manager-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.5);
}

/* List view */
.dataset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dataset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.04);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.1);
  border-radius: 8px;
  gap: 12px;
}

.dataset-card:hover {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.08);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.2);
}

.dataset-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.dataset-card-name {
  font-weight: 500;
  color: var(--color-text-primary, #e0e0e0);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dataset-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #888);
}

.dataset-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dataset-published-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dataset-published-badge.published {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
  color: rgb(var(--color-primary-rgb, 0, 168, 255));
}

.dataset-published-badge.unpublished {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary, #888);
}

.dataset-action-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary, #888);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.dataset-action-btn:hover {
  color: var(--color-text-primary, #e0e0e0);
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.1);
}

.dataset-delete-btn:hover {
  color: #ef5350;
}

.dataset-add-btn {
  width: 100%;
  padding: 10px;
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.05);
  border: 1px dashed rgba(var(--color-primary-rgb, 0, 168, 255), 0.25);
  border-radius: 8px;
  color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.8);
  cursor: pointer;
  font-size: 0.85rem;
}

.dataset-add-btn:hover {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.1);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.4);
  color: rgb(var(--color-primary-rgb, 0, 168, 255));
}

.dataset-empty {
  text-align: center;
  color: var(--color-text-secondary, #888);
  padding: 24px 0 16px;
  font-size: 0.85rem;
}

/* Editor view */
.ds-field {
  margin-bottom: 12px;
}

.ds-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #888);
  margin-bottom: 6px;
}

.ds-name-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.05);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
  border-radius: 6px;
  color: var(--color-text-primary, #e0e0e0);
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.ds-name-input:focus {
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.4);
  box-shadow: 0 0 8px rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
}

.ds-config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ds-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.2);
  border-radius: 6px;
  color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.9);
  cursor: pointer;
  font-size: 0.8rem;
}

.ds-upload-btn:hover {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.35);
}

.ds-publish-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-secondary, #ccc);
  cursor: pointer;
}

.ds-publish-toggle input[type="checkbox"] {
  accent-color: rgb(var(--color-primary-rgb, 0, 168, 255));
}

.ds-table-wrapper {
  overflow-x: auto;
  margin-bottom: 8px;
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.1);
  border-radius: 8px;
}

.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ds-th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.7);
  border-bottom: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
  white-space: nowrap;
  position: relative;
}

.ds-td {
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ds-col-header,
.ds-cell {
  display: block;
  min-width: 40px;
  padding: 4px 2px;
  outline: none;
  color: var(--color-text-primary, #e0e0e0);
  font-size: 0.82rem;
  border-radius: 3px;
}

.ds-col-header:focus,
.ds-cell:focus {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.08);
}

.ds-remove-col,
.ds-remove-row {
  background: none;
  border: none;
  color: var(--color-text-secondary, #666);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 3px;
}

.ds-remove-col:hover,
.ds-remove-row:hover {
  color: #ef5350;
  background: rgba(239, 83, 80, 0.1);
}

.ds-remove-col {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.ds-action-cell {
  width: 30px;
  text-align: center;
}

.ds-table-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ds-add-row-btn,
.ds-add-col-btn {
  padding: 6px 12px;
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.05);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.12);
  border-radius: 6px;
  color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.7);
  cursor: pointer;
  font-size: 0.8rem;
}

.ds-add-row-btn:hover,
.ds-add-col-btn:hover {
  background: rgba(var(--color-primary-rgb, 0, 168, 255), 0.1);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.25);
  color: rgb(var(--color-primary-rgb, 0, 168, 255));
}

.ds-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.15);
}

.ds-cancel-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 0, 168, 255), 0.1) 0%, rgba(var(--color-primary-rgb, 0, 168, 255), 0.06) 100%);
  border: 1px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.2);
  border-radius: 6px;
  color: var(--color-text-primary, #fff);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.ds-cancel-btn:hover {
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 0, 168, 255), 0.18) 0%, rgba(var(--color-primary-rgb, 0, 168, 255), 0.12) 100%);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.35);
}

.ds-save-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 0, 168, 255), 0.2) 0%, rgba(var(--color-primary-rgb, 0, 168, 255), 0.15) 100%);
  border: 2px solid rgba(var(--color-primary-rgb, 0, 168, 255), 0.6);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(var(--color-primary-rgb, 0, 168, 255), 0.2);
}

.ds-save-btn:hover {
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 0, 168, 255), 0.3) 0%, rgba(var(--color-primary-rgb, 0, 168, 255), 0.25) 100%);
  border-color: rgba(var(--color-primary-rgb, 0, 168, 255), 0.8);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb, 0, 168, 255), 0.35);
}
