/*
 * Radial Timeline (tm) Plugin for Obsidian
 * Copyright (c) 2025 Eric Rhys Taylor
 * Licensed under a Source-Available, Non-Commercial License. See LICENSE file for details.
 */
 
/* Main color variables for the radial timeline */
:root {
  /* Publish Stage Colors */
  --rt-color-zero:   #9E70CF;    /* Purple */
  --rt-color-author: #5E85CF;    /* Blue   */
  --rt-color-house:  #DA7847;    /* Orange */
  --rt-color-press:  #6FB971;    /* Green  */

  /* Runtime colours – the plugin overwrites these on load */
  --rt-publishStageColors-Zero:   var(--rt-color-zero);
  --rt-publishStageColors-Author: var(--rt-color-author);
  --rt-publishStageColors-House:  var(--rt-color-house);
  --rt-publishStageColors-Press:  var(--rt-color-press);
  /* most-common stage (used for ACT labels &c.) */
  --rt-max-publish-stage-color: var(--rt-publishStageColors-Zero);

  /* Status Colors */
  --rt-color-due: #d05e5e;      /* Red */
  --rt-color-empty: #ffffff;    /* becomes gray when transparent added */
  --rt-color-empty-selected: #EFEFEF; /* Slightly darker gray for selected empty cells */
  
  /* Search and UI Colors */
  --rt-color-search: #ffe374;   /* Yellow for search highlighting */
  --rt-color-debug: #ff3300;    /* Red for debug text */
  /* Search highlight tuning */
  --rt-search-stroke-width: 0.2em;      /* default stroke thickness for search outline */
  --rt-search-stroke-opacity: 0.7;      /* default stroke opacity for search outline */
  
  /* Plaid Colors and Opacity */
  --rt-color-working: #FF69B4;          /* Match pink color for Working in Manuscript Calendar */
  --rt-color-todo: #cccccc;             /* Light Gray */
  --rt-color-plaid-opacity: 1;
  --rt-color-plaid-stroke-opacity: 1;
    /* Current Stage Color stroke for working pattern set in SVG patterns*/
    /* Current Stage Color stroke for todo pattern set in SVG patterns*/
  
  /* Estimation Colors */
  --rt-color-estimation: #ff0000; /* Red not using this right now. defs at bottom of file*/

  /* Settings UI sizing */
  --rt-settings-select-width: 240px; /* consistent width for dropdowns */

  /* Subplot palette - 16 fixed colors provided */
  --rt-subplot-colors-0: #EFBDEB;
  --rt-subplot-colors-1: #a35ca7;
  --rt-subplot-colors-2: #6461A0;
  --rt-subplot-colors-3: #314CB6;
  --rt-subplot-colors-4: #0A81D1;
  --rt-subplot-colors-5: #98CE00;
  --rt-subplot-colors-6: #16E0BD;
  --rt-subplot-colors-7: #78C3FB;
  --rt-subplot-colors-8: #273C2C;
  --rt-subplot-colors-9: #A6D8D4;
  --rt-subplot-colors-10: #FF8600;
  --rt-subplot-colors-11: #F9E784;
  --rt-subplot-colors-12: #CEC3C1;
  --rt-subplot-colors-13: #F3D34A;
  --rt-subplot-colors-14: #004777;
  --rt-subplot-colors-15: #8B4513; /* Ring 16 default (Brown) */
}

/* ADD stage-specific fill rules for title text – keep close to highlight-rect definitions so colours are defined in one place */
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main.rt-title-stage-zero   { fill: var(--rt-publishStageColors-Zero,   var(--rt-color-zero)) !important; }
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main.rt-title-stage-author { fill: var(--rt-publishStageColors-Author, var(--rt-color-author)) !important; }
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main.rt-title-stage-house  { fill: var(--rt-publishStageColors-House,  var(--rt-color-house)) !important; }
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main.rt-title-stage-press  { fill: var(--rt-publishStageColors-Press,  var(--rt-color-press)) !important; }

/* styles.css */
.radial-timeline-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  background-color: transparent;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.rt-loading-message,
.rt-error-message {
  padding: 20px;
  text-align: center;
  font-size: 1.2em;
  color: var(--text-error);
}
.radial-timeline-container svg {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0 auto;
  padding: 0;
  transform-origin: center;
  object-fit: contain;
  cursor: default;
  background-color: transparent;
  fill: none;
}

