/* Page layout styles */

:root {

  /* ============================================================
     Z-INDEX LADDER - single source of truth for stacking order.
     Adjust a whole UI layer here instead of scattering magic numbers.
     Order (low -> high): timeline content < focus badge < header < pop-over cards < lightbox
     ============================================================ */
  --z-item-hover:    12;    /* bars/milestones lifted on hover */
  --z-focus-badge:   600;   /* persistent 'year in focus' badge - above timeline, BELOW pop-over cards */
  --z-sticky-header: 1000;  /* pinned settings/header bar */
  --z-popover:       4000;  /* tooltip / info cards (hover AND locked) - above header + badge */
  --z-lightbox:      9000;  /* full-screen image viewer - top of everything */

  --primary-color: #1a1a2e;
  --secondary-color: #435fdd;
  --third-color: #503470;
  --accent-color: #194881;
  --light-color: #d9e2ec;
  --light-color-tint-med: #c9e8dd;
  --light-color-tint-sm: #eff0d6;
  --lightmed-color: #bed0e6;
  --dark-color: #16213e; 

  /* Dark mode color scheme */
  --background-color: #1a202c;
  --text-color: #f7fafc;
  --text-secondary-color: #cbd5e0;
  --border-color: #4a5568;
  --container-bg-color: transparent;
  --grid-line-color: #536e9c;
  --tooltip-bg-color: #2d3748;
  --tooltip-shadow-color: rgba(0, 0, 0, 0.5);
  --milestone-inner-border-color: #1a202c; /* Match background for 'cutout' effect */



/* BASE THEME VARIABLES */


  /* Layout variables (Set by JS from TIMELINE_CONFIG) */
  --timeline-item-height: 17px; /* Default from your index.html config */
  --timeline-row-spacing: 37px; /* Default from your index.html config */
  --timeline-group-spacing: 24px;/* Default from your index.html config */
  --timeline-tooltip-max-width: 650px; /* Default from your index.html config */
  --timeline-base-offset: 99px; /* Top padding before first row */
  --timeline-bottom-padding: 10px; /* Bottom padding after last row / for labels */
 
  --timeline-top-padding: 33px; /* Top padding before first row */

  /* Milestone style variables */
  --milestone-size: 7px; /* Diameter of the central colored dot */
  --milestone-border-width: 5px; /* Width of the colored outline ring */
  --milestone-inner-border-width: 8px; /* Width of the background 'cutout' ring inside the color */
  --milestone-label-offset: -7px; /* How far above the center the label sits (from your index.html config) */

  /* Tooltip style variables */
  --timeline-tooltip-padding: 12px;
  --tooltip-animation-speed: 0.2s;
  --timeline-tooltip-min-width: 250px; /* Default from your index.html config */


  /* ===== CATEGORY COLORS (REQUIRED FOR TIMELINE ITEMS) ===== */


  --category-one-color: #b61a1a; /* hue */
  --category-two-color: #bb4724; /* hue */
  --category-three-color: #dd9324; /* hue */
  --category-four-color: #d4b422; /* hue */
  --category-five-color: #6ba81a; /* hue */
  --category-six-color: #1e7a16;  /* hue */
  --category-seven-color: #1b5e44;  /* hue */
  --category-eight-color: #0f9477;  /* hue */
  --category-nine-color: #4396af; /* hue */
  --category-ten-color: #185e97;  /* hue */
  --category-eleven-color: #1b2283; /* hue */
  --category-twelve-color: #3f168b; /* hue */
  --category-thirteen-color: #783a9c; /* hue */
  --category-fourteen-color: #4f0c6e;  /* hue */
  --category-fifteen-color: #750d64;  /* hue */
  --category-sixteen-color: #d14ecb;  /* hue */
  --category-seventeen-color: #e914a2;  /* hue */
  --category-eighteen-color: #961665;  /* hue */
  --category-nineteen-color: #8a1932;  /* hue */
  --category-twenty-color: #e2648a;   /* hue */
  }


/* ============================================================
   LIGHT MODE THEME OVERRIDE
   Apply class="theme-light" to <html> to activate.
   Overrides only the dark-mode color variables; all layout,
   spacing, and category-color variables are inherited from :root.
   html.theme-light has higher specificity than :root, so it wins.
   ============================================================ */
html.theme-light {
  --background-color:       #c2ccd9;   /* main page / header background */
  --text-color:             #1a202c;   /* primary text */
  --text-secondary-color:   #4a5568;   /* labels, subtitles, secondary text */
  --border-color:           #a7b8cd;   /* panel and control borders */
  --grid-line-color:        #9db3ca;   /* timeline vertical grid lines */
  --tooltip-bg-color:       #ffffff;   /* tooltip background */
  --tooltip-shadow-color:   rgba(0, 0, 0, 0.12);
  --milestone-inner-border-color: #c2ccd9;  /* matches bg for the cutout ring effect */
  --container-bg-color:     transparent;
  /* Override the per-page inline --bg-color so body background also switches */
  --bg-color:               #c2ccd9;
}

/* Light mode: page-level background */
html.theme-light body {
  background-color: var(--bg-color, #c2ccd9);
}

/* Light mode: sticky header */
html.theme-light #sticky-controls-wrapper {
  background-color: #d2dbe6;
  border-bottom-color: #a7b8cd;
}

/* Light mode: keep the TimeSync logo text white -- same as dark mode.
   Without this, var(--text-color) resolves to the dark value and turns the logo text dark. */
html.theme-light .sticky-header-title .title-text {
  color: #fff !important;
}

/* Light mode: settings panel + toggle -- lighter, more red-violet hue */
html.theme-light #settings-panel {
  background: rgba(160, 220, 170, 0.45) !important;  /* very light pastel green */
  border-top: 2px solid #a8d8b0 !important;
}

html.theme-light .master-collapse-toggle {
  background: #a0d4aa !important;          /* very light pastel green */
  border-color: #a8d8b0 !important;
  color: #111 !important;                  /* black triangle for contrast on light bg */
}
html.theme-light .master-collapse-toggle:hover {
  background: #b8e8c4 !important;
  border-color: #c8e8cc !important;
}

/* Light mode: scrollbar track to match light bg */
html.theme-light .timeline-scroll {
  scrollbar-color: #94a3b8 #dde6f0;
}
html.theme-light .timeline-scroll::-webkit-scrollbar-track {
  background: #dde6f0;
}
html.theme-light .timeline-scroll::-webkit-scrollbar-thumb {
  border-color: #dde6f0;
}

/* Light mode: HOT BLOCKS home button -- darken slightly for light bg */
html.theme-light .ts-home-btn {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
  color: #1a202c;
}
html.theme-light .ts-home-btn:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Light mode: summary bar -- now switches to a LIGHT pill with dark-readable text.
   (Previously forced dark because the base colors are dark-mode hardcoded #bbb/#fff.) */
html.theme-light .controls-summary-bar {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #4a5568 !important;
}
html.theme-light .controls-summary-bar .summary-item strong {
  color: #1a202c !important;
}
html.theme-light .controls-summary-bar .summary-divider {
  color: rgba(0, 0, 0, 0.25) !important;
}
html.theme-light .keyword-jumplink {
  background: rgba(14, 116, 144, 0.12) !important;
  color: #0e7490 !important;
}
html.theme-light .keyword-jumplink:hover {
  background: rgba(14, 116, 144, 0.22) !important;
  color: #0c5060 !important;
}

/* Light mode: lay a translucent white veil over EVERY bar so all fills lighten, then
   uniform dark text + a soft light halo. Milestones (.timeline-milestone) are untouched,
   so the diamonds keep full category color for identity. Veil strength = the 0.45 alphas. */
html.theme-light .timeline-item {
  background-image: linear-gradient(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.36));
  color: #1a1a1a !important;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7) !important;
}

/* Light mode: a GENTLE veil on MILESTONES too -- same idea as the bars but much lighter
   (bars = 0.36 alpha, milestones = 0.28) so they lift just a little while keeping identity. */
html.theme-light .milestone-wrapper .timeline-milestone {
  background-image: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28));
}

/* Light mode: keyword lozenge (event-tag) -- swap white highlights to violet
   so they're visible against the light timeline background. */
html.theme-light .event-tag:hover {
  outline-color: #9333ea !important;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.4) !important;
}
html.theme-light .event-tag.active {
  background: #9333ea !important;
  color: #fff !important;
}

/* Light mode: bar tag-highlight -- violet outline instead of white */
html.theme-light .timeline-item.tag-highlight {
  outline: 2px solid rgba(147, 51, 234, 0.85) !important;
}

/* Light mode: milestone tag-highlight -- violet ring instead of white */
html.theme-light .timeline-milestone.tag-highlight {
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.85) !important;
}

/* Dark text on the LIGHT-fill category bars (amber #dd9324 / gold #d4b422 / pink #e2648a)
   in DARK mode -- white text washes out on these light fills. In LIGHT mode the all-bars
   veil rule above already gives every bar dark text, so this only matters for dark mode. */
/* COMMENTED OUT 2026-06-24 (per request -- show these bars with normal/white text in dark mode).
   Re-enable by removing this wrapper.
.timeline-item.color-category-three,
.timeline-item.color-category-four,
.timeline-item.color-category-twenty {
  color: #1a1a1a;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.85);
}
*/


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



 

/* Global styles */

html,
body {
  width: 100%;
  max-width: 100%;   /* 1200px */
  overflow-x: hidden;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  margin: 0 auto;
  scroll-behavior: smooth;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* Page structure */

main {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto; /* Allow horizontal scrolling for the timeline */
}
 

.header, footer {
  background-color: var(--lightmed-color);
  text-align: center;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 1200px;  
  margin: 1rem auto;
  padding: 1rem;
}

header {
  color: white;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

/* ================================
   FIXED CONTROLS WRAPPER - Always at top of browser
   ================================ */
#sticky-controls-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--background-color, #1a1a2e);
    border-bottom: 1px solid var(--border-color, #333);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ================================
   LOCAL / ONLINE ENV BADGE (2026-08-18)
   Quiet corner indicator of whether the page is running from local dev
   (VS Code Live Server, 127.0.0.1/localhost) or the deployed site. Created
   and shown/hidden by window.syncEnvBadge() in timelineAppMaster.js, gated
   by TIMELINE_DISPLAY_CONFIG.showEnvBadge ("yes"/"no") in each page's config.
   Sits above the fixed header (higher z-index) in the true top-right corner.
   ================================ */
#env-badge {
    position: fixed;
    top: 6px;
    right: 8px;
    z-index: 2000;
    font-family: sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 3px;
    opacity: 0.6;
    pointer-events: none; /* quiet -- never intercepts clicks on controls beneath/near it */
    user-select: none;
}
#env-badge.env-badge-local {
    background: #ffb020;
    color: #3a2600;
}
#env-badge.env-badge-online {
    background: #3cae5a;
    color: #ffffff;
}

/* Title bar integrated into sticky header */
.sticky-header-title {
    padding: 4px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.sticky-header-title .title-text {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color, #fff);
}

.sticky-header-title .subtitle-text {
    flex: none;        /* no longer a spacer — sits snug after TimeSync title */
    min-width: 0;
    display: none;     /* hidden when settings panel is open */
    /* "Note" tooltip chip */
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: fit-content;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(160, 180, 210, 0.55);
    border: 1px solid rgba(160, 180, 210, 0.2);
    border-radius: 3px;
    padding: 0 6px;
    height: 18px;
    cursor: default;
    user-select: none;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.sticky-header-title .subtitle-text:hover {
    color: rgba(200, 215, 240, 0.9);
    border-color: rgba(160, 180, 210, 0.5);
}

#sticky-controls-wrapper .settings-panel {
    margin: 0;
    padding: 3px 12px;
}

#sticky-controls-wrapper .settings-flex {
    margin-bottom: 2px;
}

#sticky-controls-wrapper .control-block {
    margin-bottom: 1px;
}

#sticky-controls-wrapper .control-titlebar {
    padding: 1px 0;
}

/* Milestone titles checkbox on same line as detail level */
.milestone-titles-label {
    margin-left: 15px;
    white-space: nowrap;
}

/* Push content down to account for fixed header */
main {
    padding-top: 10px;
}

/* Feature Focus section in sticky header */
.feature-focus-block .control-titlebar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Focus year display - CENTERED */
.feature-focus-block .control-titlebar #focused-year-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.78rem;
    color: var(--text-secondary-color, #aaa);
    padding: 0 8px;
    white-space: nowrap;
}

.feature-focus-block .control-titlebar #focused-year-display #current-focused-year {
    color: rgb(230, 233, 88);
    font-weight: bold;
}

.feature-focus-block .control-titlebar #focused-year-display #current-focused-year.has-year {
    color: rgb(230, 233, 88);
    font-size: 1.1em;
    font-weight: bold;
}

/* Filter Toggles in sticky header */
/* Filter block: titlebar + buttons on ONE row */
.filter-toggles-block {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2px 6px;
}
.filter-toggles-block .control-titlebar {
    flex-shrink: 0;
    margin-bottom: 0;
    align-self: flex-start;  /* stays top-left, doesn't stretch */
    padding-top: 1px;
}
.filter-toggles-block .filter-toggles-content {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: none;
    border: none;
    margin-top: 0;
}
.filter-toggles-block #timeline-filter-panel {
    margin: 0;
    padding: 0;
}
/* Filter info line ("Filtering by:") — compact */
#timeline-filter-panel > div:not(.timeline-filter-container) {
    font-size: 0.62rem !important;
    margin-top: 1px !important;
    padding: 0 2px !important;
    text-align: left !important;
    opacity: 0.6;
    background: none !important;
    border-radius: 0 !important;
}

/* Zoom Level block styling */
.zoom-block .control-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-block .zoom-level-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.1rem 0.25rem;
    background-color: transparent;
    border-radius: 4px;
    border: none;
    margin-top: 1px;
}

.zoom-block .zoom-level-content .settings-label {
    font-size: 0.75rem;
    color: var(--text-secondary-color);
}

