/* ============================================================================
   NAV RAIL + DETAIL VIEWS  ·  Panchang / Choghadiya / Festivals
   Loaded after components.css. Also shifts the Sky HUD to clear the rail.
   ========================================================================== */

/* ---- shift sky HUD to clear the 64px rail ---- */
.dome-wrap { left: 64px; }
.panel.left { left: 80px; }
.bottom { left: 80px; }
.planet-card { left: 388px; }

/* =============================================================== CONTROL BAR */
.ctrlbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.cb-date { display: flex; align-items: center; gap: 8px; }
.cb-arw { width: 24px; height: 24px; border-radius: 50%; background: transparent; border: 1px solid var(--glass-border);
  color: var(--ink-soft); cursor: pointer; font-size: 0.9rem; line-height: 1; display: grid; place-items: center; }
.cb-arw:hover { border-color: var(--gold); color: var(--gold); }
.cb-datelabel { font-family: var(--font-ephem); font-size: var(--t-xs); color: var(--ink); min-width: 168px; text-align: center; }
.cb-today { font-family: var(--font-data); font-size: var(--t-micro); font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: transparent; border: 1px solid var(--glass-border); color: var(--ink-soft); cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em; }
.cb-today:hover { border-color: var(--gold); color: var(--gold); }
.cb-city { display: flex; align-items: center; gap: 6px; }
.cb-pin { color: var(--gold); font-size: 0.8rem; }
.cb-select { background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--ink); border-radius: 8px;
  padding: 4px 8px; font-family: var(--font-data); font-size: var(--t-xs); cursor: pointer; }
.cb-select:focus { outline: none; border-color: var(--gold); }
.bottom .ctrlbar { margin-top: 0; }
.bottom .anchor.loc { gap: 4px; }

/* ================================================================ NAV RAIL  */
.nav-rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: 64px; z-index: 11;
  display: flex; flex-direction: column; align-items: center; padding: 16px 0 18px;
  border: 0; border-right: 1px solid var(--glass-border); border-radius: 0;
}
.rail-mark { width: 40px; height: 40px; display: grid; place-items: center; }
.rail-bindu { width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dim));
  box-shadow: 0 0 14px var(--gold); animation: bindu-morph 10s ease-in-out infinite; }
.rail-items { display: flex; flex-direction: column; gap: 3px; margin-top: 18px; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.rail-items::-webkit-scrollbar { width: 0; }
.rail-btn {
  position: relative; width: 50px; height: 52px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; cursor: pointer; flex: 0 0 auto;
  background: transparent; border: 0; border-radius: 12px; color: var(--ink-faint);
  transition: all var(--dur-fast);
}
.rail-glyph { font-size: 1.25rem; line-height: 1; }
.rail-label { font-size: 0.46rem; letter-spacing: 0.02em; text-transform: uppercase; max-width: 60px; text-align: center; line-height: 1.1; }
.rail-btn:hover { color: var(--ink); background: rgba(212,168,67,0.08); }
.rail-btn.active { color: var(--gold); background: rgba(212,168,67,0.14); }
.rail-btn.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.rail-foot { margin-top: auto; }
.rail-loc { writing-mode: vertical-rl; font-size: 0.8rem; color: var(--ink-faint); letter-spacing: 0.12em; }

/* ============================================================ DETAIL SURFACE */
.detail-surface {
  position: absolute; left: 64px; right: 0; top: 0; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; padding: 26px clamp(20px, 3vw, 46px) 12px;
}
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s6);
  margin-bottom: var(--s5); flex-shrink: 0; }
.ds-title { font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 600; line-height: 1; margin: 0; }
.ds-title .dev { font-size: 1.3rem; color: var(--silver); margin-left: 10px; font-weight: 500; }
.ds-meta { color: var(--ink-faint); font-size: var(--t-xs); margin-top: 8px; }
.ds-head-tithi { padding: 10px 18px; border-radius: var(--r-md); display: flex; flex-direction: column;
  gap: 4px; text-align: right; min-width: 184px; }
.ds-head-tithi .eyebrow { color: var(--ink-faint); }
.ds-head-tithi .sacred { color: var(--gold); font-size: 1.15rem; font-weight: 600; white-space: nowrap; line-height: 1.1; }
.ds-head-tithi .dev { color: var(--silver); font-size: 0.85rem; }

.ds-scroll { flex: 1; overflow-y: auto; padding: 2px 12px 48px 4px; }
.ds-scroll::-webkit-scrollbar { width: 8px; }
.ds-scroll::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 8px; }

.ds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.ds-section {
  background: var(--glass-fill); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  padding: 18px 20px; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.ds-sec-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--glass-border); }
.ds-sec-dev { color: var(--gold); font-size: 0.8rem; }

