/* ==========================================================================
   Chart view modes (default vs. comfortable / relaxed)
   Theme-aware: uses the site CSS variables set by the user's theme.
   Default view = untouched. Comfortable view is opt-in via .view-comfortable
   on the .chart-shell wrapper. Preference is persisted in localStorage.
   ========================================================================== */

/* --- Navigation wrapper: clean pill bar with NO card container --- */
.navigation-wrapper {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 6px 0 12px !important;
  box-shadow: none !important;
}

/* --- Single-row toolbar: year filter + year links + view toggle ---------- */
.chart-toolbar-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  background: transparent !important;
  border: none !important;
}

/* Year-range filter (start/end year selects) */
.cyl-yearfilter { position: relative; flex: 0 0 auto; }
.cyl-year-toggle { display: none; }   /* hidden on desktop; selects shown inline */
.cyl-yearform {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cyl-select {
  height: 30px !important;
  border: 1px solid var(--border) !important;
  background: var(--divback) !important;
  color: var(--text) !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 0 22px 0 12px !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 12px !important;
  min-width: 76px !important;
  line-height: 1 !important;
}
.cyl-sep { font-size: 12px !important; font-weight: 700 !important; opacity: .7 !important; color: var(--text) !important; }
.cyl-go {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  border: none !important;
  background: var(--accent-gradient) !important;
  color: #fff !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: opacity .15s ease !important;
  box-shadow: 0 2px 6px var(--accent-pink-glow) !important;
}
.cyl-go:hover { opacity: 0.9 !important; }
.cyl-go svg { width: 16px; height: 16px; display: block; }

/* Year-wise SEO links — horizontally scrollable, single line */
.chart-year-links {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.chart-year-links .cyl-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}
.chart-year-links .cyl-list::-webkit-scrollbar { height: 0; }
.chart-year-links .cyl-item {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-pink) !important;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chart-year-links .cyl-item:hover { border-color: var(--accent-pink); }
.chart-year-links .cyl-item.active {
  background: var(--accent-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 6px var(--accent-pink-glow) !important;
}

/* View toggle button */
.chart-view-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--outline, #e2e8f0);
  background: var(--surface-card, #ffffff);
  color: var(--text-main, #1a1b1f);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: all .15s ease;
}
.chart-view-toggle:hover {
  border-color: var(--accent-pink, #ec008d);
  color: var(--accent-pink, #ec008d);
}
.chart-view-toggle.active {
  background: var(--accent-gradient, linear-gradient(135deg, #ec008d 0%, #ff7a00 100%)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px var(--accent-pink-glow, rgba(236, 0, 141, 0.28)) !important;
}
.chart-view-toggle svg { width: 16px; height: 16px; display: block; }
.chart-view-toggle .cvt-icon-comfortable { display: none; }
.chart-view-toggle.active .cvt-icon-default { display: none; }
.chart-view-toggle.active .cvt-icon-comfortable { display: block; }

/* Mobile: collapse year selects behind an icon, view toggle becomes icon-only */
@media (max-width: 768px) {
  .cyl-year-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 30px !important;
    padding: 0 12px !important;
    border: 1px solid var(--outline, #e2e8f0) !important;
    background: var(--surface-card, #ffffff) !important;
    color: var(--text-main, #1a1b1f) !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    line-height: 1 !important;
  }
  .cyl-year-toggle svg { width: 16px; height: 16px; display: block; }
  .cyl-yearform {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    z-index: 40;
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-md, 0 8px 22px rgba(0, 0, 0, .15));
  }
  .cyl-yearfilter.open .cyl-yearform { display: flex; }
  .cyl-yearfilter.open .cyl-year-toggle { border-color: var(--accent-pink, #ec008d); }
  .chart-view-toggle { padding: 0; width: 32px; height: 30px; justify-content: center; border-radius: 999px; }
  .chart-view-toggle [data-view-label] { display: none; }
}

/* ==========================================================================
   COMFORTABLE / RELAXED VIEW (Spacious padding & larger numbers)
   Theme-compatible: Clean white surface, subtle borders, no colored background blocks
   ========================================================================== */
.chart-shell.view-comfortable .tbl-container {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.chart-shell.view-comfortable .chart-table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  width: 100%;
  background: var(--surface-card, #ffffff) !important;
}

.chart-shell.view-comfortable .chart-table td,
.chart-shell.view-comfortable .chart-table th {
  border: 1px solid var(--outline-variant, #e2e8f0) !important;
  border-radius: 0 !important;
  padding: 13px 6px !important;
  vertical-align: middle;
}

/* Header row (day names) */
.chart-shell.view-comfortable .chart-table th,
.chart-shell.view-comfortable .chart-table thead th {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--outline, #e2e8f0) !important;
}

/* Body number cells: spacious & bold */
.chart-shell.view-comfortable .chart-table td {
  background: var(--surface-card, #ffffff) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-size: 19px;
  font-weight: 800;
}

/* Alternating rows/columns - clean white, NO salmon pink! */
.chart-shell.view-comfortable .chart-table td:nth-child(2n),
.chart-shell.view-comfortable .chart-table td:nth-child(3n) {
  background: var(--surface-card, #ffffff) !important;
}

/* Date column stays compact & subtle */
.chart-shell.view-comfortable .chart-table td.date,
.chart-shell.view-comfortable .chart-table td:first-child {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  min-width: 64px;
}

/* Jodi (center, large) */
.chart-shell.view-comfortable .chart-table td.jodi-bold {
  font-size: 24px !important;
  font-weight: 900 !important;
}

/* Panel open/close panna digit stacks */
.chart-shell[data-chart="panel"].view-comfortable .chart-table td:not(.date):not(.jodi-bold):not(:first-child) {
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  color: var(--text-muted, #64748b) !important;
  opacity: .95;
  min-width: 20px;
}

/* Keep highlighted numbers pink in theme */
.chart-shell .chart-table .red,
.chart-shell .chart-table .tred,
.chart-table .red,
.chart-table .tred {
  color: var(--accent-pink, #ec008d) !important;
  font-weight: 800 !important;
}

/* On small screens fall back to horizontal scroll for the table only. */
@media (max-width: 768px) {
  .chart-shell.view-comfortable .chart-table { min-width: 640px; }
  .chart-shell[data-chart="panel"].view-comfortable .chart-table { min-width: 760px; }
  .chart-shell.view-comfortable .chart-table td { font-size: 17px; }
  .chart-shell.view-comfortable .chart-table td.jodi-bold { font-size: 20px !important; }
}

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--surface-card, #ffffff) !important;
  border: 1px solid var(--outline, #e2e8f0) !important;
  border-radius: var(--radius-lg, 16px) !important;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06)) !important;
}

/* Card holding a chart table: STRICTLY ZERO PADDING (flush on all sides) */
.chart-shell .chart-card,
.chart-card.chart-table-card,
.chart-card:has(.chart-table),
.chart-card:has(.tbl-container) {
  padding: 0 !important;
  margin: 0 0 20px !important;
  overflow: hidden !important; /* Clips table corners to card radius */
}

/* Outer chart shell wrapper: transparent layout container */
.chart-shell {
  width: 100% !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* ---------- Date-range row ---------- */
.date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 15px;
}
.date-row .date-group {
  flex: 1;
  min-width: 140px;
  max-width: 300px;
}
.date-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--text-main, #1a1b1f);
  opacity: 0.8;
}

/* ---------- Table Container: flush edge-to-edge within card ---------- */
.tbl-container,
.chart-shell .tbl-container,
.chart-card .tbl-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: block !important;
}

/* Flush outer table cells against enclosing card border */
.chart-table thead tr:first-child th {
  border-top: none !important;
}
.chart-table tr:last-child td,
.chart-table tr:last-child th {
  border-bottom: none !important;
}
.chart-table tr td:first-child,
.chart-table tr th:first-child {
  border-left: none !important;
}
.chart-table tr td:last-child,
.chart-table tr th:last-child {
  border-right: none !important;
}

/* ---------- Chart table (Default view) ---------- */
.chart-table {
  width: 100%;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  font-family: inherit;
  color: var(--text-main, #1a1b1f);
  background: var(--surface-card, #ffffff) !important;
}
.chart-table th,
.chart-table td {
  border: 1px solid var(--outline-variant, #e2e8f0) !important;
  padding: 10px 8px;
  text-align: center;
}
.chart-table th {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--outline, #e2e8f0) !important;
}
.chart-table td {
  background: var(--surface-card, #ffffff) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-size: 14px;
}
.chart-table td.date,
.chart-table td:first-child {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

/* ---------- Panel Table Specific Styles: Exact Centering & Proportions ---------- */
.chart-shell[data-chart="panel"] {
  font-size: 11px;
}
.chart-panel-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  margin: 0 !important;
  font-family: inherit;
  font-size: 10px;
  background: var(--surface-card, #ffffff) !important;
}

.chart-shell .chart-panel-table th,
.chart-shell .chart-panel-table td,
.chart-panel-table th,
.chart-panel-table td {
  text-align: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  border: 1px solid var(--outline-variant, #e2e8f0) !important;
  margin: 0 !important;
}

.chart-shell .chart-panel-table th,
.chart-shell .chart-panel-table thead th,
.chart-panel-table th,
.chart-panel-table thead th {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-weight: 700 !important;
  font-size: clamp(9px, 2.4vw, 12.5px) !important;
  line-height: 1.2 !important;
  padding: 6px 1px !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--outline, #e2e8f0) !important;
}

.chart-shell .chart-panel-table td.date,
.chart-shell .chart-panel-table th.date-header,
.chart-shell .chart-panel-table td:first-child,
.chart-panel-table td.date,
.chart-panel-table th.date-header {
  background: var(--surface-card-subtle, #f8fafc) !important;
  color: var(--text-muted, #64748b) !important;
  font-size: clamp(7.5px, 2vw, 10.5px) !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  padding: 3px 1px !important;
  white-space: normal !important;
  word-break: normal !important;
  cursor: pointer !important;
}

.chart-shell .chart-panel-table td.panna-open,
.chart-shell .chart-panel-table td.panna-close,
.chart-panel-table td.panna-open,
.chart-panel-table td.panna-close {
  background: var(--surface-card, #ffffff) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-size: clamp(7.5px, 2vw, 9.5px) !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  font-variant-numeric: tabular-nums !important;
  padding: 3px 0 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
}

.chart-shell .chart-panel-table td.jodi-bold,
.chart-panel-table td.jodi-bold {
  background: var(--surface-card, #ffffff) !important;
  color: var(--text-main, #1a1b1f) !important;
  font-size: clamp(10.5px, 3.2vw, 14.5px) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.2px !important;
  padding: 3px 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

/* Comfortable view overrides for panel table */
.chart-shell.view-comfortable .chart-panel-table {
  min-width: 760px !important;
  table-layout: auto !important;
}
.chart-shell.view-comfortable .chart-panel-table td.panna-open,
.chart-shell.view-comfortable .chart-panel-table td.panna-close {
  font-size: 11px !important;
  line-height: 1.25 !important;
  padding: 6px 4px !important;
}
.chart-shell.view-comfortable .chart-panel-table td.jodi-bold {
  font-size: 19px !important;
  padding: 6px 6px !important;
}

/* Small mobile devices (<= 360px) */
@media (max-width: 360px) {
  .chart-shell .chart-panel-table td.date {
    font-size: 7px !important;
    line-height: 1.1 !important;
    padding: 2px 0 !important;
  }
  .chart-shell .chart-panel-table td.panna-open,
  .chart-shell .chart-panel-table td.panna-close {
    font-size: 7px !important;
    line-height: 1.1 !important;
    padding: 2px 0 !important;
  }
  .chart-shell .chart-panel-table td.jodi-bold {
    font-size: 10px !important;
    line-height: 1.1 !important;
    padding: 2px 0 !important;
  }
}

/* Tablet & Desktop (>= 769px) */
@media (min-width: 769px) {
  .chart-shell .chart-panel-table th {
    padding: 8px 4px !important;
    font-size: 13px !important;
  }
  .chart-shell .chart-panel-table td.date {
    padding: 6px 4px !important;
    font-size: 11px !important;
  }
  .chart-shell .chart-panel-table td.panna-open,
  .chart-shell .chart-panel-table td.panna-close {
    font-size: 11px !important;
    line-height: 1.25 !important;
    padding: 6px 2px !important;
  }
  .chart-shell .chart-panel-table td.jodi-bold {
    font-size: 17px !important;
    padding: 6px 2px !important;
  }
}

/* ---------- Input overrides for theme ---------- */
input[type="date"] {
  color-scheme: light dark;
}
body[data-theme="dark"] input[type="date"] {
  background: #222;
  color: #fff;
  border-color: #444;
}

/* ---------- Responsive overrides ---------- */
@media (max-width: 768px) {
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .chart-card {
    padding: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  .tbl-container {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin-bottom: 0 !important;
  }
}
@media (max-width: 480px) {
  .chart-table {
    font-size: 12px !important;
  }
  .chart-table td,
  .chart-table th {
    padding: 6px 2px !important;
  }
  .date-row {
    gap: 8px !important;
  }
  .date-group label {
    font-size: 12px !important;
  }
}

/* A user's brand-color preference can be too dark against dark chart surfaces. */
:root[data-theme="dark"] .chart-year-links .cyl-item {
  color: var(--text);
}

/* Guessing table number pills: consistent 24px height, 11px font size, rounded styling */
.chart-table .num-pill {
  height: 24px !important;
  min-width: 24px !important;
  line-height: 24px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: var(--radius-round, 999px) !important;
  padding: 0 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 2px 0 !important;
}

.chart-table .num-pill:not(.wide) {
  width: 24px !important;
  min-width: 24px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

.chart-table .num-pill.wide {
  width: auto !important;
  min-width: auto !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
}

.chart-table .num-pill.tone-green {
  background: var(--md-pass, #2e7d52) !important;
  color: var(--md-on-pass, #fff) !important;
}

.chart-table .num-pill.tone-neutral {
  background: #6c757d !important;
  color: #ffffff !important;
}

.chart-table .vip-pass-chip,
.chart-table .label-success,
.chart-table .label {
  height: 24px !important;
  min-width: auto !important;
  line-height: 24px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: var(--radius-round, 999px) !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 2px 0 !important;
  background: var(--md-pass, #2e7d52) !important;
  color: var(--md-on-pass, #fff) !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  letter-spacing: 0.2px !important;
}

/* ---------------------------------------------------------------
   Interactive Chart Table Highlighting (Row / Column Only)
   --------------------------------------------------------------- */
.chart-table th,
.chart-table td:first-child,
.chart-table td.date {
  cursor: pointer !important;
  user-select: none;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.chart-table td:not(:first-child) {
  cursor: default;
}

/* Row highlight */
.chart-table tr.is-row-highlighted td {
  background-color: rgba(236, 0, 141, 0.09) !important;
}

/* Row header (Date) active highlight */
.chart-table tr.is-row-highlighted td:first-child,
.chart-table tr.is-row-highlighted td.date {
  background: var(--accent-gradient, linear-gradient(135deg, #ec008d 0%, #ff7a00 100%)) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}
.chart-table tr.is-row-highlighted td:first-child *,
.chart-table tr.is-row-highlighted td.date * {
  color: #ffffff !important;
}

/* Column highlight */
.chart-table td.is-col-highlighted {
  background-color: rgba(255, 122, 0, 0.11) !important;
}

/* Column header active highlight */
.chart-table th.is-col-highlighted {
  background: var(--accent-gradient, linear-gradient(135deg, #ec008d 0%, #ff7a00 100%)) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* ---------------------------------------------------------------
   Chart Title Bar + Explorer Bar (Unsticky & Compact)
   --------------------------------------------------------------- */
.chart-title-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.chart-title-select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 52%;
  height: 36px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--outline, #dfe1ea);
  background: var(--surface-card, #ffffff);
  color: var(--text-main, #1a1b1f);
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 800;
  cursor: pointer;
}

.chart-title-suffix {
  font-size: clamp(13px, 3.6vw, 20px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main, #1a1b1f);
  min-width: 0;
  line-height: 1.25;
}

.chart-explorer-bar {
  position: static;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--outline, #dfe1ea);
  border-radius: var(--radius-md, 12px);
  padding: 8px 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.04));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.explorer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--outline, #dfe1ea);
  background: var(--surface-card-subtle, #f1f3f8);
  color: var(--text-main, #1a1b1f);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.exp-btn-calc {
  background: var(--accent-pink-soft, rgba(236, 0, 141, 0.08));
  border-color: rgba(236, 0, 141, 0.25);
  color: var(--accent-pink-text, #b8006e);
  margin-left: auto;
  flex: none;
}

.exp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #5b6171);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.explorer-digits {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.exp-digit-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--outline, #dfe1ea);
  background: var(--surface-card-subtle, #f1f3f8);
  color: var(--text-main, #1a1b1f);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.exp-digit-btn.active {
  background: var(--accent-gradient-btn, #c40075);
  border-color: transparent;
  color: #ffffff;
}

.explorer-pattern-toggles {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exp-pill-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--outline, #dfe1ea);
  background: var(--surface-card-subtle, #f1f3f8);
  color: var(--text-main, #1a1b1f);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.exp-pill-btn.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.explorer-days-row {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.explorer-day-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.exp-day-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--outline, #dfe1ea);
  background: var(--surface-card-subtle, #f1f3f8);
  color: var(--text-muted, #5b6171);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.exp-day-btn.active {
  background: var(--accent-pink-soft, rgba(236, 0, 141, 0.12));
  border-color: rgba(236, 0, 141, 0.35);
  color: var(--accent-pink-text, #b8006e);
}

.chart-scroll-fab {
  position: fixed;
  right: 14px;
  bottom: 82px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-fab-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--accent-gradient-btn, linear-gradient(135deg, #c40075 0%, #bf4b00 100%));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(196, 0, 117, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.chart-fab-btn:hover {
  transform: translateY(-1px);
}

.chart-fab-btn[hidden] {
  display: none !important;
}

.explorer-family-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-orange-soft, rgba(255, 122, 0, 0.12));
  border: 1px solid rgba(255, 122, 0, 0.35);
  color: var(--accent-orange-text, #a84300);
  font-size: 11.5px;
  font-weight: 700;
}

.explorer-family-chip[hidden] {
  display: none !important;
}

.exp-family-calc {
  color: var(--accent-pink-text, #b8006e);
  font-weight: 800;
  text-decoration: underline;
}

.exp-family-clear {
  background: none;
  border: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.chart-table td[data-jodi] {
  cursor: pointer !important;
}

.chart-day-hidden {
  display: none !important;
}

.chart-table.has-exp-filter td[data-jodi]:not(.is-exp-match),
.chart-table.has-exp-filter td[data-panna]:not(.is-exp-match) {
  opacity: 0.22 !important;
  transition: opacity 0.15s ease;
}

.chart-table.has-exp-filter td.is-exp-match {
  background: rgba(236, 0, 141, 0.18) !important;
  box-shadow: inset 0 0 0 2px var(--accent-pink, #ec008d) !important;
  font-weight: 900 !important;
  opacity: 1 !important;
}

[data-theme="dark"] .chart-table.has-exp-filter td.is-exp-match,
body.dark .chart-table.has-exp-filter td.is-exp-match {
  background: rgba(236, 0, 141, 0.28) !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  .chart-title-header {
    gap: 6px;
  }
  .chart-title-select {
    height: 30px;
    padding: 2px 6px;
    font-size: 12.5px;
    max-width: 48%;
  }
  .chart-title-suffix {
    font-size: 13px;
  }
  .chart-explorer-bar {
    padding: 7px 8px;
    gap: 5px;
    margin-bottom: 8px;
  }
  .chart-explorer-bar .exp-label {
    display: none !important;
  }
  .explorer-row {
    gap: 4px;
  }
  .explorer-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .explorer-filter-row::-webkit-scrollbar,
  .explorer-digits::-webkit-scrollbar,
  .explorer-day-chips::-webkit-scrollbar {
    display: none;
  }
  .explorer-digits {
    display: contents;
  }
  .explorer-pattern-toggles {
    flex: none;
    margin-left: auto;
  }
  .explorer-day-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
  }
  .explorer-days-row {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .exp-digit-btn {
    width: 22px;
    height: 22px;
    font-size: 10.5px;
    flex: none;
  }
  .exp-day-btn {
    height: 24px;
    padding: 0 7px;
    font-size: 11px;
    flex: none;
  }
  .exp-pill-btn {
    height: 22px;
    padding: 0 7px;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .exp-btn-calc {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* Intersection of highlighted row & column (crosshair) */
.chart-table tr.is-row-highlighted td.is-col-highlighted {
  background-color: rgba(236, 0, 141, 0.22) !important;
  box-shadow: inset 0 0 0 1.5px var(--accent-pink, #ec008d) !important;
  font-weight: 900 !important;
}


/* Dark mode adjustments for row & column highlighting */
body.dark .chart-table tr.is-row-highlighted td,
:root[data-theme="dark"] .chart-table tr.is-row-highlighted td {
  background-color: rgba(236, 0, 141, 0.18) !important;
}
body.dark .chart-table td.is-col-highlighted,
:root[data-theme="dark"] .chart-table td.is-col-highlighted {
  background-color: rgba(255, 122, 0, 0.18) !important;
}
body.dark .chart-table tr.is-row-highlighted td.is-col-highlighted,
:root[data-theme="dark"] .chart-table tr.is-row-highlighted td.is-col-highlighted {
  background-color: rgba(236, 0, 141, 0.32) !important;
}