.zoom-block .zoom-level-content input[type="range"] {
    width: 200px;
}

.zoom-block .zoom-level-content select {
    padding: 2px 5px;
    font-size: 0.85rem;
}

/* Hide zoom content when collapsed */
body.hide-zoom-level .zoom-level-content {
    display: none !important;
}

/* Hide filter toggles content when collapsed */
body.hide-filter-toggles .filter-toggles-content {
    display: none !important;
}

/* =========================================
   DATA SOURCES CONTROL BLOCK
   ========================================= */

.data-sources-block .data-sources-content {
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.08);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.07);
    margin-top: 2px;
}

.data-sources-block .data-sources-summary {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-secondary-color, #888);
    font-style: italic;
}

/* Load All / Clear All buttons */
.data-sources-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.data-sources-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
    background-color: #1a5fa8;
    color: #fff;
    border: 1px solid #2a7fd8;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.data-sources-btn:hover {
    background-color: #2a7fd8;
    color: #fff;
}

/* Data source list */
.data-sources-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.data-source-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.data-source-row:hover {
    background-color: rgba(255,255,255,0.05);
}

/* Toggle switch styling */
.data-source-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.data-source-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #888;
    transition: 0.3s;
    border-radius: 50%;
}

.data-source-toggle input:checked + .toggle-slider {
    background-color: #2d5a27;
}

.data-source-toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #5cb85c;
}

.data-source-toggle input:focus + .toggle-slider {
    box-shadow: 0 0 3px rgba(92, 184, 92, 0.5);
}

/* Labels and info */
.data-source-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-color, #ddd);
    min-width: 90px;
}

.data-source-file {
    font-size: 0.75rem;
    color: var(--text-secondary-color, #777);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-source-count {
    font-size: 0.8rem;
    color: var(--text-secondary-color, #888);
    min-width: 70px;
    text-align: right;
}

/* Band Labels (left-side timeline labels) */
.band-label {
    position: absolute;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.8;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
    /* Dark mode default: light halo so text reads against dark background */
    text-shadow: 1px 1px 3px rgba(255,255,255,0.25), 0 0 6px rgba(255,255,255,0.15);
}
html.theme-light .band-label {
    /* Light mode: dark shadow so text reads against light background */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* not using */
/*  .band-label-category {  */
    /* Category labels: use base styles from .band-label */
/* } */

.band-label-group {
    /* Group labels: smaller, lighter, lowercase */
    font-size: 0.95rem;
    font-weight: 300;
    text-transform: lowercase;
}

/* Hide data sources content when collapsed */
body.hide-data-sources .data-sources-content {
    display: none !important;
}

footer {
  text-align: center;
  font-size: 0.875rem;
  color: #a0aec0;
  background-color: transparent; 
  box-shadow: none;
  font-size: 0.75rem;
  opacity: 0.6;
  margin: 4px auto;   /* trim the wasted vertical space around the one-line footer (was 1rem auto) */
  padding: 0;
}
footer p {
  margin: 0;   /* remove the browser-default <p> top/bottom margin */
}

h1 {
  font-size: 1.6rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

p.subtitle {
  text-align: center;
  color: #cbd5e0;
  margin-bottom: .5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}


/* FURTHER STYLES */

h1 {
  font-size: 2.5rem;
  margin-bottom: .2rem;
}

h2 {
  font-size: 2rem;
  margin: 0.1rem 0 1rem;
  color: var(--accent-color);
  border-bottom: 3px solid var(--third-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  margin: 1.3rem 0 1rem;
  color: var(--accent-color);
}

h4 {
  font-size: 1.1rem;
  margin: .1rem 0 1rem;
  color: var(--accent-color);
}





section[id^="decade-"] {  /* bounding box for each decade section */
  background-color: rgb(179, 198, 226);
  padding: .4rem 1.2rem 0.5rem 1.4rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* to make all <button> elements globally non-selectable */
button {
  user-select: none;
  -webkit-user-select: none; /* For Safari */
  -ms-user-select: none;     /* For older IE */
}



 /* ======= syling unique elements ======== */



 img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: .8rem 0 0 0;
  transition: transform 0.3s ease;
}

 img:hover {
  transform: scale(1.02);
}  

/* .citation {
  font-style: italic;
  color: #f83a1d;
  font-size: 0.9rem;
} */


.imagePop {
  cursor: pointer;
}

/* .image-group {   DONT THINK THIS IS USED 
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  background-color: rgb(184, 227, 53);  
} */
 

.image-container {
  background-color: rgb(193, 191, 237); 
  display: flex;
  justify-content: center;
  gap: 33px; 
  padding: 2rem 4rem; 
  margin: .4rem 0;
}

.image-container img {
  max-height: 400px;
  background-color: rgb(54, 17, 102);
  object-fit: contain;
  gap: 33px; 
  padding: .4rem .4rem;

}


/* ===========  syling  ============== */

/* =========== further syling  ============== */
 



/* =========== further syling  ============== */
/* Group containers: row layout with wrapping */
 
/* THUMNAILS ARE DIFFERENT APPROACH */




/* ================ LIGHTBOX STYLES =============================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: var(--z-lightbox);             /* ladder: top of everything (was 1200) */
  isolation: isolate; /* â† IMPORTANT: creates local stacking context */
  left: 0;
  top: var(--lightbox-top-offset, 0px);
  width: 100%;
  height: calc(100% - var(--lightbox-top-offset, 0px));
  background-color: rgba(0,0,0,0.9);

  /* NEW: creates â€œbreathing roomâ€ for content */
  /* NEW: visible â€œspace from screen edgeâ€ */
  --lb-pad: 22px;
  padding: var(--lb-pad);
  box-sizing: border-box;

  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* NEW: inset â€œwindowâ€ frame so you can SEE the space */
.lightbox::before {
  content: "";
  position: absolute;
  inset: var(--lb-pad);  
  border: 2px solid #515357;
  background-color: rgba(141, 211, 236, 0.2);  /* subtle frame color */
  border-radius: 15px;
  pointer-events: none;
  z-index: 0;           /* â† behind */
}


.lightbox-content {
  /* NEW: leave room for big arrow hit-zones on both sides */
  max-width: min(78vw, 860px);
  max-height: calc(100vh - var(--lightbox-top-offset, 0px) - (var(--lb-pad) * 2) - 160px);
  padding-inline: clamp(16px, 3vw, 28px);

  position: relative;
  z-index: 1;  /* â† above the ::before layer */

  opacity: 0;
  transition: opacity 0.4s ease;

}


.lightbox-content.visible {
  opacity: 1;
}


  /* a little more LightBox styling */
.lightbox-caption {
  color: rgb(165, 171, 175);
  margin-top: 10px;
  font-size: 1rem;
  text-align: center;
  max-width: 90%;
}
 
#lightbox-img {
    opacity: 0;
    transition: opacity 0.4s ease-in;
    max-width: 100%;
    max-height: calc(100vh - var(--lightbox-top-offset, 0px) - 220px); /* leaves room for header + above + caption */
    display: block;
    
    margin: .5rem auto .2rem auto; 

    min-height: 300px;     /* minimum display size - no postage-stamp images */
    min-width: 300px;      /* applies to portrait and landscape equally */
    object-fit: contain;   /* maintains true aspect ratio - no stretching */
    z-index: 10;
}

.lightbox img:hover {
  transform: none !important;
  box-shadow: none !important;
  cursor: default;
}


#lightbox-img.visible { opacity: 1; }
.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    display: block;
    margin: 2rem auto;
}

.lightbox-decade {
  color: rgb(247, 246, 245);
  font-weight: bold;
} 


/* ===============================
   Lightbox Above (Year / Title)
   top = frame padding + offset */
#lightbox-above {
  position: absolute;
  top: calc(var(--lb-pad) + 18px);
  font-weight: bold;
  font-size: 1.4rem;
  left: 50%; 
  text-align: center;
  transform: translateX(-50%); 
 
  text-shadow:
  -2px -2px 2px rgba(0,0,0,0.6), /* top-left */
   2px -2px 2px rgba(0,0,0,0.6), /* top-right */
  -2px  2px 2px rgba(0,0,0,0.6), /* bottom-left */
   3px  3px 2px rgba(0,0,0,0.6); /* bottom-right */

  z-index: 40;   /* ensures it stays above image */
  pointer-events: none;
}




.close {
  position: absolute;
  top: calc(var(--lb-pad) + 10px);
  right: calc(var(--lb-pad) + 10px);
  font-size: 28px;
  color: rgba(205, 182, 238, 0.5); /*color gets over-riddeen inhtml/js */
  cursor: pointer;
  z-index: 50;

  /* keep the hit-zone big, but donâ€™t â€œfloatâ€ it upward */
  padding: 12px 16px;
  transform: none;

  text-shadow:
  -2px -2px 2px rgba(0,0,0,0.6), /* top-left */
   2px -2px 2px rgba(0,0,0,0.6), /* top-right */
  -2px  2px 2px rgba(0,0,0,0.6), /* bottom-left */
   3px  3px 2px rgba(0,0,0,0.6); /* bottom-right */

  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}



/* .close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  color:  rgba(205, 182, 238, 0.5);
  cursor: pointer;
  /*  padding: 20px 30px; /* increase padding = bigger clickable area */
  /* transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.05); /* optional: subtle hit area */
  /* order-radius: 8px; optional: rounded touch zone */
  /* } */  

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  font-size: 60px;
  color: rgba(205, 182, 238, 0.3);
  user-select: none;
  padding: 40px 55px; /* increase padding = bigger clickable area */
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.05); /* optional: subtle hit area */
  border-radius: 8px; /* optional: rounded touch zone */
  z-index: 50;

  text-shadow:
  -2px -2px 2px rgba(0,0,0,0.6), /* top-left */
   2px -2px 2px rgba(0,0,0,0.6), /* top-right */
  -2px  2px 2px rgba(0,0,0,0.6), /* bottom-left */
   3px  3px 2px rgba(0,0,0,0.6); /* bottom-right */

}


.prev { left: calc(var(--lb-pad) + 6px); }
.next { right: calc(var(--lb-pad) + 6px); }

.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;

  /* â†“ THIS is what makes them skinnier */
  width: 72px;
  padding: 14px 0;

   /*  | frame |  â†arrowâ†’ |   IMAGE   | â†arrowâ†’  | frame |     */
   /*              72px                  72px                  */

  font-size: 66px;
  text-align: center;
  user-select: none;
}



.prev:hover, .next:hover, .close:hover  {
  color: #896dd7;
  background-color: rgba(255, 255, 255, 0.1);
}


 @keyframes flashText {
  0% { color: rgb(172, 63, 230); transform: scale(1); }
  25% { color: #d03ca4; transform: scale(1.3); }
  50% { color: rgb(81, 27, 90); transform: scale(1); }
  75% { color: #1b33e9; transform: scale(1.2); }
  100% { color: rgb(100, 123, 224); transform: scale(1); }
}

/* === Lightbox Info Panel === */
.lightbox-info-btn {
  display: none; /* hidden by default, shown when data exists */
  cursor: pointer;
  margin-left: 12px;
  padding: 4px 8px;
  font-size: 1.6rem;  /* Increased from 1.1rem for larger icon */
  color: rgba(180, 180, 190, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.lightbox-info-btn:hover {
  color: #5dd9d0;
  background: rgba(93, 217, 208, 0.15);
}

.lightbox-info-btn.locked {
  color: #5dd9d0;
  background: rgba(93, 217, 208, 0.25);
  box-shadow: 0 0 8px rgba(93, 217, 208, 0.4);
}

.lightbox-info-panel {
  position: absolute;
  bottom: calc(var(--lb-pad) + 60px);
  right: calc(var(--lb-pad) + 90px);
  width: 280px;
  max-width: calc(100vw - 200px);
  max-height: 50vh;
  overflow-y: auto;
  
  background: rgba(20, 25, 30, 0.95);
  border: 1px solid rgba(93, 217, 208, 0.4);
  border-radius: 8px;
  padding: 12px 14px;
  
  font-size: 0.85rem;
  color: #c8ccd0;
  z-index: 100;
  
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-info-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.info-panel-header {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5dd9d0;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  /* Light white background tint behind the category label */
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  padding: 2px 5px 4px 5px;
  /* Same dark-corner shadow as the lightbox title above the image */
  text-shadow:
    -2px -2px 2px rgba(0,0,0,0.6),
     2px -2px 2px rgba(0,0,0,0.6),
    -2px  2px 2px rgba(0,0,0,0.6),
     3px  3px 2px rgba(0,0,0,0.6);
}

.info-panel-title {
  font-size: 1rem;
  font-weight: bold;
  color: #f0f0f0;
  margin-bottom: 8px;
  line-height: 1.3;
  text-shadow:
    -2px -2px 2px rgba(0,0,0,0.6),
     2px -2px 2px rgba(0,0,0,0.6),
    -2px  2px 2px rgba(0,0,0,0.6),
     3px  3px 2px rgba(0,0,0,0.6);
}

.info-panel-known {
  display: none;              /* shown by JS only when knownBest has a semicolon */
  font-size: 0.82rem;
  font-style: italic;
  color: #c8cdd2;
  margin-bottom: 7px;
  line-height: 1.35;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5),
     1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5),
     1px  1px 1px rgba(0,0,0,0.5);
}

.info-panel-description {
  font-size: 0.8rem;
  color: #a0a5aa;
  margin-bottom: 10px;
  line-height: 1.45;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5),
     1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5),
     1px  1px 1px rgba(0,0,0,0.5);
}

.info-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.info-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  background: rgba(93, 217, 208, 0.15);
  color: #7de0d8;
  border-radius: 3px;
  border: 1px solid rgba(93, 217, 208, 0.25);
}

.info-panel-section {
  font-size: 0.75rem;
  font-weight: 600;
  color: #90959a;
  margin-bottom: 6px;
}