/* stat cards */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md); padding: 10px 12px; overflow: hidden; }
.stat-label { font-size: 0.5rem; margin-bottom: 5px; display: block; }
.stat-value { font-family: var(--font-sacred); font-size: 1.12rem; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.stat-sub { font-size: 0.6rem; color: var(--ink-faint); margin-top: 3px; }

/* five limbs */
.limb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.limb-card { background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 3px; min-height: 158px; }
.limb-top { display: flex; justify-content: space-between; align-items: center; }
.limb-pct { color: var(--silver); font-size: 0.7rem; }
.limb-name { font-size: 1.45rem; color: var(--gold); font-weight: 600; line-height: 1; }
.limb-dev { color: var(--silver); font-size: 0.9rem; }
.limb-sub { font-size: 0.62rem; color: var(--ink-faint); }
.limb-track { height: 3px; background: rgba(255,255,255,0.10); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.limb-track span { display: block; height: 100%; background: var(--silver); border-radius: 3px; }
.limb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 1px; font-size: 0.62rem; color: var(--ink-faint); padding-top: 8px; }
.lf-end b { color: var(--ink-soft); font-weight: 600; }

/* time-row list (muhurat / yoga) */
.time-list { display: flex; flex-direction: column; gap: 4px; }
.time-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.tr-bar { width: 4px; align-self: stretch; min-height: 28px; border-radius: 4px; }
.tr-bar.green { background: var(--m-green); } .tr-bar.red { background: var(--m-red); } .tr-bar.amber { background: var(--m-amber); }
.tr-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-name { font-size: 0.9rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.tr-star { color: var(--gold); font-style: normal; font-size: 0.7rem; }
.tr-lord { color: var(--ink-faint); font-style: normal; font-weight: 400; font-size: 0.72rem; }
.tr-note { font-size: 0.7rem; color: var(--ink-faint); }
.tr-times { display: flex; gap: 6px; }
.chip { font-family: var(--font-ephem); font-size: 0.72rem; padding: 4px 9px; border-radius: 6px;
  background: rgba(255,255,255,0.05); color: var(--ink-soft); white-space: nowrap; }
.chip.green { color: #93e2b3; background: rgba(46,139,87,0.18); }
.chip.red   { color: #ed9aa6; background: rgba(196,30,58,0.18); }
.chip.amber { color: #f5c98a; background: rgba(255,140,0,0.18); }
.time-row.now { background: linear-gradient(90deg, rgba(212,168,67,0.12), transparent); }

/* hora */
.hora-list { display: flex; flex-direction: column; gap: 1px; }
.hora-row { display: grid; grid-template-columns: 52px 86px 1fr 10px; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px; }
.hora-row:hover { background: rgba(255,255,255,0.03); }
.hora-t { color: var(--gold); font-size: 0.8rem; }
.hora-lord { font-weight: 600; font-size: 0.85rem; }
.hora-use { font-size: 0.7rem; color: var(--ink-faint); }
.hora-dot { width: 7px; height: 7px; border-radius: 50%; }
.hora-dot.g { background: var(--m-green); box-shadow: 0 0 6px var(--m-green); }
.hora-dot.b { background: var(--m-red); }

/* ============================================================== CHOGHADIYA  */
.chog-wrap { max-width: 1020px; margin: 0 auto; }
.chog-legend { display: flex; flex-wrap: wrap; gap: 26px; justify-content: center; margin-bottom: 22px;
  font-size: 0.72rem; color: var(--ink-soft); }
.chog-legend i.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
.lg.green { background: var(--m-green); } .lg.amber { background: var(--m-amber); } .lg.red { background: var(--m-red); }
.chog-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.chog-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--glass-border); }
.chog-cells { display: flex; flex-direction: column; gap: 8px; }
.chog-cell { position: relative; display: grid; grid-template-columns: 5px 1fr auto; gap: 16px; align-items: center;
  padding: 13px 16px; border-radius: var(--r-md); background: var(--glass-fill); border: 1px solid var(--glass-border); }
.cc-bar { width: 5px; align-self: stretch; min-height: 42px; border-radius: 5px; }
.chog-cell.green .cc-bar { background: var(--m-green); box-shadow: 0 0 10px -2px var(--m-green); }
.chog-cell.red   .cc-bar { background: var(--m-red);   box-shadow: 0 0 10px -2px var(--m-red); }
.chog-cell.amber .cc-bar { background: var(--m-amber); box-shadow: 0 0 10px -2px var(--m-amber); }
.cc-body { display: flex; flex-direction: column; }
.cc-name { font-size: 1.25rem; line-height: 1.1; }
.chog-cell.green .cc-name { color: #9fe6bd; } .chog-cell.red .cc-name { color: #ee9fab; } .chog-cell.amber .cc-name { color: #f6cd90; }
.cc-lord { font-size: 0.6rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.12em; }
.cc-time { font-family: var(--font-ephem); font-size: 0.85rem; color: var(--ink-soft); }
.cc-now { position: absolute; top: 8px; right: 12px; color: var(--gold); font-size: 0.5rem; }
.chog-cell.now { box-shadow: inset 0 0 0 1px var(--gold), 0 0 34px -10px var(--gold); }

/* ============================================================== FESTIVALS   */
.fest-list { display: flex; flex-direction: column; gap: 14px; max-width: 880px; margin: 0 auto; }
.fest-card { display: grid; grid-template-columns: 92px 1fr; gap: 22px; padding: 18px 24px; border-radius: var(--r-lg);
  background: var(--glass-fill); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.fest-card.today { border-color: var(--gold); box-shadow: 0 0 44px -16px rgba(212,168,67,0.6); }
.fest-date { display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-right: 1px solid var(--glass-border); padding-right: 18px; gap: 2px; }
.fd-day { font-size: 1.9rem; color: var(--gold); font-weight: 700; }
.fd-mon { font-size: 0.6rem; }
.fd-today { font-size: 0.52rem; color: var(--gold); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.12em; }
.fest-name { font-size: 1.5rem; color: var(--ink); font-weight: 600; line-height: 1.05; }
.fest-tithi { font-size: 0.64rem; color: var(--gold); margin: 5px 0; }
.fest-note { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.4; }

/* ============================================================ DETAIL RESPONSIVE */
@media (max-width: 1100px) {
  .ds-grid { grid-template-columns: 1fr; }
  .limb-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .chog-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .limb-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-head { flex-direction: column; }
  .ds-head-tithi { text-align: left; }
}