/* Measurement text node used only for width measurement; keep off-layout and invisible */
.rt-measure-text {
  font-family: var(--rt-measurement-font-family, sans-serif);
  font-size: var(--rt-measurement-font-size, 18px);
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

/* Debug: visualize the SVG viewport box */

.radial-timeline-container .rt-scene-path {
  cursor: pointer;
  stroke: #ffffff;
  stroke-width: 1px;
}
.radial-timeline-container .rt-scene-act {
  fill-opacity: 0;
}
.radial-timeline-container .rt-scene-act:hover {
  fill-opacity: 0.3;
  cursor: pointer;
}
/* Void cells - empty space in timeline */
.radial-timeline-container .rt-void-cell {
  fill: var(--rt-color-empty);
  fill-opacity: 0.9;
  stroke: white;
  stroke-width: 1;
  cursor: default;
}
.radial-timeline-container .rt-scene-path.rt-faded {
  opacity: 0.3;
}
.radial-timeline-container .rt-scene-path.rt-non-selected {
  fill: var(--rt-color-empty-selected) !important;
}
.radial-timeline-container .rt-scene-path.rt-scene-is-open.rt-non-selected {
  fill: var(--rt-color-empty-selected) !important;
}
.radial-timeline-container .rt-scene-path.rt-selected {
  filter: saturate(1.2) brightness(1.1);
}
.radial-timeline-container .rt-scene-title {
  cursor: pointer;
  fill: white;
  opacity: 1;
  font-size: 18px;
  pointer-events: none;
}
.radial-timeline-container .rt-plot-title {
  fill: var(--text-normal);
  font-size:12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}


/* Hover: emphasize plot titles with a solid black background using stroke */
.radial-timeline-container .rt-scene-group:hover .rt-plot-title,
.rt-scene-group.rt-gossamer-hover .rt-plot-title,
.radial-timeline-svg[data-gossamer-mode="true"] .rt-scene-group[data-item-type="Plot"]:hover .rt-plot-title {
  filter: url(#plotTextBg); /* black background halo */
  fill: #ffffff !important;
  font-weight: 700; /* heavier for readability */
}

/* Rotation toggle base styles (timeline only; no animations) */
.radial-timeline-svg #rotation-toggle use {
  color: inherit;
  stroke: currentColor;
  fill: none;
}

.radial-timeline-svg #rotation-toggle:hover use {
  /* Make arrow white on hover via currentColor (symbols use stroke=currentColor) */
  color: #ffffff !important;
  stroke: #ffffff !important;
  fill: none !important;
}
.radial-timeline-svg #rotation-toggle .arrow-icon.is-hidden { display: none; }
.radial-timeline-svg #rotation-toggle { cursor: pointer; }

/* Hide rotation toggle in Gossamer mode */
.radial-timeline-svg[data-gossamer-mode="true"] #rotation-toggle {
  display: none;
}