.info-panel-meta {
  font-size: 0.7rem;
  color: #707580;
  line-height: 1.4;
}

.info-panel-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 6px;
}

.info-panel-goto {
  cursor: pointer;
  font-size: 2.2rem;  /* Increased from 1.8rem for larger icon */
  font-weight: bold;
  letter-spacing: 2px;
  line-height: 1;
  padding: 6px 12px;
  color: rgba(180, 180, 190, 0.5);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.info-panel-goto:hover {
  color: #5dd9d0;
  background: rgba(93, 217, 208, 0.2);
  transform: scale(1.1);
}

/* Mobile adjustments for info panel */
@media (max-width: 600px) {
  .lightbox-info-panel {
    right: var(--lb-pad);
    left: var(--lb-pad);
    width: auto;
    max-width: none;
    bottom: calc(var(--lb-pad) + 80px);
  }
  
  .lightbox-info-btn {
    font-size: 1rem;
    padding: 6px 10px;
  }
}

/* ── LIGHTBOX: light-mode overrides ─────────────────────────────────────── */
html.theme-light .lightbox {
    background-color: rgba(220, 228, 238, 0.93); /* pale blue-gray dim instead of near-black */
}
html.theme-light .lightbox::before {
    border-color: #8aa0bc;
    background-color: rgba(255, 255, 255, 0.45); /* bright inner frame */
}
/* Title / year text above image */
html.theme-light #lightbox-above {
    color: #1a2a4a;
    text-shadow:
        1px 1px 3px rgba(255,255,255,0.8),
       -1px -1px 2px rgba(255,255,255,0.6);
}
/* Caption below image */
html.theme-light .lightbox-caption {
    color: #2d3e55;
}
html.theme-light .lightbox-decade {
    color: #1a2a4a;
}
/* Close button */
html.theme-light .close {
    color: rgba(40, 60, 100, 0.7);
    background-color: rgba(255,255,255,0.3);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}
html.theme-light .close:hover {
    color: #1a2a4a;
    background-color: rgba(255,255,255,0.55);
}
/* Prev / next arrows */
html.theme-light .prev,
html.theme-light .next {
    color: rgba(40, 60, 130, 0.45);
    background-color: rgba(255,255,255,0.2);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
}
html.theme-light .prev:hover,
html.theme-light .next:hover {
    color: #1a3a8a;
    background-color: rgba(255,255,255,0.45);
}

/* ── LIGHTBOX INFO PANEL: light-mode overrides ──────────────────────────── */
html.theme-light .lightbox-info-panel {
    background: rgba(240, 245, 252, 0.97);
    border-color: rgba(60, 120, 200, 0.35);
    color: #2d3e55;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
html.theme-light .info-panel-header {
    color: #1a6090;
    border-bottom-color: rgba(26, 96, 144, 0.4);
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
html.theme-light .info-panel-title {
    color: #0f1f3a;
    text-shadow: 0 1px 2px rgba(255,255,255,0.7);
}
html.theme-light .info-panel-known {
    color: #2a3e5a;
    text-shadow: 0 1px 1px rgba(255,255,255,0.6);
}
html.theme-light .info-panel-description {
    color: #3a4e6a;
    text-shadow: 0 1px 1px rgba(255,255,255,0.6);
}
html.theme-light .info-tag {
    background: rgba(26, 96, 144, 0.1);
    color: #1a5580;
    border-color: rgba(26, 96, 144, 0.25);
}
html.theme-light .info-panel-section {
    color: #4a6080;
    text-shadow: 0 1px 1px rgba(255,255,255,0.6);
}
html.theme-light .info-panel-meta {
    color: #5a6e88;
}
html.theme-light .info-panel-goto {
    color: rgba(26, 80, 140, 0.55);
    background: rgba(26, 96, 144, 0.07);
}
html.theme-light .info-panel-goto:hover {
    color: #1a4a9a;
    background: rgba(26, 96, 144, 0.15);
}
html.theme-light .lightbox-info-btn {
    color: rgba(26, 80, 160, 0.65);
    background: rgba(26, 96, 144, 0.08);
}
html.theme-light .lightbox-info-btn:hover {
    color: #1a4a9a;
    background: rgba(26, 96, 144, 0.18);
}
html.theme-light .lightbox-info-btn.locked {
    color: #1a4a9a;
    background: rgba(26, 96, 144, 0.2);
    box-shadow: 0 0 8px rgba(26, 96, 144, 0.3);
}

/* ── LIGHTBOX CAPTION: light-mode text shadow ────────────────────────────── */
html.theme-light .lightbox-caption {
    text-shadow: 0 1px 3px rgba(255,255,255,0.9), 0 -1px 2px rgba(255,255,255,0.6);
}

/* Timeline entry highlight after navigation from lightbox */
.timeline-item.highlighted,
[data-year].highlighted {
  animation: entryHighlight 2s ease-out;
}

@keyframes entryHighlight {
  0% { 
    box-shadow: 0 0 0 4px rgba(93, 217, 208, 0.8);
    transform: scale(1.02);
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(93, 217, 208, 0);
    transform: scale(1);
  }
}

 /* === Back To Top Button === */

/* ~~  ~~  ~~  ~~  ~~ Moved from html ~~  ~~  ~~  ~~  ~~   ~~ */



/* Year Range Filter styling */
.year-range-filter { 
    display:flex;
    align-items:center;
    justify-content:center;
    gap:0.5rem;
    flex-wrap:wrap;
    background-color:transparent;
    padding:0.15rem 0.25rem;
    border-radius:4px;
    margin-bottom:0.1rem;
    border:none;
}
.year-range-input-group{
    display:flex;
    align-items:center;
    gap:0.5rem;
}
.year-range-input{
    width:68px;
    padding:0.2rem 0.4rem;
    border:1px solid var(--border-color);
    border-radius:4px;
    background-color:var(--background-color);
    color:var(--text-color);
    font-size:0.78rem;
    text-align:center;
}
.year-range-input:focus{
    outline:none;
    border-color:var(--accent-color);
    box-shadow:0 0 0 2px rgba(25,72,129,0.2);
}
.year-range-label{
    font-size:0.78rem;
    color:var(--text-secondary-color);
    font-weight:500;
    white-space:nowrap;
}
.year-range-apply{
    padding:0.2rem 0.7rem;
    background-color:var(--accent-color);
    color:white;
    border:none;
    border-radius:4px;
    cursor:pointer;
    font-size:0.78rem;
    font-weight:500;
    transition:background-color 0.2s ease;
}
.year-range-apply:hover{
    background-color:#2d5aa0;
}
.year-range-apply:disabled{
    background-color:#666;
    cursor:not-allowed;
    opacity:0.6;
}
.year-range-reset{
    padding:0.2rem 0.5rem;
    background-color:transparent;
    color:var(--text-secondary-color);
    border:1px solid var(--border-color);
    border-radius:4px;
    cursor:pointer;
    font-size:0.72rem;
    transition:all 0.2s ease;
}
.year-range-reset:hover{
    background-color:var(--border-color);
    color:var(--text-color);
}
.year-range-status{
    font-size:0.7rem;
    color:var(--text-secondary-color);
    font-style:italic;
    margin-left:0.25rem;
}
.year-range-data-info{
    font-size:0.7rem;
    color:#6d8ec0;
    font-style:italic;
    white-space:nowrap;
    margin-left:0.5rem;
}

/* Item Cap Controls styling */
.item-cap-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    background-color: transparent;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    margin-bottom: 0.1rem;
    border: none;
}
.item-cap-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.item-cap-label {
    font-size: 0.78rem;
    color: var(--text-secondary-color);
    font-weight: 500;
    white-space: nowrap;
}
.item-cap-input {
    width: 70px;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 0.78rem;
    text-align: center;
}
.item-cap-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(25,72,129,0.2);
}
.item-cap-apply {
    padding: 0.2rem 0.75rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.item-cap-apply:hover {
    background-color: #2d5aa0;
}
.item-cap-status {
    font-size: 0.8rem;
    color: var(--text-secondary-color);
    font-style: italic;
}

.item-cap-help {
    font-size: 0.75rem;
    color: #6d8ec0;
    font-style: italic;
    margin-left: 1rem;

    margin-top: 0.25rem;
}



/*       =========++++++++++++++++++++++++++++++++ PASTED FROM TIMELINES.CSS  ==============  */  
 

/*   TIMELINE CSS - SIMPLIFIED DARK MODE VERSION  */

 
/* ===== TAG STYLING FOR KEYWORD/TAG  in field: PARENTID ===== */
.event-tag {
    display: inline-block;
    background: rgba(26, 77, 153, 0.45); /* darker gold */
    padding: 2px 7px;                     /* tighter horizontal + vertical */
    border-radius: 12px;                  /* slightly smaller capsule */
    font-size: 0.75em;                    /* a bit smaller */
    margin-right: 4px;
    margin-top: 4px;
    white-space: nowrap;
    letter-spacing: 0.2px;                /* subtle refinement */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* subtle shadow */
}

/* Settings & Controls */
.settings-panel { margin-bottom: 1rem; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 0.5rem; }

.settings-label { margin-right: 0.5rem; white-space: nowrap; font-size: 0.9em; }
.settings-item input[type="range"] { flex-grow: 1; margin-right: 0.5rem; }

/* Filter Buttons */
.timeline-filter-container { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; margin-bottom: 1rem; padding: 0.3rem; background-color: rgba(0,0,0,0.2); border-radius: 4px; }
.filter-button { padding: 0.1rem 0.45rem; border-radius: 0.3rem; cursor: pointer; font-weight: 600; transition: all 0.2s ease-in-out; border: none; margin: 1px 2px; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); font-size: 0.7rem; white-space: nowrap; }
.filter-button:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); filter: brightness(1.1); }
.filter-button.active { font-weight: bold; box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); filter: brightness(1); color: #ffffff !important; /* Background color set by JS */ }
.filter-button.inactive { background-color: #3a475a; border-left: 5px solid transparent; opacity: 0.85; font-weight: normal; /* Text color set by JS */ }
.filter-button.all-categories.inactive { color: var(--text-secondary-color); border-left-color: var(--text-secondary-color); }


.filter-button.color-category-one.inactive { border-left-color: var(--category-one-color); }
.filter-button.color-category-two.inactive { border-left-color: var(--category-two-color); }
.filter-button.color-category-three.inactive { border-left-color: var(--category-three-color); }
.filter-button.color-category-four.inactive { border-left-color: var(--category-four-color); }
.filter-button.color-category-five.inactive { border-left-color: var(--category-five-color); }
.filter-button.color-category-six.inactive { border-left-color: var(--category-six-color); }
.filter-button.color-category-seven.inactive { border-left-color: var(--category-seven-color); }
.filter-button.color-category-eight.inactive { border-left-color: var(--category-eight-color); }
.filter-button.color-category-nine.inactive { border-left-color: var(--category-nine-color); }
.filter-button.color-category-ten.inactive { border-left-color: var(--category-ten-color); }

.filter-button.color-category-eleven.inactive { border-left-color: var(--category-eleven-color); }
.filter-button.color-category-twelve.inactive   { border-left-color: var(--category-twelve-color); }
.filter-button.color-category-thirteen.inactive { border-left-color: var(--category-thirteen-color); }
.filter-button.color-category-fourteen.inactive { border-left-color: var(--category-fourteen-color); }
.filter-button.color-category-fifteen.inactive  { border-left-color: var(--category-fifteen-color); }
.filter-button.color-category-sixteen.inactive  { border-left-color: var(--category-sixteen-color); }
.filter-button.color-category-seventeen.inactive { border-left-color: var(--category-seventeen-color); }
.filter-button.color-category-eighteen.inactive { border-left-color: var(--category-eighteen-color); }
.filter-button.color-category-nineteen.inactive { border-left-color: var(--category-nineteen-color); }
.filter-button.color-category-twenty.inactive   { border-left-color: var(--category-twenty-color); }




/* Tooltip Header Color Stripes (for both Category and Group modes) */
.timeline-tooltip-group.color-category-one   { border-left-color: var(--category-one-color); }
.timeline-tooltip-group.color-category-two   { border-left-color: var(--category-two-color); }
.timeline-tooltip-group.color-category-three { border-left-color: var(--category-three-color); }
.timeline-tooltip-group.color-category-four  { border-left-color: var(--category-four-color); }
.timeline-tooltip-group.color-category-five  { border-left-color: var(--category-five-color); }
.timeline-tooltip-group.color-category-six   { border-left-color: var(--category-six-color); }
.timeline-tooltip-group.color-category-seven { border-left-color: var(--category-seven-color); }
.timeline-tooltip-group.color-category-eight { border-left-color: var(--category-eight-color); }
.timeline-tooltip-group.color-category-nine  { border-left-color: var(--category-nine-color); }
.timeline-tooltip-group.color-category-ten   { border-left-color: var(--category-ten-color); }


.timeline-tooltip-group.color-category-eleven   { border-left-color: var(--category-eleven-color); }
.timeline-tooltip-group.color-category-twelve   { border-left-color: var(--category-twelve-color); }
.timeline-tooltip-group.color-category-thirteen { border-left-color: var(--category-thirteen-color); }
.timeline-tooltip-group.color-category-fourteen { border-left-color: var(--category-fourteen-color); }
.timeline-tooltip-group.color-category-fifteen  { border-left-color: var(--category-fifteen-color); }
.timeline-tooltip-group.color-category-sixteen  { border-left-color: var(--category-sixteen-color); }
.timeline-tooltip-group.color-category-seventeen { border-left-color: var(--category-seventeen-color); }
.timeline-tooltip-group.color-category-eighteen { border-left-color: var(--category-eighteen-color); }
.timeline-tooltip-group.color-category-nineteen { border-left-color: var(--category-nineteen-color); }
.timeline-tooltip-group.color-category-twenty   { border-left-color: var(--category-twenty-color); }  



/* Detail Level Legend */
.detail-level-legend { display: flex; justify-content: flex-start; gap: 1rem; margin: 0.5rem 0; font-size: 0.8rem; padding-left: 5px; }
.legend-item { display: flex; align-items: center; gap: 0.25rem; transition: opacity 0.3s ease; }

/* Timeline SETTING at the top of page */

#timeline-settings-panel {
  position: relative;
  z-index: 10;
  background: var(--background-color);
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}


/* Timeline Structure */

#timeline-container { min-height: 200px; width: 100%; padding: 0; margin: 0; position: relative; }
 
.timeline-scroll { overflow-x: auto; width: 100%; margin: 0; padding: 0; padding-bottom: calc(var(--timeline-bottom-padding) + 10px); -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #6b7280 var(--background-color); }
.timeline-scroll::-webkit-scrollbar { height: 8px; } .timeline-scroll::-webkit-scrollbar-track { background: var(--background-color); } .timeline-scroll::-webkit-scrollbar-thumb { background-color: #6b7280; border-radius: 4px; border: 2px solid var(--background-color); }
.timeline-container-inner { position: relative; min-height: 100px; }
.timeline-grid-container { margin-top: var(--timeline-top-padding); position: relative;  margin-left: var(--timeline-base-offset); margin-right: var(--timeline-base-offset); /* Height/Width set by JS */ }

/* Timeline Grid Lines & Labels */
.timeline-grid-line { position: absolute; top: 0; width: 1px; background-color: var(--grid-line-color); opacity: 0.3; z-index: 0; border-left: none; }
.timeline-grid-line-decade { width: 2px; opacity: 0.6; background-color: var(--grid-line-color); border-left: none; }
.timeline-grid-line-half-decade { background-color: transparent; border-left: 1px dotted var(--grid-line-color); opacity: 0.3; width: 0; }
.timeline-year-label-top, .timeline-year-label-bottom { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--text-secondary-color); white-space: nowrap; z-index: 1; pointer-events: none; }
.timeline-year-label-top { top: calc(var(--timeline-top-padding) * -.6); font-weight: bold; }  
.timeline-year-label-bottom { bottom: calc(var(--timeline-bottom-padding) *  1.9); } 


/* Focus Year Line */
.timeline-focus-year-line {
    position: absolute;
    top: 0;
    width: 3px;
    background-color: #ffff00; /* Bright yellow */
    opacity: 0.7;
    z-index: 3; /* Above timeline items but below tooltips */
    pointer-events: none; /* Don't interfere with interactions */
    box-shadow: 0 0 4px rgba(255, 255, 0, 0.5); /* Subtle glow */
    transition: left 0.3s ease; /* Smooth movement when year changes */
}

/* Focus Year Label - displayed above the yellow line */
.focus-year-label {
    position: absolute;
    top: -34px;  /* Above the line - adjust as needed */
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;  /* Smaller size - adjust as needed */
    font-weight: 600;   /* Normal weight - adjust: 300=light, 400=normal, 500=medium, 600=semi-bold */
    color: #ffff00;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 6px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    letter-spacing: 0.5px;
}

/* Optional: Make it more visible with a gradient */
.timeline-focus-year-line::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -2px;
    width: 7px;
    height: 10px;
    background: linear-gradient(to bottom, #ffff00, transparent);
    border-radius: 3px 3px 0 0;
}

/* Optional: Add bottom indicator */
.timeline-focus-year-line::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: -2px;
    width: 7px;
    height: 10px;
    background: linear-gradient(to top, #ffff00, transparent);
    border-radius: 0 0 3px 3px;
}

/* Current Year Line -- simple GREEN marker at the actual current year (today).
   Mirrors the yellow focus line but with no label and no end-cap gradients. */
.timeline-current-year-line {
    position: absolute;
    top: 0;
    width: 3px;
    background-color: #00d84f; /* Bright green */
    opacity: 0.6;
    z-index: 2; /* Below the yellow focus line (z-index 3) */
    pointer-events: none; /* Don't interfere with interactions */
    box-shadow: 0 0 4px rgba(0, 216, 79, 0.5); /* Subtle glow */
}

/* Hover "ghost" of the focus year -- a faint preview shown while hovering a timeline item,
   removed on mouse-out (mirrors the ghosted tooltip). Separate from the real focus line. */
.focus-year-ghost-line {
    position: absolute;
    top: 0;
    width: 3px;
    background: repeating-linear-gradient(to bottom, #ffff00 0, #ffff00 6px, transparent 6px, transparent 10px);  /* dashed line */
    opacity: 0.3;
    z-index: 2;                 /* below the real focus line (z-index 3) */
    pointer-events: none;
    box-shadow: 0 0 4px rgba(255, 255, 0, 0.35);
}
.focus-year-ghost-label {
    position: absolute;
    top: -30px;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffff00;
    opacity: 0.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}
/* Light mode: dim-amber ghost label so it reads on the light canvas (matches the real label). */
html.theme-light .focus-year-ghost-label {
    color: #6b5200;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.85), 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Fade-IN only for the ghost year line + label (they are re-created on each hover, so this
   re-runs every time). No fade-out -- they are removed instantly on mouse-leave. */
@keyframes ghost-fade-in {
    from { opacity: 0; }
}
.focus-year-ghost-line,
.focus-year-ghost-label {
    animation: ghost-fade-in 0.25s ease-out;
}

/* Sticky (persistent) form of the ghost year -- fixed below the header when scrolled,
   mirroring #sticky-focus-year but ghosted (more transparent + dashed border). */
#sticky-focus-year-ghost {
    display: none;
    position: fixed;
    z-index: var(--z-focus-badge);
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #ffff00;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 12px 3px;
    border-radius: 5px;
    border: 1px dashed rgba(255, 255, 0, 0.45);
    opacity: 0.72;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    white-space: nowrap;
}
html.theme-light #sticky-focus-year-ghost {
    background: rgba(255, 243, 176, 0.78);
    color: #3a2d00;
    border-color: rgba(150, 110, 0, 0.5);
    text-shadow: none;
}


/* Sticky Focus Year Badge
   Appears fixed just below the sticky header when the user scrolls down
   far enough that the original yellow year label (above the focus line) is off-screen.
   JS in timelineRenderer.js manages visibility and horizontal position. */
#sticky-focus-year {
    display: none;
    position: fixed;
    z-index: var(--z-focus-badge);          /* ladder: above timeline, below pop-over cards (was 1100) */
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.72);
    color: #ffff00;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 12px 3px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 0, 0.35);
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.25);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    white-space: nowrap;
    transition: left 0.3s ease;  /* glides to match the focus line's own transition */
}

/* Light mode: focus-year label + sticky badge -- drop the dark/black treatment.
   Yellow-on-black reads as dark mode on a light page; use a pale highlight pill
   with dark text that still ties to the yellow focus line. */
html.theme-light .focus-year-label {
    color: #6b5200;   /* dark amber, readable on the light canvas */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9), 0 0 5px rgba(255, 255, 255, 0.6);
}
html.theme-light #sticky-focus-year {
    background: #fff3b0;                    /* pale yellow highlight pill (ties to the yellow line) */
    color: #3a2d00;                         /* dark text instead of yellow-on-black */
    border-color: rgba(150, 110, 0, 0.55);
    box-shadow: 0 0 8px rgba(150, 110, 0, 0.25);
    text-shadow: none;
}

/* Timeline Items (Bars) */
.timeline-item { position: absolute; border-radius: 4px; padding: 1px 8px; cursor: pointer; transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, z-index 0s linear 0.1s; white-space: nowrap; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); height: var(--timeline-item-height); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; z-index: 1; font-weight: 500; text-shadow: 0 0 3px rgba(0, 0, 0, 0.7); -webkit-tap-highlight-color: transparent; color: var(--text-color); will-change: transform, opacity; background-color: inherit; opacity: 1; }

.timeline-item.timeline-item-monthly { padding: 0px 6px; font-size: 0.7rem; opacity: 0.85; font-weight: 400; text-shadow: none; }



.timeline-item:hover, .timeline-item:active {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.12); /* Light translucent overlay */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);    /* Stronger shadow to lift it */
  z-index: 12 !important;
  transform: translateY(-2px);     /* Fixed 2px lift */
  padding-top: 2px;     /* Fixed 2px padding increase */
  padding-bottom: 2px;
  margin-top: -2px;     /* Compensate to prevent shifting */
  margin-bottom: -2px;
  overflow: visible;
  transition-delay: 0s;
}

/* Optional: make inner text stand out more on hover */
.timeline-item:hover .timeline-item-title {
  /*background-color: rgba(0, 0, 0, 0.7);  darken background for contrast */
  color: #ffffff;                      /* bright text */
  font-weight: bold;
  text-shadow: -2px -1px 0 #000, 2px -2px 0 #000, -1px 2px 0 #000, 1px 1px 0 #000;
}



.timeline-item.timeline-item-monthly:hover, .timeline-item.timeline-item-monthly:active { opacity: 1; text-shadow: 0 0 3px rgba(0, 0, 0, 0.7); }

.timeline-item-title { position: relative; z-index: 2; min-width: max-content; padding-right: 10px; pointer-events: none; }


/* ================================
   DRAG-TO-SCROLL STYLES
   ================================ */  


.timeline-scroll {
  /* ... existing styles ... */
  /* cursor: grab; Indicate it's draggable */
  user-select: none; /* Prevent text selection during drag */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Style for when dragging is active */
.timeline-scroll.is-dragging {
  cursor: grabbing;
}

/* Optional: Apply grabbing cursor to body too during drag */
body.timeline-is-dragging .timeline-scroll {
    cursor: grabbing;
}

/* When actively dragging the timeline */
.timeline-scroll.is-dragging,
.is-dragging .timeline-grid-container {
    cursor: grabbing !important;
}

/* ================================
   CURSOR STATES FOR TIMELINE
   ================================ */

/* Default: Regular arrow cursor for menus/settings */
body, 
#timeline-filter-panel,
#timeline-controls
{
    cursor: default;
}


/* ===============================
   ALT / OPTION â€“ MAGNIFY CURSOR
   =============================== */

body.alt-zoom-active {
    cursor: zoom-in;
}

body.alt-zoom-active #timeline-container,
body.alt-zoom-active #timeline-container * {
    cursor: zoom-in !important;
}


/* ===============================
   TIMELINE ITEMS & TOOLTIP CURSORS
   =============================== */
 
/* Timeline items (bars & milestones) - pointer finger */
/* Timeline items â€“ pointer ONLY when ALT is NOT pressed */
body:not(.alt-zoom-active) .timeline-item,
body:not(.alt-zoom-active) .milestone-wrapper,
body:not(.alt-zoom-active) .timeline-milestone {
    cursor: pointer !important;
}

/* Unlocked tooltip - pointer (clickable to lock) */
.timeline-tooltip:not(.locked) {
    cursor: pointer;
}

/* Locked tooltip - default arrow */
.timeline-tooltip.locked {
    cursor: default;
}

/* Locked tooltip header - move cursor for dragging */
.timeline-tooltip.locked .timeline-tooltip-group {
    cursor: move !important;
}

/* Interactive elements in tooltips - pointer */
.timeline-tooltip .event-tag,
.timeline-tooltip .imagePop,
.timeline-tooltip a {
    cursor: pointer !important;
}

/* Override any conflicting cursor styles */
.timeline-item:hover,
.milestone-wrapper:hover {
    cursor: pointer !important;
}

#timeline-bounding-box {
  border: 1px dashed rgb(55, 55, 55, 0.7);
  padding: 10px;
  position: relative;
}



.parent-indicator { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.7); box-shadow: 0 0 2px rgba(0,0,0,0.5); z-index: 3; }

/* Milestones */
.milestone-wrapper { position: absolute; transform: translateX(-50%); cursor: pointer; z-index: 5; -webkit-tap-highlight-color: transparent; transition: z-index 0s linear 0.1s; }
.milestone-wrapper:hover { z-index: 11 !important; transition-delay: 0s; }
.timeline-milestone { position: relative; display: block; margin: 0 auto; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease, outline-width 0.2s ease, border-width 0.2s ease, opacity 0.2s ease; width: var(--milestone-size); height: var(--milestone-size); border: var(--milestone-inner-border-width) solid var(--milestone-inner-border-color); outline: var(--milestone-border-width) solid transparent; outline-offset: calc(-1 * var(--milestone-border-width)); background-color: var(--milestone-inner-border-color); transform-origin: center center; will-change: transform, border-radius, opacity; outline-color: inherit; opacity: 1; }
.timeline-milestone.milestone-monthly { border-radius: 15%; }


.milestone-wrapper:hover .timeline-milestone { transform: scale(1.35); box-shadow: 0 4px 8px rgba(0,0,0,0.4); opacity: 1; }


.milestone-wrapper:hover .timeline-milestone.milestone-monthly { transform: scale(1.4); opacity: 1; }