/* Gossamer momentum styling */
.rt-gossamer-layer { pointer-events: none; }
.rt-gossamer-line { stroke: var(--rt-gossamer-stroke, #7a7a7a); stroke-width: 3; fill: none; }
/* Phase 2: dots (10px diameter) */
.rt-gossamer-dot { 
  fill: var(--rt-gossamer-stroke, #7a7a7a); 
  r: 6px; /* 10px diameter */
  pointer-events: all; 
  cursor: pointer; 
  stroke: none;
}
.rt-gossamer-dot:hover,
.rt-gossamer-dot.rt-hover { 
  fill: var(--rt-gossamer-stroke, #7a7a7a);
  stroke: white;
  stroke-width: 2px;
}
.rt-gossamer-line.rt-gossamer-overlay { stroke-dasharray: 6,4; opacity: 0.6; }
.rt-gossamer-band { fill: var(--rt-gossamer-stroke, #7a7a7a); opacity: 0.12; stroke: none; }
.rt-gossamer-spoke { 
  stroke: #b0b0b0; /* Light gray for beat spokes */
  stroke-width: 1px; 
  stroke-dasharray: none;
}
.rt-gossamer-spoke.rt-gossamer-spoke-hover {
  stroke: white; /* Turn white on dot hover */
  stroke-width: 2px;
}
.rt-gossamer-grid-spoke {
  stroke: #d0d0d0 !important; /* Even lighter gray for month/act grid spokes - override theme colors */
  stroke-width: 0.5px !important;
  stroke-dasharray: none !important;
  opacity: 0.3 !important;
}

/* Plot slice hover styling - path turns white on hover or Gossamer sync */
.rt-scene-group.rt-gossamer-hover .rt-scene-path,
.radial-timeline-svg[data-gossamer-mode="true"] .rt-scene-group[data-item-type="Plot"]:hover .rt-scene-path {
  fill: #ffffff !important;
  opacity: 1 !important;
}
.radial-timeline-container .rt-scene-title.rt-faded {
  opacity: 0.2;
}
.radial-timeline-container .rt-scene-info {
  opacity: 0;
  pointer-events: none !important;
  z-index: 100;
  vector-effect: non-scaling-stroke;
}
.radial-timeline-container .rt-scene-info text {
  stroke: white;
  stroke-width: 3px;
  paint-order: stroke;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.radial-timeline-container .rt-month-label,
.radial-timeline-container .rt-month-label-outer,
.radial-timeline-container .rt-act-label {
  pointer-events: none;
}
.radial-timeline-container .rt-month-label {  
  font-size: 16px;
  fill: var(--text-normal);
  text-anchor: middle;
  dominant-baseline: middle;
}
.radial-timeline-container .rt-month-label-outer {
font-size: 18px;
fill: var(--text-normal);
text-anchor: middle;
dominant-baseline: middle;
}
.radial-timeline-container .rt-act-label {
  font-size: 20px;
  font-weight: 900;
  /* fill: var(--text-normal); */ /* Color is now set dynamically in SVG */
  text-anchor: middle;
  dominant-baseline: middle;
}
.radial-timeline-container .rt-month-spoke-line {
  stroke: var(--text-normal);
  stroke-width: 1px;
  stroke-dasharray: 2, 2;
  opacity: 1;
}
.radial-timeline-container .rt-month-spoke-line.rt-act-boundary {
  stroke: var(--text-normal);
  stroke-width: 2px;
  stroke-dasharray: none;
  opacity: 1;
}
.radial-timeline-container .rt-scene-title-small {
  font-size: 9px;
}
.radial-timeline-container .rt-scene-title-medium {
  font-size: 16px;
}
.radial-timeline-container .rt-scene-title-large {
  font-size: 18px;
}
.rt-status-count {
  font-size: 80%;
  opacity: 1;
  vertical-align: super;
  position: relative;
  top: -0.7em;
  font-weight: normal;
  line-height: 0;
  dominant-baseline: inherit;
}
.settings-separator {
  margin: 1em 0 2em 0;
  border: none;
  border-top: 1px solid var(--background-modifier-border);
}
.documentation-container {
  padding: 0 1em;
}
.documentation-container h1 {
  font-size: 1.8em;
  margin-top: 0.5em;
}
.documentation-container h2 {
  font-size: 1.5em;
  margin-top: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--background-modifier-border);
}
.documentation-container h3 {
  font-size: 1.2em;
  margin-top: 1em;
}
.documentation-container img {
  max-width: 100%;
  border-radius: 5px;
  margin: 1em 0;
}
.documentation-container code {
  background-color: var(--background-primary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}
.documentation-container pre {
  background-color: var(--background-primary);
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1em 0;
}
.metadata-example {
  line-height: 2em;
  white-space: pre;
  user-select: all;
  cursor: text;
  background-color: var(--background-secondary);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

.radial-timeline-container .rt-subplot-text {
  font-size: 16px;
  fill: var(--text-muted, #555555);
  font-weight: normal;
  
}
.radial-timeline-container .scene-hover .rt-subplot-text,
.radial-timeline-container .rt-scene-group:hover .rt-subplot-text { 
  fill: #ffffff; 
}

.radial-timeline-container .rt-number-square{
  pointer-events: none;
  fill: #FFFFFF;
}

.radial-timeline-container .rt-number-text {
  fill: #000000;
  pointer-events: none;
}
/* AI grade text colors - scoped to plugin (no !important so non-selected can override) */
.radial-timeline-container .rt-number-text.rt-grade-A { fill: #00ff48; }
.radial-timeline-container .rt-number-text.rt-grade-B { fill: #ffbb00; }
.radial-timeline-container .rt-number-text.rt-grade-C { fill: #ff0000; }
/* Preserve grade colors when scene is open (higher specificity overrides white fill below) */
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-grade-A { fill: #00ff48; }
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-grade-B { fill: #ffbb00; }
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-grade-C { fill: #ff0000; }
.radial-timeline-container .rt-number-square.rt-faded,
.radial-timeline-container .rt-number-text.rt-faded {
  opacity: 1;
}
.radial-timeline-container .rt-scene-title.rt-selected {
  stroke: #000000;
  stroke-width: 3px;
  paint-order: stroke;
}
/* Dynamic classes for scene-is-open non-selected */
.radial-timeline-container .rt-number-square.rt-scene-is-open.rt-non-selected {
  fill: #EFEFEF !important;
  stroke: none;
  stroke-width: 0;
}
/* Dynamic classes for scene-is-open non-selected text */
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-non-selected {
  fill: #FFFFFF !important;
  opacity: 1;
}
.radial-timeline-container .rt-number-square.rt-selected {
  transform: scale(1.2);
  z-index: 10;
  stroke-width: 3px;
  stroke: var(--scene-color, #705DCF);
}
/* Removed duplicate - already defined above as .rt-number-square.rt-selected */
.radial-timeline-container .rt-number-square.rt-non-selected {
  fill: #EFEFEF;
  stroke: none;
  stroke-width: 0;
}
.radial-timeline-container .rt-number-text.rt-selected {
  font-weight: bold;
}
.radial-timeline-container .rt-number-text.rt-non-selected {
  fill: #FFFFFF;
}
.rt-search-term {
  fill: inherit;
  stroke: var(--rt-color-search);
  stroke-width: var(--rt-search-stroke-width, 0.2em);
  stroke-opacity: var(--rt-search-stroke-opacity, 0.3);
  paint-order: stroke;
}

/* Using only .rt-search-term for highlight styling; legacy .search-term rules removed */


/* Allow inline subplot/character colors to apply in synopsis */
.rt-info-text.rt-metadata-text tspan[data-item-type=subplot],
.rt-info-text.rt-metadata-text tspan[data-item-type=character] {
  fill: var(--rt-dynamic-color, var(--text-normal)) !important;
  stroke: white;
  stroke-width: 0.07em;
  paint-order: stroke;
}

tspan[fill] .search-term,
tspan[fill].search-term,
tspan .search-term {
  fill: inherit !important;
}
/* Old quadrant-specific text-anchor rules - replaced with scoped rt- versions below */

/* Command palette search modal styling */
.radial-timeline-container .search-container.flex-container {
  display: flex;
  gap: 8px;
  align-items: center;
}
.radial-timeline-container .search-input {
  width: 600px;
  max-width: 90vw;
}
.radial-timeline-search .rt-button-container {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}
/* Quadrant rules consolidated with rt- prefixes below */
.radial-timeline-container .rt-scene-info.rt-synopsis-q1 text,
.radial-timeline-container .rt-scene-info.rt-synopsis-q4 text {
  text-anchor: end !important;
  padding: 0 !important;
  margin: 0 !important;
}
.radial-timeline-container .rt-scene-info.rt-synopsis-q2 text,
.radial-timeline-container .rt-scene-info.rt-synopsis-q3 text {
  text-anchor: start !important;
  padding: 0 !important;
  margin: 0 !important;
}
.radial-timeline-container .rt-scene-info.rt-visible {
  opacity: 1 !important;
  pointer-events: all !important;
  visibility: visible !important;
  display: block !important;
}
.radial-timeline-container .rt-synopsis-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  /* Fill will be set by stage-specific classes (rt-title-stage-*) */
}
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main tspan.rt-date-text {
  font-weight: 700 !important;
  font-size: 18px !important;
  fill: var(--text-muted) !important;
  stroke: white !important;
  stroke-width: 2.5px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  vertical-align: super !important;
  baseline-shift: .3em !important;
  paint-order: stroke !important;
}

/* Ensure search highlighting inside date text maintains date styling */
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-main tspan.rt-date-text tspan.rt-search-term {
  font-weight: 700 !important;
  font-size: inherit !important;
  fill: var(--text-muted) !important;
  stroke: var(--rt-color-search) !important;
  stroke-width: var(--rt-search-stroke-width, 0.2em) !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
  paint-order: stroke !important;
}
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-title-text-secondary {
  font-size: 18px;
  fill: #666666;
  text-transform: uppercase;
  font-weight: normal;
}
.radial-timeline-container .rt-scene-info text.rt-info-text.rt-metadata-text {
  font-size: 18px;
  font-weight: normal;
  text-transform: none;
}

/* Overdue text styling */
.radial-timeline-container .rt-scene-info text.rt-overdue-text {
  fill: var(--rt-color-due) !important;
}

/* Revisions/Pending edits text styling */
.radial-timeline-container .rt-scene-info text.rt-revisions-text {
  fill: #C0C0C0 !important;
}

/* Search highlight parent tspan with dynamic fill */
.rt-scene-info tspan.rt-with-dynamic-fill {
  fill: var(--rt-dynamic-fill-color, inherit) !important;
}
.rt-number-square.rt-scene-is-open {
  fill: var(--interactive-accent, #705DCF);
  stroke: none;
}
.radial-timeline-container .rt-number-text.rt-scene-is-open {
  font-weight: normal;
  fill: #FFFFFF; /* white for default case; grade colors override via higher specificity */
}
.rt-number-square.rt-scene-is-open.rt-non-selected {
  fill: #EFEFEF;
  stroke: none;
  stroke-width: 0;
  
}
.rt-number-text.rt-scene-is-open.rt-non-selected {
  fill: #ffffff;
  opacity: 1;
}
.rt-number-square.rt-scene-is-open.rt-selected {
  stroke: #705DCF;
  stroke-width: 3px;
  fill: #FFFFFF;
}
.rt-number-text.rt-scene-is-open.rt-selected {
  fill: #000000; /* black for default case; grade colors override via higher specificity */
  font-weight: bold;
}
/* Preserve grade colors when scene is open and selected */
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-selected.rt-grade-A { fill: #00ff48; }
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-selected.rt-grade-B { fill: #ffbb00; }
.radial-timeline-container .rt-number-text.rt-scene-is-open.rt-selected.rt-grade-C { fill: #ff0000; }
.radial-timeline-container .rt-number-square.rt-search-result { fill: var(--rt-color-search) !important; }
.radial-timeline-container .rt-number-text.rt-search-result.rt-non-selected {
  fill: #FFFFFF !important;
}
.rt-number-text.rt-scene-is-open.rt-search-result.rt-non-selected {
  fill: #FFFFFF !important;
}
.rt-number-text.rt-scene-is-open.rt-search-result {
  fill: #000000 !important;
}
.radial-timeline-container .rt-number-square.rt-search-result.rt-non-selected {
  fill: #EFEFEF !important;
  stroke: #EFEFEF;
  stroke-width: 2px;
}
.radial-timeline-container .rt-number-square.rt-search-result.rt-selected {
  fill: var(--rt-color-search);
  stroke: #ff9500;
  stroke-width: 2px;
}
.radial-timeline-container .rt-number-square.rt-has-edits {
  fill: #C0C0C0; /* Light gray for pending edits */
}

.radial-timeline-container .rt-number-square.rt-has-edits.rt-search-result { fill: var(--rt-color-search) !important; }
.radial-timeline-container .rt-number-square.rt-has-edits.rt-scene-is-open { fill: #C0C0C0; }
.radial-timeline-container .rt-number-square.rt-has-edits.rt-non-selected {
  fill: #EFEFEF !important;
}
.radial-timeline-container .rt-number-square.rt-has-edits.rt-scene-is-open.rt-non-selected {
  fill: #EFEFEF !important;
}
/* Preserve grade colors for pending edits (higher specificity) */
.radial-timeline-container .rt-number-text.rt-has-edits.rt-grade-A { fill: #00ff48; }
.radial-timeline-container .rt-number-text.rt-has-edits.rt-grade-B { fill: #ffbb00; }
.radial-timeline-container .rt-number-text.rt-has-edits.rt-grade-C { fill: #ff0000; }
.radial-timeline-container .rt-number-text.rt-has-edits.rt-selected,
.radial-timeline-container .rt-number-text.rt-has-edits.rt-search-result.rt-selected { 
  font-weight: bold; 
}
/* Preserve grade colors for pending edits selected state */
.radial-timeline-container .rt-number-text.rt-has-edits.rt-selected.rt-grade-A,
.radial-timeline-container .rt-number-text.rt-has-edits.rt-search-result.rt-selected.rt-grade-A { fill: #00ff48; }
.radial-timeline-container .rt-number-text.rt-has-edits.rt-selected.rt-grade-B,
.radial-timeline-container .rt-number-text.rt-has-edits.rt-search-result.rt-selected.rt-grade-B { fill: #ffbb00; }
.radial-timeline-container .rt-number-text.rt-has-edits.rt-selected.rt-grade-C,
.radial-timeline-container .rt-number-text.rt-has-edits.rt-search-result.rt-selected.rt-grade-C { fill: #ff0000; }

/* AI grade colors turn white when non-selected (covers all states: default, open, pending edits) */
.radial-timeline-container .rt-number-text.rt-non-selected.rt-grade-A,
.radial-timeline-container .rt-number-text.rt-non-selected.rt-grade-B,
.radial-timeline-container .rt-number-text.rt-non-selected.rt-grade-C { fill: #FFFFFF !important; }
.rt-clear-search-btn {
  cursor: pointer;
}
.rt-clear-search-btn:hover {
  transform: scale(1.1);
}

.rt-clear-search-btn:hover circle {
  fill: #FFE5E5;
}

.rt-highlight-rect {
  fill: var(--rt-color-search);
  rx: 3;
  ry: 3;
  opacity: 0.3;
}

.rt-highlight-rect.rt-stage-zero   { fill: var(--rt-publishStageColors-Zero,   var(--rt-color-zero)); }
.rt-highlight-rect.rt-stage-author { fill: var(--rt-publishStageColors-Author, var(--rt-color-author)); }
.rt-highlight-rect.rt-stage-house  { fill: var(--rt-publishStageColors-House,  var(--rt-color-house)); }
.rt-highlight-rect.rt-stage-press  { fill: var(--rt-publishStageColors-Press,  var(--rt-color-press)); }

.rt-color-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.rt-color-picker-container {
  background-color: var(--background-primary);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}
.rt-color-picker-input {
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
}
.rt-color-picker-text-input {
  width: 100%;
  margin-bottom: 5px;
  padding: 5px;
}
.rt-color-picker-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.rt-color-picker-button {
  padding: 5px 15px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.rt-color-picker-button.ok {
  background-color: var(--interactive-accent);
  color: white;
}
.rt-color-picker-button.cancel {
  background-color: var(--background-modifier-error);
  color: white;
}
.rt-color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--swatch-color);
  border: 1px solid var(--background-modifier-border);
  border-radius: 3px;
  margin-left: 8px;
}
/* Compact grid for color settings (publish stages + subplot palette) */
.rt-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
}

/* Settings dropdown width normalization (works within Obsidian's flex layout) */
.setting-item .setting-item-control select.rt-setting-dropdown {
  width: var(--rt-settings-select-width) !important;
  min-width: var(--rt-settings-select-width);
  max-width: var(--rt-settings-select-width);
  flex: 0 0 var(--rt-settings-select-width);
}

/* Dim non-selected provider sections in settings */
.rt-provider-section { transition: opacity 120ms ease; }
.rt-provider-section.dimmed {
  opacity: 0.55;
}
@media (max-width: 1100px) {
  .rt-color-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .rt-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.rt-color-grid-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--background-secondary);
  border: 1px solid var(--background-modifier-border);
  border-radius: 8px;
}
.rt-color-grid-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--background-modifier-border);
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.rt-color-grid-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 2px;
  margin-top: 0;
  justify-content: space-between;
  position: relative;
}
.rt-color-grid-controls input[type="color"] {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--background-modifier-border);
  border-radius: 0; /* crisp square */
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  box-shadow: none;
  outline: none;
}
.rt-color-grid-controls .rt-hidden-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  top: 20px;
  left: 0;
}
.rt-color-grid-controls .rt-swatch-trigger {
  width: 24px;
  height: 24px;
  border: 1px solid var(--background-modifier-border);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Stage swatch backgrounds map to CSS variables that the plugin updates */
.rt-color-grid-controls .rt-swatch-trigger.rt-stage-Zero { background: var(--rt-publishStageColors-Zero); }
.rt-color-grid-controls .rt-swatch-trigger.rt-stage-Author { background: var(--rt-publishStageColors-Author); }
.rt-color-grid-controls .rt-swatch-trigger.rt-stage-House { background: var(--rt-publishStageColors-House); }
.rt-color-grid-controls .rt-swatch-trigger.rt-stage-Press { background: var(--rt-publishStageColors-Press); }

/* Subplot swatches map to subplot color CSS variables */
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-0 { background: var(--rt-subplot-colors-0); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-1 { background: var(--rt-subplot-colors-1); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-2 { background: var(--rt-subplot-colors-2); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-3 { background: var(--rt-subplot-colors-3); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-4 { background: var(--rt-subplot-colors-4); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-5 { background: var(--rt-subplot-colors-5); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-6 { background: var(--rt-subplot-colors-6); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-7 { background: var(--rt-subplot-colors-7); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-8 { background: var(--rt-subplot-colors-8); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-9 { background: var(--rt-subplot-colors-9); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-10 { background: var(--rt-subplot-colors-10); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-11 { background: var(--rt-subplot-colors-11); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-12 { background: var(--rt-subplot-colors-12); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-13 { background: var(--rt-subplot-colors-13); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-14 { background: var(--rt-subplot-colors-14); }
.rt-color-grid-controls .rt-swatch-trigger.rt-subplot-15 { background: var(--rt-subplot-colors-15); }

/* Description under color section headers */
.rt-color-section-desc {
  margin: 6px 0 10px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.rt-color-grid-controls input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.rt-color-grid-controls input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0; /* ensure square inside */
}
.rt-color-grid-controls .rt-hex-input {
  width: 7em; /* fits #RRGGBB with less space */
  border: 1px solid var(--background-modifier-border);
  background: var(--background-primary);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: none;
  outline: none;
  flex-shrink: 1;
  min-width: 5em;
}
/* Focus state for hex input */
.rt-color-grid-controls .rt-hex-input:focus {
  border-color: var(--interactive-accent);
  box-shadow: 0 0 0 2px rgba(100, 180, 255, 0.2);
}

/* Promoted section headings in settings (with bottom border and spacing) */
.rt-section-heading {
  margin-top: 18px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid var(--background-modifier-border) !important;
}
.rt-color-grid-controls .setting-item {
  margin: 0;
  width: 100%;
  display: block;
  padding: 0 !important; /* remove default vertical padding */
  border: none !important; /* remove all borders */
  border-top: none !important; /* specifically remove top border */
  border-bottom: none !important; /* specifically remove bottom border */
  border-left: none !important; /* specifically remove left border */
  border-right: none !important; /* specifically remove right border */
}
/* Also neutralize Obsidian's `.setting-item + .setting-item { border-top: ... }` rule */
.rt-color-grid-controls .setting-item + .setting-item {
  border-top: none !important;
}
.rt-color-grid-controls .setting-item-control {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0 !important;   /* remove default padding */
  margin: 0 !important;    /* remove default margins */
  justify-content: space-between;
}
.rt-debug-info-container {
  pointer-events: none;
}
.debug-info-background {
  fill: rgba(255, 255, 255, 0.8);
  rx: 5px;
  ry: 5px;
  stroke: #333333;
  stroke-width: 1px;
}
.debug-info-text {
  font-size: 20px;
  fill: #ff3300;
  font-weight: bold;
  stroke: white;
  stroke-width: 0.5px;
  paint-order: stroke;
  pointer-events: none;
}

/* Removed legacy .search-term override for synopsis titles; .rt-search-term handles all cases */
.synopsis-spacer {
  line-height: 1.5em;
  min-height: 1.5em;
  display: block;
  visibility: visible !important;
  fill: transparent;
}
/* Removed legacy .rt-non-selected variants; use .non-selected selectors above */
/* styles.css */

.center-key-text {
  font-size: 18px;
  fill: var(--text-normal, #333333);
  font-weight: 400;
  text-transform: uppercase;
}

/* Debug container visibility */
.debug-container {
    display: none;
}

.debug-container.visible {
    display: block;
}

/* Search container styles (scoped to plugin container) */
.radial-timeline-container .search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* removed empty rule: .radial-timeline-container .search-container .search-input */

/* Modal-specific search input sizing */
.radial-timeline-search .search-input {
    width: 100%;
    max-width: 100%;
    flex: 1;
    margin-bottom: 16px;
}

/* Search banner styles removed */

/* Removed unused utility classes: test-button, path-element, dynamic-element, font-size-element */

/* Dynamic subplot/character colors are set inline in TypeScript - no static CSS needed */

/* Dynamic color elements */
[data-item-type="subplot"],
[data-item-type="character"] {
    stroke: white;
    stroke-width: 0.07em;
    paint-order: stroke;
}



/* Removed unused dynamic-font-size class */

/* SVG interaction elements */
.radial-timeline-container .svg-interaction {
    pointer-events: none;
}

/* Layout containers */
.rt-flex-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

/* Button styles */
.rt-action-button {
    padding: 10px;
    margin-top: 20px;
}

/* Zero draft modal styles */
.rt-zero-draft-textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
}
.rt-zero-draft-info {
  margin: 6px 0 10px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.rt-zero-draft-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.rt-zero-draft-override {
  background-color: var(--rt-color-due) !important; /* use defined red */
  color: #ffffff !important;
  border-color: var(--rt-color-due) !important;
}
.rt-zero-draft-override:hover { filter: brightness(0.9); }
.rt-zero-draft-override:focus { box-shadow: 0 0 0 2px rgba(208,94,94,0.3); }

/* Dynamic positioning */
.radial-timeline-container .dynamic-position {
    position: absolute;
}

/* SVG Element Styles */
.radial-timeline-container .svg-path {
    display: none;
    fill: none;
}

.radial-timeline-container .svg-text {
    font-weight: bold;
}

/* Title text styles */
.radial-timeline-container .rt-scene-title-bold {
  font-weight: bold;
}

/* Grade border styles */
.radial-timeline-container .grade-border {
    fill: none;
}

/* Invisible spacer styles */
.radial-timeline-container .rt-invisible-spacer {
    opacity: 0;
}

/* Button Container Styles */
.rt-button-container {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center; /* Align items vertically */
}

/* Input field styles */
.rt-search-input {
    flex: 2;
}

/* Title text styles */
.rt-title-text-main {
    --title-color: var(--text-normal);
}

/* Date text styles - base rule for all date text */
.rt-date-text {
    fill: var(--text-muted) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    stroke: white !important;
    stroke-width: 2.5px !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    vertical-align: super !important;
    baseline-shift: .3em !important;
    paint-order: stroke !important;
}

/* Search term highlighting - consolidated above with other search-term rules */

/* Info container styles */
.rt-info-container {
    cursor: pointer;
}

/* Synopsis text styles */
.radial-timeline-container .rt-synopsis-text {
    font-size: 14px;
    line-height: 1.5;
}

/* UNUSED????   Metadata text styles
.metadata-text {
    font-size: 12px;

}*/

/* Beat text styles */
.beats-text {
  font-size: 14px; /* Let's try 14px, closer to metadata */
  font-weight: normal;
  text-transform: none;
  fill: #666666; /* Default color for the <text> element */
  white-space: nowrap; /* Prevent automatic line wrapping */
  text-transform: uppercase;
}

.beats-text-grade {
  font-size: 16px; /* Let's try 14px, closer to metadata */
  fill: var(--rt-max-publish-stage-color, var(--text-muted)); /* Darker green for better visibility */
  font-weight: bold;
}

.beats-text-positive {
  fill: #2B9348; /* Darker green for better visibility */
  font-weight: bold;
}

.beats-text-negative {
  fill: #D62828; /* Darker red for better visibility */
  font-weight: bold;
}

.beats-text-neutral {
  fill: #000000; /* Solid black */
  font-weight: bold; /* Match the weight of positive/negative */
}

/* Ensure search terms maintain their color */
/* Removed legacy subplot/character .search-term overrides; .rt-search-term is used consistently */

.subplot-ring-label-path {
  fill: none;
  stroke: none;
  pointer-events: none;
}

.rt-subplot-ring-label-text {
    fill: var(--rt-max-publish-stage-color, var(--text-muted)); /* Use max stage color, fallback to muted text */
    opacity: .2; /* Corrected opacity back to 30% */
    font-family: 'Asimovian', 'Impact', 'Arial Black', Arial, sans-serif;
    font-weight: 400; /* Regular weight */
    font-synthesis: none; /* Prevent faux bold/italic synthesis for single-weight font */
    letter-spacing: -0.02em; /* tighter tracking */
    font-size: var(--rt-subplot-font-size);
    dominant-baseline: central; /* Try central for potentially better vertical centering */
    text-transform: uppercase;
    pointer-events: none; /* Ignore mouse events */
}

/* Use .non-selected class for faded state (consistent with other elements) */
.rt-subplot-ring-label-text.rt-non-selected {
    opacity: .1; /* Corrected opacity back to 30% */
}

/* Hide subplot ring labels in Gossamer mode AND on hover */
.radial-timeline-svg[data-gossamer-mode="true"] .rt-subplot-ring-label-text {
    opacity: 0 !important;
}
.radial-timeline-svg.scene-hover .rt-subplot-ring-label-text {
    opacity: 0 !important;
}


/* Progress Ring Base (thin gray track underneath) */
.radial-timeline-container .progress-ring-base {
  fill: none;
  stroke: #000000; /* Purple background to match estimation arc #5e0098*/
  stroke-width: 10px; /* Base width */
}

/* Year Progress Ring (Rainbow Segments) */
.radial-timeline-container .progress-ring-fill {
  fill: none;
  stroke-width: 6px; /* Make rainbow ring thinner */
  stroke-linecap: round; /* Optional: round ends */
}

.radial-timeline-container .estimation-date-label {
    font-size: 14px;
    fill: #ff0000;
    font-weight: bold;
}

.radial-timeline-container .estimated-date-tick {
    stroke: #ff0000;
    stroke-width: 2px;
}

.radial-timeline-container .estimated-date-dot {
    fill: #ff0000;
}

/* Target Completion Date Marker Styles */
.radial-timeline-container .target-date-tick {
    stroke: #00cc00; /* Bright Green */
    stroke-width: 2px;
}

.radial-timeline-container .target-date-marker {
    fill: none; /* No fill */
    stroke: #00cc00; /* Bright Green */
    stroke-width: 2px; /* Outline width */
}

/* Styling for the embedded README container in settings */
.manuscript-readme-container {
    padding: 0; 
    margin-top: 15px;
    margin-bottom: 20px;
}

/* Settings input validation styles */
.setting-input-success {
    border-color: #00ff48 !important;
    background-color: rgba(0, 255, 72, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 72, 0.2) !important;
}

.setting-input-error {
    border-color: #ff4444 !important;
    background-color: rgba(255, 68, 68, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2) !important;
}

/* Source path autocomplete suggestions */
.source-path-suggestions {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-top: 2px;
    min-width: 200px; /* Ensure minimum width */
    background-color: var(--background-primary);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border: 1px solid var(--background-modifier-border);
    max-height: 200px;
    overflow-y: auto;
}

.source-path-suggestions.hidden {
    display: none;
}

.source-path-suggestions.visible {
    display: block;
}

.source-path-input-container {
    position: relative;
}

.source-path-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--background-modifier-border);
    /* Settings UI can animate hover for better affordance (timeline has no animations) */
    transition: background-color 0.1s ease;
}

.source-path-suggestion-item:last-child {
    border-bottom: none !important;
}

.source-path-suggestion-item:hover,
.source-path-suggestion-item.selected {
    background-color: var(--background-modifier-hover) !important;
}

/* status header hover effect */
.radial-timeline-container .status-header-letter {
  
  text-decoration: none;
}
.status-header:hover .status-header-letter {
  fill: #ffffff;
  text-decoration: underline;
}

/* bottom-left count inside Completed grid cells */
.radial-timeline-container .grid-completed-count {
  fill: #000000;
  font-size: 14px; /* doubled size */
  pointer-events: none;
}

/* icon color for Completed grid cells */
.radial-timeline-container .completed-icon {
  color: #000000;
}

/* stage header hover effect */
.radial-timeline-container .stage-header-letter {
  
  text-decoration: none;
}
.stage-header:hover .stage-header-letter {
  fill: #ffffff;
  text-decoration: underline;
}