.timeline-milestone.detail-level-2 { opacity: 0.8; border-radius: 20%; transform: rotate(45deg); outline-width: calc(var(--milestone-border-width) - 1px); border-width: calc(var(--milestone-inner-border-width) + 0px); }
.timeline-milestone.detail-level-3 {
  /* STAR look for level-3 'album' milestones: a small 5-pointed star filled with the
     band's category color. clip-path replaces the round dot; outline is removed because
     clip-path does not clip the outline (it would draw a square around the star). */
  opacity: 1;
  border-radius: 0;
  border-color: transparent;
  outline: none;
  transform: scale(0.9);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
                     50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.milestone-wrapper:hover .timeline-milestone.detail-level-3 { transform: scale(1.25); }
.timeline-milestone.milestone-monthly.detail-level-2 { transform: rotate(0deg); }


.milestone-wrapper:hover .timeline-milestone.detail-level-2 { transform: rotate(45deg) scale(1.3); }

.milestone-wrapper:hover .timeline-milestone.milestone-monthly.detail-level-2 { transform: rotate(0deg) scale(1.4); }


/* Make sure hover effect works reliably by applying it to both wrapper and milestone */
.milestone-wrapper:hover .milestone-title,
.timeline-milestone:hover + .milestone-title {
    opacity: 1;
    display: block !important; /* Force display regardless of hidden class */
    background-color: rgba(0, 0, 0, 0.85);
    transform: translateX(-50%) scale(1.05);
    color: #f7f6f7;
    text-shadow: 0 0 2px #000, 0 0 3px #000;
    
}



.milestone-title { 
  display: block;
  position: absolute;
  top: var(--milestone-label-offset);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;

  text-overflow: ellipsis;
  max-width: 50px;/* ADJUSTING THIS didnt work until i commented out a line in timelineRenderer.JS  */
  
  background-color: rgba(0, 0, 0, 0.5); 
  padding: 1px 1px;
  border-radius: 2px;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  z-index: 6;
  /* Enhanced text shadow for better contrast on all backgrounds */
  /* text-shadow: 0 0 3px #000, 0 0 3px #000;  */
  color: #c2cccb;
  width: max-content;
  /* Make sure it's visible by default */
  opacity: 0.8; 
}

/* Make highlighted title styling even more prominent */
.milestone-title-highlighted {
  background-color: rgba(0, 0, 0, 0.75); 
  color: #b6b8b7;
  box-shadow: 0 2px 6px rgba(15, 13, 138, 0.5);
  font-weight: bold;
  transform: translateX(-50%);
  text-shadow: none;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0.9;
  display: block !important;
  z-index: 10;
  max-width: 130px;/*  OK TRY  */
}



/* Make sure hidden ones are actually hidden */
.milestone-title.hidden {
  opacity: 0;
  display: none;
}

/* === LIGHT MODE ONLY: dark text on a pale box for milestone labels + hovered bar title ===
   Mirrors the dark-mode rules above but flips the box to pale and the text to dark.
   Dark mode is intentionally left untouched. */
html.theme-light .milestone-title {                 /* 1. normal small milestone tags */
  background-color: rgba(255, 255, 255, 0.78);
  color: #1a1a1a;
  text-shadow: none;
}
html.theme-light .milestone-title-highlighted {     /* 2. selected milestone label */
  background-color: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  text-shadow: none;
}
html.theme-light .milestone-wrapper:hover .milestone-title,   /* 3. hovered/enlarged label */
html.theme-light .timeline-milestone:hover + .milestone-title {
  background-color: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  text-shadow: none;
}
html.theme-light .timeline-item:hover .timeline-item-title {  /* 4. hovered bar title */
  color: #1a1a1a;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.85);   /* light glow instead of the black outline */
}



/* Category Colors Application onto BARS and MILESTONES */
.timeline-item.color-category-one,   .milestone-wrapper .timeline-milestone.color-category-one   { background-color: var(--category-one-color);   outline-color: var(--category-one-color); }
.timeline-item.color-category-two,   .milestone-wrapper .timeline-milestone.color-category-two   { background-color: var(--category-two-color);   outline-color: var(--category-two-color); }
.timeline-item.color-category-three, .milestone-wrapper .timeline-milestone.color-category-three { background-color: var(--category-three-color); outline-color: var(--category-three-color); }
.timeline-item.color-category-four,  .milestone-wrapper .timeline-milestone.color-category-four  { background-color: var(--category-four-color);  outline-color: var(--category-four-color); }
.timeline-item.color-category-five,  .milestone-wrapper .timeline-milestone.color-category-five  { background-color: var(--category-five-color);  outline-color: var(--category-five-color); }
.timeline-item.color-category-six,   .milestone-wrapper .timeline-milestone.color-category-six   { background-color: var(--category-six-color);   outline-color: var(--category-six-color); }
.timeline-item.color-category-seven, .milestone-wrapper .timeline-milestone.color-category-seven { background-color: var(--category-seven-color); outline-color: var(--category-seven-color); }
.timeline-item.color-category-eight, .milestone-wrapper .timeline-milestone.color-category-eight { background-color: var(--category-eight-color); outline-color: var(--category-eight-color); }
.timeline-item.color-category-nine,  .milestone-wrapper .timeline-milestone.color-category-nine  { background-color: var(--category-nine-color);  outline-color: var(--category-nine-color); }
.timeline-item.color-category-ten,   .milestone-wrapper .timeline-milestone.color-category-ten   { background-color: var(--category-ten-color);   outline-color: var(--category-ten-color); }

.timeline-item.color-category-eleven,   .milestone-wrapper .timeline-milestone.color-category-eleven   { background-color: var(--category-eleven-color);   outline-color: var(--category-eleven-color); }
.timeline-item.color-category-twelve,   .milestone-wrapper .timeline-milestone.color-category-twelve   { background-color: var(--category-twelve-color);   outline-color: var(--category-twelve-color); }
.timeline-item.color-category-thirteen, .milestone-wrapper .timeline-milestone.color-category-thirteen { background-color: var(--category-thirteen-color); outline-color: var(--category-thirteen-color); }
.timeline-item.color-category-fourteen, .milestone-wrapper .timeline-milestone.color-category-fourteen { background-color: var(--category-fourteen-color); outline-color: var(--category-fourteen-color); }
.timeline-item.color-category-fifteen,  .milestone-wrapper .timeline-milestone.color-category-fifteen  { background-color: var(--category-fifteen-color);  outline-color: var(--category-fifteen-color); }
.timeline-item.color-category-sixteen,  .milestone-wrapper .timeline-milestone.color-category-sixteen  { background-color: var(--category-sixteen-color);  outline-color: var(--category-sixteen-color); }
.timeline-item.color-category-seventeen,.milestone-wrapper .timeline-milestone.color-category-seventeen{ background-color: var(--category-seventeen-color);outline-color: var(--category-seventeen-color); }
.timeline-item.color-category-eighteen, .milestone-wrapper .timeline-milestone.color-category-eighteen { background-color: var(--category-eighteen-color); outline-color: var(--category-eighteen-color); }
.timeline-item.color-category-nineteen, .milestone-wrapper .timeline-milestone.color-category-nineteen { background-color: var(--category-nineteen-color); outline-color: var(--category-nineteen-color); }
.timeline-item.color-category-twenty,   .milestone-wrapper .timeline-milestone.color-category-twenty   { background-color: var(--category-twenty-color);   outline-color: var(--category-twenty-color); }


/* expand/collapse the sections for the settings/controls  */
/* Control Block Titlebar - Toggle arrow and title inline */
.control-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.control-toggle {
    background: none;
    border: none;
    color: var(--text-secondary-color, #888);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

/* Hover effect on titlebar affects both toggle and title */
.control-titlebar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.control-titlebar:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.control-titlebar:hover .control-toggle,
.control-titlebar:hover .control-title {
    color: var(--text-color, #fff);
}

.control-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary-color, #aaa);
    transition: color 0.2s ease;
    user-select: none;
}

.control-block {
    margin-bottom: 0.2rem;
}



/* Tooltip Styles */
/* Enhanced Tooltip Styles with Better Transitions */
.timeline-tooltip { 
  position: absolute; 
  color: grey;  
  background-color: rgba(201, 233, 244, 0.85);
  border-radius: 6px; 
  padding: var(--timeline-tooltip-padding); 
  box-shadow: 0 4px 12px var(--tooltip-shadow-color);
  z-index: var(--z-popover);
  font-size: 14px; 
  max-width: var(--timeline-tooltip-max-width); 
  min-width: var(--timeline-tooltip-min-width); 
  max-height: var(--timeline-tooltip-max-height); 
  overflow-y: auto; 
  pointer-events: auto; 
  border: 1px dashed gray; 
  
  /* Enhanced transitions for smoother state changes */
  transition: 
    opacity var(--tooltip-animation-speed) ease,
    transform var(--tooltip-animation-speed) ease,
    visibility var(--tooltip-animation-speed) ease,
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    scale 0.2s ease;
  
  opacity: .85; 
  transform: scale(0.95) translateY(10px); /* Start from below */
  visibility: hidden; 
  line-height: 1.4; 
  user-select: text; 
  -webkit-user-select: text; 
  -moz-user-select: text; 
  -ms-user-select: text;
  
  /* Add subtle hover state preparation */
  transform-origin: center center;
}

/* Fixed pop-over width: hover (ghost) and locked render the SAME width regardless of content
   length (auto-width made the truncated hover card narrower than the full locked card). */
.timeline-tooltip,
.timeline-tooltip.locked {
    width: 320px;
}

/* Locked tooltip state with enhanced visual feedback */
.timeline-tooltip.locked {
  position: absolute; 
  color: #4b0082; /* Dark purple */
  border-radius: 6px; 
  padding: var(--timeline-tooltip-padding); 
  box-shadow: 0 8px 24px var(--tooltip-shadow-color); /* Stronger shadow for locked state */
  z-index: var(--z-popover);   /* ladder: same tier as hover card (was 100, which trapped it under the badge) */
  font-size: 14px; 
  max-width: var(--timeline-tooltip-max-width); 
  min-width: var(--timeline-tooltip-min-width); 
  max-height: var(--timeline-tooltip-max-height);   /* match the hover/ghost card height (was 400px) */ 
  overflow-y: auto; 
  pointer-events: auto; 
  

  /* Enhanced transitions - same as base but with different timing for lock */
  transition: 
    opacity var(--tooltip-animation-speed) ease,
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), /* Bouncy effect for lock */
    visibility var(--tooltip-animation-speed) ease,
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.4s ease,
    scale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy scale */
  
  opacity: 1;  
  transform: scale(1) translateY(0); /* same rendered size as the hover/ghost card (was scale 1.05) */
  visibility: visible; 
  
  /* Enhanced locked visual state */
  background-color: rgb(166, 224, 244); /* locked background */
  border: 2px solid rgb(60, 21, 134); /* locked border color */
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.8),
    0 0 0 2px rgba(255, 255, 255, 0.3), /* White glow ring */
    inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Inner highlight */
  
  line-height: 1.4; 
  user-select: text; 
  -webkit-user-select: text; 
  -moz-user-select: text; 
  -ms-user-select: text;
  
  /* Add a subtle pulse animation for locked state */
  animation: tooltipPulse 2s ease-in-out infinite;
}

/* Keyframe animation for locked tooltip pulse */
@keyframes tooltipPulse {
  0%, 100% { 
    box-shadow: 
      0 8px 24px rgba(0, 0, 0, 0.8),
      0 0 0 2px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% { 
    box-shadow: 
      0 8px 24px rgba(0, 0, 0, 0.8),
      0 0 0 3px rgba(255, 255, 255, 0.5), /* Slightly stronger glow */
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

/* Enhanced fade-in state */
.tooltip-fadein { 
  opacity: 1; 
  transform: scale(1) translateY(0); /* Normal size and position */
  visibility: visible;
  /* Smooth entry animation */
  animation: tooltipFadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Enhanced fade-out state */
.tooltip-fadeout { 
  opacity: 0; 
  transform: scale(0.9) translateY(10px); /* Drift down and shrink slightly */
  visibility: hidden;
  /* Smooth exit animation */
  animation: tooltipFadeOut 0.2s ease-in forwards;
}

/* Keyframe animations for better tooltip entry/exit */
@keyframes tooltipFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(10px); /* Start lower and drift UP */
  }
  100% {
    opacity: 0.85;
    transform: scale(1) translateY(0);
  }
}

@keyframes tooltipFadeOut {
  0% {
    opacity: 0.85;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(10px); /* Exit by drifting down */
  }
}

/* Enhanced tooltip group header with transition */
.timeline-tooltip-group { 
  font-size: 0.8rem; 
  font-weight: 700; 
  color: inherit; 
  background-color: rgba(0,0,0,0.2); 
  text-shadow: 0px 0px 2px rgba(0,0,0,0.6); 
  margin: calc(-1 * var(--timeline-tooltip-padding)) calc(-1 * var(--timeline-tooltip-padding)) 8px calc(-1 * var(--timeline-tooltip-padding)); 
  padding: 4px 12px; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  border-bottom: 1px solid var(--border-color); 
  border-top-right-radius: 6px; 
  border-left: 4px solid transparent;
  border-left-width: 10px;  /* â† MAKE LEFT STRIPE THICKER   */

  /* Add transition for color changes */
  transition: 
    background-color 0.3s ease,
    border-left-color 0.3s ease,
    color 0.3s ease;
}



.timeline-tooltip-title {
  font-weight: bold; /* Lets STYLE the TITLE of the item  */
  font-style: italic;
  font-size: 1.10em;
  font-weight: 700;
  line-height: 1.1;   /* tighter wrapped-line spacing */
  margin-top: 0 em;
  margin-bottom: 0.1em;
}

.timeline-tooltip-years-inline {
  font-weight: normal; /*   YEAR  of the item  */
  font-style: normal;
  margin-top: 0 em;
  margin-bottom: 0.1em;
  font-size: 1em;   /* match the Title text size (was 1.10em, which compounded with the Title font-size) */
  font-weight: 700;
  color: #ffd84d;
  text-shadow: 0 0 4px rgba(255, 216, 77, 0.35);
}

.timeline-tooltip-notes {
  font-style: normal;
  font-size: 0.9em; /* Base font size for tooltip text */
  line-height: 1.1;   /* tighter wrapped-line spacing */
  margin-top: 0.4em;   /* more room above this field */
  margin-bottom: 0.1em;
}

.timeline-tooltip-known-for {
  font-style: italic;
  font-size: 0.9em; /* Base font size for tooltip text */
  line-height: 1.1;   /* tighter wrapped-line spacing */
  margin-top: 0.4em;   /* more room above this field */
  margin-bottom: 0.1em;
}

.timeline-tooltip-image-caption {
  font-style: italic;
  font-size: 0.8em; /* Base font size for tooltip text */
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

.timeline-tooltip-additional {
  font-style: normal;
  color: #4b0082; /* Dark purple */
  font-size: .9em; /* Base font size for tooltip text */
  line-height: 1.1;   /* tighter wrapped-line spacing */
  margin-top: 0.4em;   /* more room above this field */
  margin-bottom: 0.1em;
}

.timeline-tooltip-metadata {
  font-style: italic;
  font-size: 0.7em; /* Base font size for tooltip text */
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

/* Enhanced locked tooltip group header */
.timeline-tooltip.locked .timeline-tooltip-group {
  background-color: rgba(0,0,0,0.3); /* Slightly darker when locked */
  color: inherit;
  border-left-width: 15px; /* Thicker left border when locked */
  cursor: move; /* Show move cursor when locked */
  user-select: none; /* Prevent text selection when dragging */
}

/* ToolTips drag? styles */
.timeline-tooltip.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); /* Enhanced shadow when dragging */
  transition: none; /* Remove transitions during drag */
}  

/*.timeline-tooltip.dragging .timeline-tooltip-group {
  cursor: grabbing !important;
} */


/* Ensure text colors are maintained */
.timeline-tooltip,
.timeline-tooltip * {
  color: #37303c !important;
  transition: color 0.2s ease; /* Smooth color transitions */
}

.timeline-tooltip.locked,
.timeline-tooltip.locked * {
  color: #280f3b !important;
}



/* Enhanced image container transitions */
.timeline-tooltip-image-container {
  margin: 0.6rem auto 0.3rem auto; 
  border: 1px solid var(--border-color); 
  border-radius: 4px; 
  overflow: hidden; 
  max-width: 90%;
  background-color: rgba(255, 255, 255, 0.05); 
  text-align: center;
  
  /* Add transition for border and background */
  transition: 
    border-color 0.3s ease,
    background-color 0.3s ease,
    transform 0.2s ease;
}

.timeline-tooltip-image {
  width: 100%;         /* â† makes image fill tooltip width */
  max-height: 220px;   /* â† limit vertical overflow */
  object-fit: contain; /* â† keeps image ratio intact */
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

/* Enhanced image container when tooltip is locked */
.timeline-tooltip.locked .timeline-tooltip-image-container {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.02); /* Slightly larger image when locked */
}

/* Optional: Add hover effects to tooltips themselves */
.timeline-tooltip:hover {
  transform: scale(1.02) translateY(-1px);
}

.timeline-tooltip.locked:hover {
  transform: scale(1.06) translateY(-3px); /* More pronounced when locked and hovered */
  animation-play-state: paused; /* Pause pulse animation on hover */
}


/*  ---- FEATURE IMAGES -- CHANGING IMAGES for DECADES AND YEARS  ----- */

/* Feature Container Styles */
#Feature_Container {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;     /* Center vertically */
    width: 100%;
    max-width: 900px; /* Adjust as needed for your layout */
    height: 130px; /* Height for the container */
    min-height: 140px;
    margin: 2px auto; /* reduced top/bottom margin; auto for left/right centering */
    /* background-color: rgba(255, 255, 0, 0.5); 
    /* Yellow for visualization, remove or set to transparent */
    border-radius: 8px;
    gap: 15px; /* Space between the images */
    overflow: hidden; /* Ensure images don't spill out */
}

#Feature_Container img {
    width: 240px;          /* â† choose your stable width */
    height: 120px;         /* â† choose your stable height */

    max-width: 30%; /* Each image takes up roughly 1/3rd of the container width, adjust as needed */
  

    object-fit: contain; /* Crop images to fit without distortion */
    object-position: center;
    
    border: 3px solid var(--accent-color); /* Greenish border for focus images */
    border-radius: 5px;
    background-color: rgba(0,0,0,0.35); /* subtle matte */
    
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);


    opacity: 1; /* default visible; JS will fade-out/fade-in */
    transition: opacity 1.2s ease-in-out; /* Smooth fade transition */
    will-change: opacity;


    /* Prevent reflow flashes */
    /* display: block; */
}

/* When image source is present */
/* #Feature_Container img[src]:not([src=""]) { */
/*   opacity: 1; */
/* } */



/* NEW TOOLTIP LOCKED SOURCE = BARS (timeline item) visual indicator from the source element */
/* Maintain elevated state + golden indicator */
.timeline-item.tooltip-locked-source {
    opacity: 1 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    outline: 2px solid rgba(255, 215, 0, 0.6) !important;
    outline-offset: 1px;
    z-index: 12 !important;
}


/* NEW TOOLTIP LOCKED SOURCE = MILESTONE locked highlight: circular ring (not square wrapper outline) */
.milestone-wrapper.tooltip-locked-source {
    outline: none !important;          /* ensure no square outline */
    box-shadow: none !important;
}



.milestone-wrapper.tooltip-locked-source .timeline-milestone {
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.85) !important;  /* ring */
    border-radius: 50% !important;      /* force circle ring */
    z-index: 12;                        /* stays above nearby elements */
    transform: scale(1.15);             /* LOCK BUMP -- see note below */
}

/* LOCK BUMP (2026-08-18): a locked/selected milestone grows 1.15x so the
   selection reads at a glance. Applied to EVERY detail level, each restated
   with its own base geometry because `transform` is a single property --
   writing scale() alone would wipe out level-2's rotate() and level-3's
   0.9 base scale. Hover-while-locked variants follow each one, since these
   locked rules come later in the file than the generic :hover rules and
   would otherwise cancel the hover growth. */
.milestone-wrapper.tooltip-locked-source:hover .timeline-milestone {
    transform: scale(1.35);
}
.milestone-wrapper.tooltip-locked-source .timeline-milestone.milestone-monthly {
    transform: scale(1.15);
}
.milestone-wrapper.tooltip-locked-source:hover .timeline-milestone.milestone-monthly {
    transform: scale(1.4);
}

/* Level-3 "star" milestones use clip-path, which clips box-shadow away along with everything
   outside the star cutout -- so the ring above is invisible on them. Use a shape-hugging
   drop-shadow glow instead (filter isn't clipped the same way) so locked/selected is just as
   noticeable on level-3 as it is on levels 1 & 2. */
.milestone-wrapper.tooltip-locked-source .timeline-milestone.detail-level-3 {
    box-shadow: none !important;
    border-radius: 0 !important;       /* undo the force-circle rule above */
    transform: scale(1.035);           /* LOCK BUMP: 0.9 base x 1.15 */
}
.milestone-wrapper.tooltip-locked-source:hover .timeline-milestone.detail-level-3 {
    transform: scale(1.25);
}

/* FIX (2026-08-18): level-2 milestones are DIAMONDS (20% radius + 45deg rotate).
   The generic locked rule above forces `border-radius: 50% !important`, which
   turned them into circles the moment they were locked -- a rotated circle is
   still a circle, so the diamond silhouette vanished. Restore the diamond
   geometry here; the gold box-shadow ring follows border-radius, so it now
   draws as a diamond-shaped ring instead of a round one. */
.milestone-wrapper.tooltip-locked-source .timeline-milestone.detail-level-2 {
    border-radius: 20% !important;
    transform: rotate(45deg) scale(1.15);   /* LOCK BUMP, rotation preserved */
}
/* monthly level-2 markers sit un-rotated -- keep them that way when locked */
.milestone-wrapper.tooltip-locked-source .timeline-milestone.milestone-monthly.detail-level-2 {
    border-radius: 20% !important;
    transform: rotate(0deg) scale(1.15);    /* LOCK BUMP */
}
/* hover-while-locked must still scale, and must not lose the rotation */
.milestone-wrapper.tooltip-locked-source:hover .timeline-milestone.detail-level-2 {
    transform: rotate(45deg) scale(1.3);
}
.milestone-wrapper.tooltip-locked-source:hover .timeline-milestone.milestone-monthly.detail-level-2 {
    transform: rotate(0deg) scale(1.4);
}

/* FIX (2026-08-18): the outline must live on the WRAPPER, not on the star itself.
   CSS renders `filter` BEFORE `clip-path`, so a drop-shadow set on the clipped
   element is cut away with everything else outside the star cutout. The wrapper
   has no clip-path, so a filter there operates on the already-clipped child.
   Zero-blur drop-shadows chained in 4 directions build a CRISP, EVEN stroke that
   hugs the star -- deliberately NOT a soft glow, so it matches the clean 3px gold
   ring that levels 1 & 2 get from box-shadow. */
.milestone-wrapper.tooltip-locked-source:has(.timeline-milestone.detail-level-3) {
    filter:
        drop-shadow( 3px  0    0 rgba(255, 215, 0, 0.85))
        drop-shadow(-3px  0    0 rgba(255, 215, 0, 0.85))
        drop-shadow( 0    3px  0 rgba(255, 215, 0, 0.85))
        drop-shadow( 0   -3px  0 rgba(255, 215, 0, 0.85));
    z-index: 12 !important;
}


/* Subtle animation to catch the eye */
.timeline-item.tooltip-locked-source,
.milestone-wrapper.tooltip-locked-source {
    animation: gentleGlow 3s ease-in-out infinite;
}




@keyframes gentleGlow {
    0%, 100% { outline-color: rgba(255, 215, 0, 0.6); }
    50% { outline-color: rgba(255, 215, 0, 0.9); }
}





 /* Loading state */
.loading-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  font-size: 1.1rem;
  color: var(--text-secondary-color);
  position: absolute; /* Add this */
  width: 100%; /* Add this */
  top: 50%; /* Add this */
  transform: translateY(-50%); /* Add this */
  z-index: 1; /* Add this */
}




/* ===================================================
   KEYWORD & TAGS ---  CAPSULE INTERACTIVITY
   =================================================== */

.timeline-tooltip-tags {
    margin-top: 6px;
}

.event-tag {
    display: inline-block;
    padding: 2px 7px;
    margin: 2px 4px 2px 0;
    font-size: 0.72rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    color: #ddd;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

/* Smaller, tighter keyword lozenges inside tooltips */
.timeline-tooltip .event-tag {
    padding: 1px 6px;
    margin: 1px 3px 1px 0;
    font-size: 0.66rem;
    border-radius: 9px;
}

.event-tag:hover {
    background: rgba(255,255,255,0.22);
    outline: 2px solid #ffffff;
    outline-offset: 1px;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.event-tag.active {
    background: #ffffff;
    color: #000000;
}


/* ===============================
   TAG HIGHLIGHTING ON TIMELINE
   =============================== */

/* Highlight bars */  /* THIS IS FINE  */
.timeline-item.tag-highlight {
    filter: brightness(1.4) saturate(1.25);
    outline: 2px solid rgba(255,255,255,0.75);
    z-index: 3;
}


/* Highlight milestones - use box-shadow for white ring */
.timeline-milestone.tag-highlight {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.75) !important;
    z-index: 3;
}

/* Same clip-path-vs-box-shadow issue as the locked-tooltip ring above: level-3 star milestones
   clip the white ring away. Swap in a drop-shadow glow so tag-toggle highlighting is visible
   on level-3 too. */
.timeline-milestone.detail-level-3.tag-highlight {
    box-shadow: none !important;
    z-index: 3;
}

/* FIX (2026-08-18): same clip-path/filter ordering problem as the locked ring --
   put the white tag-highlight outline on the unclipped WRAPPER so it survives.
   Zero-blur chained drop-shadows = crisp 2px stroke, matching the 2px white
   box-shadow ring that levels 1 & 2 use. No soft glow. */
.milestone-wrapper:has(.timeline-milestone.detail-level-3.tag-highlight) {
    filter:
        drop-shadow( 2px  0    0 rgba(255, 255, 255, 0.75))
        drop-shadow(-2px  0    0 rgba(255, 255, 255, 0.75))
        drop-shadow( 0    2px  0 rgba(255, 255, 255, 0.75))
        drop-shadow( 0   -2px  0 rgba(255, 255, 255, 0.75));
    z-index: 10;
}

/* Light mode: violet stroke instead of white, matching the level-1/2 treatment */
html.theme-light .milestone-wrapper:has(.timeline-milestone.detail-level-3.tag-highlight) {
    filter:
        drop-shadow( 2px  0    0 rgba(124, 58, 237, 0.85))
        drop-shadow(-2px  0    0 rgba(124, 58, 237, 0.85))
        drop-shadow( 0    2px  0 rgba(124, 58, 237, 0.85))
        drop-shadow( 0   -2px  0 rgba(124, 58, 237, 0.85));
}


/*  ========  MORE CURSOR ADJUSTMENTS ========= */

/* Locked tooltip - default arrow */
.timeline-tooltip.locked {
    cursor: default;
}

/* Locked tooltip header - move cursor for dragging */
.timeline-tooltip.locked .timeline-tooltip-group {
    cursor: move !important;
}

/* Interactive elements in tooltips - pointer */
.timeline-tooltip .event-tag,
.timeline-tooltip .imagePop,
.timeline-tooltip a {
    cursor: pointer !important;
}

/* Override any conflicting cursor styles */
.timeline-item:hover,
.milestone-wrapper:hover {
    cursor: pointer !important;
}



/* ================================
   Feature Image Filenames (Debug)
   ================================ */

#Feature_Filenames {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 6px;
}

#Feature_Filenames > div {
    width: 320px;              /* MUST match image width */
    text-align: center;
    font-family: monospace;
    font-size: 11px;
    color: #aaa;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#Feature_Filenames_TRUTH {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2px;
    opacity: 0.6;
}

#Feature_Filenames_TRUTH > div {
    width: 320px;
    text-align: center;
    font-family: monospace;
    font-size: 10px;
    color: #8aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}




/* ==   ========== RESPONSIVE LAYOUT  ============== */


/* ========================================
   STYLES MOVED FROM HTML - Focus Year Display
   ======================================== */

#focused-year-display {
    text-align: center;
    font-size: 1.2em;
    font-weight: normal;
    color: rgb(187, 187, 185);
    margin: 10px 0;
    padding: 5px 0;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}


#current-focused-year {
    color: rgb(180, 180, 180);
    font-size: 0.6em;  /* Smaller size for the placeholder text */
    font-weight: normal;
    font-style: italic; /* Optional: make placeholder more subtle */
}

/* When an actual year is displayed */
#current-focused-year.has-year {
    color: rgb(230, 233, 88);
    font-size: 1em;  /* Normal size for actual year */
    font-weight: bold; /* Optional: make year stand out */
    font-style: normal;
}


/* ========================================
   STYLES MOVED FROM HTML - Hide/Show Controls
   ======================================== */

/* NEW CODE FOR HIDE AND SHOW -- Hide controls based on body classes */
.hide-item-cap-controls .item-cap-controls {
    display: none !important;
}

.hide-feature-focus .Feature_Container,
.hide-feature-focus .feature-focus-content { display: none !important; }
/* CORRECTED YEAR RANGE FILTER RULE */
.hide-year-range-filter .year-range-filter { display: none !important; }
.hide-debug-console #debugOutput,
.hide-debug-console #console,
.hide-debug-console pre {
    display: none !important;
}
/* Hide filter toggles content */
.hide-filter-toggles .filter-toggles-content { display: none !important; }
/* Hide zoom level content */
.hide-zoom-level .zoom-level-content { display: none !important; }
/* Hide data sources content */
.hide-data-sources .data-sources-content { display: none !important; }

/* ========================================
   DATA SOURCES - 3-Column Grid Layout
   Max 6 rows visible, scrollable overflow
   ======================================== */

.data-sources-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 12px;
    max-height: 156px; /* ~6 rows at ~26px each */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 4px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar for data sources */
.data-sources-list::-webkit-scrollbar {
    width: 8px;
}

.data-sources-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.data-sources-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.data-sources-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.data-source-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
    min-height: 22px;
    font-size: 0.85em;
}

.data-source-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.data-source-toggle {
    position: relative;
    width: 32px;
    height: 16px;
    flex-shrink: 0;
}

.data-source-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.data-source-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.2s;
    border-radius: 16px;
}

.data-source-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #888;
    transition: 0.2s;
    border-radius: 50%;
}

.data-source-toggle input:checked + .toggle-slider {
    background-color: #4a7c4a;
}

.data-source-toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #8f8;
}

.data-source-label {
    flex: 1;
    font-weight: 500;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.data-source-file {
    display: none; /* Hide filename in compact view */
}

.data-source-count {
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

/* Actions row styling */
.data-sources-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.data-sources-btn {
    padding: 4px 10px;
    font-size: 0.85em;
    border: 1px solid #2a7fd8;
    border-radius: 4px;
    background: #1a5fa8;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.data-sources-btn:hover {
    background: #2a7fd8;
    color: #fff;
}

.data-sources-apply {
    margin-left: auto;
}

/* Apply Changes button styles */
#applyDataSources {
    background: #3a3a42;          /* neutral grey -- the "all applied" / inactive state */
    color: #9aa0a6;
    font-weight: normal;
    cursor: default;
    pointer-events: none;        /* not clickable when there is nothing to apply */
    opacity: 0.75;
    transition: all 0.3s ease;
}

#applyDataSources.pending-changes {
    background: #dc2626 !important;
    color: #fff !important;
    font-weight: bold !important;
    cursor: pointer;
    pointer-events: auto;        /* clickable again when there are pending changes */
    opacity: 1;
    animation: pulse-attention 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

@keyframes pulse-attention {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
    }
    50% { 
        transform: scale(1.03);
        box-shadow: 0 0 15px rgba(220, 38, 38, 0.9);
    }
}

/* Timeline initialization - hide until ready to prevent flash of unfiltered content */
#timeline-container.timeline-initializing {
    visibility: hidden;
    opacity: 0;
}
#timeline-container.timeline-ready {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* ========================================
   MASTER COLLAPSE - Controls Panel Toggle
   ======================================== */

.master-collapse-toggle {
    background: #6b21a8;             /* dark purple -- light mode overrides below */
    border: 1px solid #9333ea;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    width: 28px;
    height: 24px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.master-collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Rotate only the arrow span when collapsed, not the whole button */
.master-collapse-toggle .toggle-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}
.controls-collapsed .master-collapse-toggle .toggle-arrow {
    transform: rotate(-90deg);
}

/* Summary bar - hidden by default, shown when collapsed */
.controls-summary-bar {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 0.85em;
    color: #bbb;
    white-space: nowrap;
}

.controls-collapsed .controls-summary-bar {
    display: flex;
}

.controls-summary-bar .summary-item strong {
    color: #fff;
    font-weight: 600;
}

.controls-summary-bar .summary-divider {
    color: rgba(255, 255, 255, 0.3);
}

/* Stats pill — groups Zoom/Range/Levels/Sources together */
.summary-stats-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 4px;
    padding: 1px 8px;
}
html.theme-light .summary-stats-group {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Keyword Jump-Links */
.keyword-jumplink {
    cursor: pointer;
    padding: 2px 8px;
    margin: 0 3px;
    background: rgba(93, 217, 208, 0.15);
    color: #5dd9d0;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.keyword-jumplink:hover {
    background: rgba(93, 217, 208, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.keyword-jumplink:active {
    transform: translateY(0);
}

/* Show Note chip only when settings panel is collapsed */
.controls-collapsed .subtitle-text {
    display: inline-flex;
}

/* Adjust header layout for collapse toggle */
.sticky-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Hide settings panel when collapsed */
.controls-collapsed #settings-panel {
    display: none;
}

/* Smooth transition for the panel */
#settings-panel {
    background: rgba(88, 22, 150, 0.92);   /* dark purple -- light mode overrides below */
    border-top: 2px solid #9333ea;
    transition: all 0.2s ease;
}

/* Make the wrapper indicate collapsed state visually */
.controls-collapsed#sticky-controls-wrapper {
    padding-bottom: 8px;
}

/* ========================================
   CLIPPED BAR STYLES - Visual indicators for bars
   that extend beyond the current year range filter
   ======================================== */

/* Left-clipped bars: start before the visible range */
.timeline-item.clipped-left {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    position: relative;
}


/* RETIRED 2026-06-23: clipped-bar edge fades used to be drawn by ::before/::after
   pseudo-elements here. The LIVE fade is the .clip-indicator-left / .clip-indicator-right
   CHILD DIVS (created in timelineRenderer.js ~line 708, styled further below, incl. the
   light-mode override). The pseudo versions sat hidden behind those divs, so editing them
   did nothing on screen -- removed to avoid confusion.
   Old CSS: June22-23_BackUps_Copys/styles_BACKUP_2026-06-23_clipindicator.css */

/* No chevron for clipped-left - removed */

/* Right-clipped bars: end after the visible range */
.timeline-item.clipped-right {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    position: relative;
}

/* No chevron for clipped-right - removed */

/* Ensure title text doesn't overlap with clipped indicators */
.timeline-item.clipped-left .timeline-item-title {
    padding-left: 30px;
    /* Slight fade on text start - wider to match */
    mask-image: linear-gradient(to right, transparent 0px, black 28px);
    -webkit-mask-image: linear-gradient(to right, transparent 0px, black 28px);
}

.timeline-item.clipped-right .timeline-item-title {
    padding-right: 30px;
    /* Slight fade on text end - wider to match */
    mask-image: linear-gradient(to left, transparent 0px, black 28px);
    -webkit-mask-image: linear-gradient(to left, transparent 0px, black 28px);
}

.timeline-item.clipped-left.clipped-right .timeline-item-title {
    padding-left: 30px;
    padding-right: 30px;
    mask-image: linear-gradient(to right, transparent 0px, black 28px, black calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0px, black 28px, black calc(100% - 28px), transparent 100%);
}

/* Clip indicator elements (child divs for better control) - simplified, no chevrons or lines */
.clip-indicator {
    position: absolute;
    top: 0;
    height: 100%;
    width: 35px;
    pointer-events: auto;
    cursor: help;
    z-index: 5;
}

.clip-indicator-left {
    left: 0;
    background: linear-gradient(
        to right,
        rgba(20, 20, 30, 0.95) 0%,
        rgba(20, 20, 30, 0.7) 35%,
        rgba(20, 20, 30, 0.3) 65%,
        transparent 100%
    );
    /* No border-right line */
}

/* No chevron content */
.clip-indicator-left::before {
    content: none;
}

.clip-indicator-right {
    right: 0;
    background: linear-gradient(
        to left,
        rgba(20, 20, 30, 0.95) 0%,
        rgba(20, 20, 30, 0.7) 35%,
        rgba(20, 20, 30, 0.3) 65%,
        transparent 100%
    );
    /* No border-left line */
}

/* No chevron content */
.clip-indicator-right::before {
    content: none;
}

/* Hover effect on clip indicators - subtle */
.clip-indicator:hover {
    background: linear-gradient(
        to right,
        rgba(100, 100, 120, 0.25) 0%,
        transparent 100%
    );
}

.clip-indicator-right:hover {
    background: linear-gradient(
        to left,
        rgba(100, 100, 120, 0.25) 0%,
        transparent 100%
    );
}

/* Light mode: the REAL clip-fade indicators are these child divs (not the dead
   ::before/::after). Fade to the light canvas (#c2ccd9 = 194,204,217) instead of dark navy. */
html.theme-light .clip-indicator-left {
    background: linear-gradient(
        to right,
        rgba(194, 204, 217, 0.95) 0%,
        rgba(194, 204, 217, 0.7) 35%,
        rgba(194, 204, 217, 0.3) 65%,
        transparent 100%
    ) !important;
}
html.theme-light .clip-indicator-right {
    background: linear-gradient(
        to left,
        rgba(194, 204, 217, 0.95) 0%,
        rgba(194, 204, 217, 0.7) 35%,
        rgba(194, 204, 217, 0.3) 65%,
        transparent 100%
    ) !important;
}
html.theme-light .clip-indicator:hover {
    background: linear-gradient(to right, rgba(120, 130, 145, 0.25) 0%, transparent 100%) !important;
}
html.theme-light .clip-indicator-right:hover {
    background: linear-gradient(to left, rgba(120, 130, 145, 0.25) 0%, transparent 100%) !important;
}

/* ========================================
   BAND MODE INDICATOR - S/E/C Button
   Keyboard key style for layout mode toggle
   ======================================== */


.band-mode-indicator:hover {
    background: linear-gradient(to bottom, rgba(100, 100, 110, 0.95) 0%, rgba(70, 70, 80, 0.95) 100%);
    border-color: rgba(158, 189, 190, 0.9);
    transform: translateY(-3px) translateX(-7px);
}

/* ========================================
   TIMESYNC NAV -- Home button + purple settings toggle
   Applied via styles.css so all timeline pages inherit.
   ======================================== */

/* HOME button -- links back to parent site (Hot Blocks, etc.) */
.ts-home-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}
.ts-home-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    color: #fff;
}

/* SETTINGS EXPANDER -- purple to visually tie to the settings panel */
.master-collapse-toggle {
    background: #6b21a8 !important;           /* distinct purple */
    border: 1px solid #9333ea !important;
    border-radius: 4px;
    color: #fff !important;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    width: auto;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    cursor: pointer;
    margin-left: 6px;    /* sits right of the TimeSync title */
    margin-right: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}
.master-collapse-toggle:hover {
    background: #7c3aed !important;
    border-color: #a855f7 !important;
}

/* SETTINGS PANEL -- matching purple background */
#settings-panel {
    background: rgba(61, 26, 92, 0.95) !important;    /* dark desaturated plum */
    border-top: 2px solid #9333ea !important;
}

/* ── CONTEXT TOGGLE BUTTON ───────────────────────────────────────────────── */
.ts-context-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    height: 24px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 4px;
    border: 1px solid rgba(100, 220, 130, 0.35);
    background: rgba(100, 220, 130, 0.07);
    color: rgba(100, 220, 130, 0.65);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    user-select: none;
}
.ts-context-label:hover {
    background: rgba(100, 220, 130, 0.16);
    border-color: rgba(100, 220, 130, 0.65);
    color: rgba(100, 220, 130, 0.95);
}
.ts-context-label.active {
    background: rgba(100, 220, 130, 0.2);
    border-color: #64dc82;
    color: #64dc82;
    box-shadow: 0 0 7px rgba(100, 220, 130, 0.28);
}
.ts-context-label .ctx-icon { font-style: normal; }
#ts-context-btn { /* the checkbox input — custom styled, native appearance suppressed */
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border: 1.5px solid rgba(100, 220, 130, 0.55);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    vertical-align: middle;
}
#ts-context-btn:checked {
    background: #64dc82;
    border-color: #64dc82;
}
#ts-context-btn:checked::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -1px;
    width: 5px;
    height: 8px;
    border: 2px solid #111;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
html.theme-light .ts-context-label {
    border-color: rgba(30, 130, 60, 0.35);
    background: rgba(30, 130, 60, 0.07);
    color: rgba(30, 130, 60, 0.7);
}
html.theme-light .ts-context-label:hover {
    background: rgba(30, 130, 60, 0.14);
    border-color: rgba(30, 130, 60, 0.65);
    color: rgba(30, 130, 60, 0.95);
}
html.theme-light .ts-context-label.active {
    background: rgba(30, 130, 60, 0.16);
    border-color: #1e823c;
    color: #1e823c;
}
html.theme-light #ts-context-btn {
    border-color: rgba(30, 130, 60, 0.55);
}
html.theme-light #ts-context-btn:checked {
    background: #1e823c;
    border-color: #1e823c;
}
html.theme-light #ts-context-btn:checked::after {
    border-color: #fff;
}

/* ── LAYOUT CYCLE BUTTON ─────────────────────────────────────────────────── */
.ts-layout-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    min-width: 80px;
    height: 24px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    justify-content: center;
    /* default / stacked state colours */
    border: 1px solid rgba(120, 180, 255, 0.4);
    background: rgba(120, 180, 255, 0.08);
    color: rgba(140, 195, 255, 0.75);
}
.ts-layout-btn:hover {
    background: rgba(120, 180, 255, 0.18);
    border-color: rgba(140, 195, 255, 0.7);
    color: rgba(180, 220, 255, 0.95);
}
/* EXTENDED state — warm amber tint */
.ts-layout-btn.layout-extended {
    border-color: rgba(255, 195, 80, 0.45);
    background: rgba(255, 195, 80, 0.08);
    color: rgba(255, 210, 110, 0.8);
}
.ts-layout-btn.layout-extended:hover {
    background: rgba(255, 195, 80, 0.18);
    border-color: rgba(255, 210, 110, 0.75);
    color: rgba(255, 225, 140, 0.95);
}
/* CONDENSED state — muted rose tint */
.ts-layout-btn.layout-condensed {
    border-color: rgba(220, 130, 180, 0.4);
    background: rgba(220, 130, 180, 0.07);
    color: rgba(230, 155, 200, 0.75);
}
.ts-layout-btn.layout-condensed:hover {
    background: rgba(220, 130, 180, 0.17);
    border-color: rgba(235, 160, 210, 0.7);
    color: rgba(245, 185, 220, 0.95);
}
/* Light mode overrides */
html.theme-light .ts-layout-btn {
    border-color: rgba(50, 100, 200, 0.35);
    background: rgba(50, 100, 200, 0.06);
    color: rgba(40, 90, 180, 0.8);
}
html.theme-light .ts-layout-btn.layout-extended {
    border-color: rgba(180, 120, 0, 0.4);
    background: rgba(180, 120, 0, 0.07);
    color: rgba(160, 100, 0, 0.85);
}
html.theme-light .ts-layout-btn.layout-condensed {
    border-color: rgba(180, 60, 120, 0.35);
    background: rgba(180, 60, 120, 0.06);
    color: rgba(160, 40, 100, 0.8);
}
/* STANDARD state — soft green tint */
.ts-layout-btn.layout-standard {
    border-color: rgba(100, 220, 160, 0.45);
    background: rgba(100, 220, 160, 0.08);
    color: rgba(120, 230, 175, 0.8);
}
.ts-layout-btn.layout-standard:hover {
    background: rgba(100, 220, 160, 0.18);
    border-color: rgba(130, 235, 185, 0.75);
    color: rgba(160, 245, 200, 0.95);
}
html.theme-light .ts-layout-btn.layout-standard {
    border-color: rgba(0, 140, 80, 0.4);
    background: rgba(0, 140, 80, 0.07);
    color: rgba(0, 120, 65, 0.85);
}
/* Default/suggested mode indicator — extra thick border, no size change */
.ts-layout-btn.layout-is-default {
    border-width: 4px !important;
    border-style: solid !important;
    font-weight: 900 !important;
    letter-spacing: 0.07em;
}
html.theme-light .ts-layout-btn.layout-is-default {
    border-width: 4px !important;
    border-style: solid !important;
    font-weight: 900 !important;
    letter-spacing: 0.07em;
}

/* ── BAND CYCLE BUTTON ───────────────────────────────────────────────────── */
.ts-band-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    min-width: 88px;
    height: 24px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    /* default / CAT+GRP state — violet tint */
    border: 1px solid rgba(180, 130, 255, 0.4);
    background: rgba(180, 130, 255, 0.08);
    color: rgba(200, 160, 255, 0.8);
}
.ts-band-btn:hover {
    background: rgba(180, 130, 255, 0.18);
    border-color: rgba(200, 160, 255, 0.7);
    color: rgba(220, 185, 255, 0.95);
}
/* BY GROUP state — teal */
.ts-band-btn.band-group {
    border-color: rgba(80, 210, 200, 0.4);
    background: rgba(80, 210, 200, 0.08);
    color: rgba(100, 225, 215, 0.8);
}
.ts-band-btn.band-group:hover {
    background: rgba(80, 210, 200, 0.18);
    border-color: rgba(100, 225, 215, 0.7);
    color: rgba(140, 240, 230, 0.95);
}
/* BY CATEGORY state — orange */
.ts-band-btn.band-category {
    border-color: rgba(255, 160, 60, 0.4);
    background: rgba(255, 160, 60, 0.08);
    color: rgba(255, 180, 90, 0.8);
}
.ts-band-btn.band-category:hover {
    background: rgba(255, 160, 60, 0.18);
    border-color: rgba(255, 185, 100, 0.7);
    color: rgba(255, 205, 130, 0.95);
}
/* Light mode */
html.theme-light .ts-band-btn {
    border-color: rgba(120, 60, 200, 0.35);
    background: rgba(120, 60, 200, 0.06);
    color: rgba(100, 40, 180, 0.8);
}
html.theme-light .ts-band-btn.band-group {
    border-color: rgba(0, 150, 140, 0.4);
    background: rgba(0, 150, 140, 0.06);
    color: rgba(0, 130, 120, 0.85);
}
html.theme-light .ts-band-btn.band-category {
    border-color: rgba(200, 100, 0, 0.4);
    background: rgba(200, 100, 0, 0.06);
    color: rgba(180, 85, 0, 0.85);
}

/* Default/suggested band mode indicator — matches layout-is-default treatment */
.ts-band-btn.band-is-default {
    border-width: 4px !important;
    border-style: solid !important;
    font-weight: 900 !important;
    letter-spacing: 0.07em;
}
html.theme-light .ts-band-btn.band-is-default {
    border-width: 4px !important;
    border-style: solid !important;
    font-weight: 900 !important;
    letter-spacing: 0.07em;
}

/* ── DARK / LIGHT MODE TOGGLE BUTTON ────────────────────────────────────── */
.ts-theme-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: rgba(255,255,255,0.65);
    font-size: 1.0rem;
    line-height: 1;
    height: 24px;
    width: 26px;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.ts-theme-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.08);
}
/* Light mode: invert to dark tones */
html.theme-light .ts-theme-btn {
    border-color: rgba(0,0,0,0.2);
    color: rgba(30,30,30,0.75);
}
html.theme-light .ts-theme-btn:hover {
    border-color: rgba(0,0,0,0.45);
    color: #111;
    background: rgba(0,0,0,0.06);
}

/* ── SUB-PANEL OPEN STATE: tint the whole block, no inner border box ──────── */
.control-block {
    border-radius: 4px;
    transition: background-color 0.15s ease;
}
/* Light tint on any expanded block — replaces the inner border boxes */
.control-block:has(.filter-toggles-content),
.control-block:has(.item-cap-controls),
.control-block:has(.data-sources-content),
.control-block:has(.zoom-level-content),
.control-block:has(.year-range-filter),
.control-block:has(.feature-focus-content) {
    background-color: rgba(255,255,255,0.03);
    padding: 2px 4px 3px 2px;
}

/* ── Per-band collapse toggle button (+/−) ───────────────────────── */
.band-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    border-radius: 3px;
    border: none;
    opacity: 0.85;
    cursor: pointer;
    pointer-events: all;
    margin-right: 9px;
    flex-shrink: 0;
    transition: opacity 0.15s, background 0.15s;
    background: rgba(255,255,255,0.1);
    vertical-align: middle;
    user-select: none;
    /* Dark mode: white glow makes −  legible against dark timeline */
    text-shadow: 0 0 4px rgba(255,255,255,0.6), 0 1px 2px rgba(255,255,255,0.3);
}
html.theme-light .band-collapse-btn {
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.12);
}
.band-collapse-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.22);
}
html.theme-light .band-collapse-btn:hover {
    background: rgba(0,0,0,0.2);
}
/* Closed (+): much stronger background to signal the band is rolled up */
.band-collapse-btn.is-collapsed {
    opacity: 1;
    background: rgba(255,255,255,0.45);
    color: #111;
    text-shadow: none;
}
html.theme-light .band-collapse-btn.is-collapsed {
    background: rgba(0,0,0,0.55);
    color: #fff;
    text-shadow: none;
}


/* --- Focus-images roll Play/Pause toggle (added 2026-06-23) --------------- */
#focus-roll-toggle {
    display: block;
    margin: 6px auto 0;
    padding: 2px 12px;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.40);
    border-radius: 10px;
    cursor: pointer;
}
#focus-roll-toggle:hover {
    background: rgba(0, 0, 0, 0.65);
}
#focus-roll-toggle[aria-pressed="true"] {
    background: rgba(140, 0, 0, 0.60);  /* rolling = active */
}


/* ===== FLAVOR PANEL (draft 1) -- docked under the top bar; click the panel to cycle size ===== */
/* Sits as the last child of #sticky-controls-wrapper so it stays attached while scrolling. */
#flavor-panel {
    /* OVERLAY: anchored to the fixed header, floats OVER the timeline -- takes no layout space */
    position: absolute;
    top: 100%;               /* directly below the top bar */
    right: 0;                /* snug against the right edge of the browser */
    height: 0;
    /* width is set by JS to match the front image's aspect; it tweens under the crossfade */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.75);   /* more opaque now that timeline shows behind it */
    box-shadow: -3px 3px 10px rgba(0, 0, 0, 0.45);
    transition: height 0.25s ease, width 0.6s ease;
}
/* FULL is the reference size; TINY and HALF-SIZE are percentages of it */
/* Width caps (the bounding box): wide/landscape images are contained and letterboxed
   instead of sprawling across the screen. One knob per size -- tweak freely. */
#flavor-panel {
    --flavor-full-height: 45vh;
    --flavor-w-tiny: 15vw;
    --flavor-w-half: 30vw;
    --flavor-w-full: 40vw;
}
#flavor-panel[data-size="tiny"] { max-width: var(--flavor-w-tiny); }
#flavor-panel[data-size="half"] { max-width: var(--flavor-w-half); }
#flavor-panel[data-size="full"] { max-width: var(--flavor-w-full); }
#flavor-panel[data-size="tiny"] { height: calc(var(--flavor-full-height) * 0.15); }  /* TINY = ~15% */
#flavor-panel[data-size="half"] { height: calc(var(--flavor-full-height) * 0.63); }  /* HALF-SIZE = ~63% */
#flavor-panel[data-size="full"] { height: var(--flavor-full-height); }               /* FULL */
#flavor-panel[data-size="tiny"], #flavor-panel[data-size="half"], #flavor-panel[data-size="full"] {
    min-width: 60px;         /* keeps a visible box until the image loads */
    border: 1px solid rgba(125, 200, 255, 0.55);
    border-top: none;
    border-right: none;      /* flush against the browser edge */
}
/* Two stacked crossfade layers -- they dissolve A<->B (opacity), no fade-to-black */
#flavor-panel .flavor-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
#flavor-panel-label {
    position: absolute;
    top: 2px; left: 2px;     /* tucked into the corner */
    opacity: 0.6;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 8px;
    border-radius: 3px;
    pointer-events: none;
}
html.theme-light #flavor-panel { background: rgba(255, 255, 255, 0.5); border-top-color: rgba(0, 0, 0, 0.15); }

/* ===== STACK VIEW PANEL / 1551 BROADWAY VIEW PANEL (removed here 2026-09-11) =====
   Both panels' styling now ships as part of ts-signage-panels.js itself -- the standalone
   module DiLo asked for ("pull out the entire stack building, and 1551 building portion... so
   it would be a fully standalone app that could be called from any html page"). The module
   injects an equivalent <style id="ts-signage-panels-style"> block at runtime (same selectors:
   #stack-view-panel, .stack-view-band, .stack-view-halo-overlay, .stack-view-land-overlay,
   #broadway1551-view-panel and its band/land equivalents, etc.), so this page needs no CSS of
   its own for either panel any more -- one source of truth instead of two copies that could
   drift apart. Positioning (the one piece the module deliberately leaves to the caller, since
   it depends on where a host page mounts it) is set inline by this page's own bootstrap script
   at the bottom of timeline_hot_times_simp.html, replicating the exact placement these rules
   used to define: the Stack panel at position:absolute; top:100%; left:30px inside
   #sticky-controls-wrapper, and the 1551 Broadway panel at position:fixed; bottom:20px;
   left:20px; z-index:var(--z-sticky-header) anchored to the screen corner. */

/* DiLo (2026-09-08): the old FLAVOR/STACK size-cycle buttons (.ts-flavor-btn / .ts-stack-btn) are
   gone -- each panel window now cycles its own size when clicked. In their place: a very small
   on/off button per window (#ts-flavor-visibility-btn, #ts-stack-visibility-btn) that just shows
   or hides it. data-on="false" dims the button so its state reads at a glance. */
.ts-visibility-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    min-width: 34px;
    height: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
    background: rgba(0, 0, 0, 0.65);
    color: #8fd2ff;   /* light blue */
    border: 1px solid rgba(125, 200, 255, 0.55);
}
.ts-visibility-btn:hover { background: rgba(125, 200, 255, 0.2); }
.ts-visibility-btn[data-on="false"] { opacity: 0.4; }
html.theme-light .ts-visibility-btn { background: rgba(255, 255, 255, 0.7); color: #1565a0; border-color: #1565a0; }


/* ===== Feature Focus: per-slot focus-logic numeral + Special Imagery legend (2026-07-16) ===== */
/* Roman numeral under each focus slot = which focus TYPE (strategy) that slot is running */
#Feature_SlotTypes {
    /* Mirror #Feature_Container exactly so each numeral centers under its slot */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    gap: 15px;                            /* MUST match #Feature_Container gap or outer numerals drift inward */
    margin: 0 auto 2px;
}
#Feature_SlotTypes > div {
    width: 240px;                         /* match image slot width */
    max-width: 30%;                       /* match #Feature_Container img max-width */
    text-align: center;                   /* numeral centered within its slot cell */
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ff7ac6;                       /* pink, matches the markup */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    cursor: default;
}
/* Special Imagery ON/OFF legend -- green = TRUE (in pool), red = FALSE (excluded) */
.special-images-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 12px;
    margin: 3px 0 2px 22px;              /* indent under the checkbox */
    font-family: monospace;
    font-size: 11px;
}
.special-images-legend .on  { color: #37d67a; }   /* enabled  */
.special-images-legend .off { color: #f0506e; }   /* disabled */
.special-images-legend.muted { opacity: 0.4; }     /* master switch OFF */
