/* ============================================================================
   shastra.css  ·  Encyclopedia view
   ========================================================================== */
.shastra { max-width: 1160px; }
/* destiny constellation hero */
@keyframes sm-tw { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }
.sha-starmap { position: relative; height: 116px; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px;
  background: radial-gradient(120% 140% at 50% -20%, var(--nebula-violet), var(--void) 70%);
  border: 1px solid var(--glass-border); }
.sha-starmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sha-starmap-veil { position: absolute; inset: 0; background: radial-gradient(80% 120% at 50% 0%, transparent 30%, rgba(5,5,8,0.55) 100%); }
.sha-starmap-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.sha-starmap-title .dev { font-size: 0.85rem; color: var(--gold); letter-spacing: 0.12em; }
.sha-starmap-title .sacred { font-size: 1.5rem; color: var(--ink); font-weight: 600; text-shadow: 0 2px 18px rgba(0,0,0,0.6); }
.sha-hero { display: flex; flex-wrap: wrap; gap: 28px; padding: 20px 26px; margin-bottom: 20px;
  background: var(--glass-fill); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--glass-glow), 0 0 60px -34px rgba(212,168,67,0.4); }
.sha-stat { display: flex; flex-direction: column; gap: 2px; }
.sha-num { font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1; }
.sha-lbl { color: var(--ink-faint); }

.sha-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sha-search { flex: 1; min-width: 240px; background: var(--glass-fill); border: 1px solid var(--glass-border);
  color: var(--ink); border-radius: 999px; padding: 10px 18px; font-family: var(--font-data); font-size: 0.85rem; }
.sha-search:focus { outline: none; border-color: var(--gold); }
.sha-search::placeholder { color: var(--ink-faint); }
.sha-sevs { display: flex; gap: 6px; flex-wrap: wrap; }
.sha-sev { padding: 7px 14px; border-radius: 999px; background: transparent; border: 1px solid var(--glass-border);
  color: var(--ink-soft); cursor: pointer; font-family: var(--font-data); font-size: 0.72rem; font-weight: 600; }
.sha-sev:hover { border-color: var(--gold); color: var(--ink); }
.sha-sev.on { color: #1a1407; }
.sha-sev.all.on { background: var(--gold); border-color: var(--gold); }
.sha-sev.good.on { background: var(--m-green); border-color: var(--m-green); color: #eafff2; }
.sha-sev.bad.on { background: var(--m-red); border-color: var(--m-red); color: #ffeaee; }
.sha-sev.mixed.on { background: var(--m-amber); border-color: var(--m-amber); color: #2a1a00; }
.sha-sev.viparita.on { background: var(--g-shukra); border-color: var(--g-shukra); color: #16243a; }

.sha-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.sha-cat { padding: 6px 12px; border-radius: 8px; background: transparent; border: 1px solid var(--glass-border);
  color: var(--ink-soft); cursor: pointer; font-family: var(--font-data); font-size: 0.7rem; font-weight: 600; }
.sha-cat:hover { border-color: var(--gold); color: var(--ink); }
.sha-cat.on { background: rgba(212,168,67,0.14); border-color: var(--gold); color: var(--gold); }
.sha-count { color: var(--ink-faint); margin-bottom: 12px; }

.sha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@keyframes sha-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.sha-card { position: relative; overflow: hidden; background: var(--glass-fill); border: 1px solid var(--glass-border); border-left: 4px solid var(--glass-border);
  border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 9px;
  animation: sha-rise 460ms var(--ease-celestial) both;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast); }
.sha-card::after { content: ""; position: absolute; top: -40%; right: -30%; width: 160px; height: 160px; border-radius: 50%;
  pointer-events: none; opacity: 0.5; filter: blur(34px); transition: opacity var(--dur-med); }
.sha-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -22px rgba(0,0,0,0.9), 0 0 40px -24px var(--gold); }
.sha-card.good { border-left-color: var(--m-green); }
.sha-card.bad { border-left-color: var(--m-red); }
.sha-card.mixed { border-left-color: var(--m-amber); }
.sha-card.viparita { border-left-color: var(--g-shukra); }
.sha-card.good::after { background: radial-gradient(circle, rgba(46,139,87,0.5), transparent 70%); }
.sha-card.bad::after { background: radial-gradient(circle, rgba(196,30,58,0.45), transparent 70%); }
.sha-card.mixed::after { background: radial-gradient(circle, rgba(255,140,0,0.4), transparent 70%); }
.sha-card.viparita::after { background: radial-gradient(circle, rgba(46,111,176,0.45), transparent 70%); }
.sha-card:hover::after { opacity: 0.85; }

/* effect-theme layer */
.shc-theme-glyph { position: absolute; top: 8px; right: 12px; font-size: 3.4rem; line-height: 1; color: var(--tc);
  opacity: 0.10; pointer-events: none; font-family: var(--font-glyph, serif); transition: opacity var(--dur-med), transform var(--dur-med); z-index: 0; }
.sha-card:hover .shc-theme-glyph { opacity: 0.20; transform: scale(1.08) rotate(-4deg); }
.sha-card > *:not(.shc-theme-glyph) { position: relative; z-index: 1; }
.shc-theme { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; padding: 3px 10px 3px 7px; border-radius: 999px;
  font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--tc);
  background: color-mix(in srgb, var(--tc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 32%, transparent); align-self: flex-start; }
.sct-ic { font-size: 0.82rem; font-family: var(--font-glyph, serif); line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .th-power .sct-ic, .th-wealth .sct-ic, .th-fame .sct-ic { animation: sct-shimmer 2.6s ease-in-out infinite; }
  .th-spirit .sct-ic, .th-progeny .sct-ic, .th-union .sct-ic { animation: sct-float 3.4s ease-in-out infinite; }
  .th-affliction .sct-ic, .th-conflict .sct-ic, .th-poverty .sct-ic { animation: sct-throb 2.2s ease-in-out infinite; }
}
@keyframes sct-shimmer { 0%,100% { filter: drop-shadow(0 0 1px var(--tc)); opacity: 0.85; } 50% { filter: drop-shadow(0 0 5px var(--tc)); opacity: 1; } }
@keyframes sct-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes sct-throb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.16); } }


.shc-head { display: flex; align-items: flex-start; gap: 12px; }
.shc-medallion { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  font-size: 1.1rem; border: 1px solid var(--glass-border); position: relative; }
.shc-medallion.good { color: #93e2b3; background: radial-gradient(circle at 38% 32%, rgba(46,139,87,0.28), transparent); box-shadow: 0 0 16px -6px var(--m-green); }
.shc-medallion.bad { color: #ed9aa6; background: radial-gradient(circle at 38% 32%, rgba(196,30,58,0.28), transparent); box-shadow: 0 0 16px -6px var(--m-red); }
.shc-medallion.mixed { color: #f5c98a; background: radial-gradient(circle at 38% 32%, rgba(255,140,0,0.26), transparent); box-shadow: 0 0 16px -6px var(--m-amber); }
.shc-medallion.viparita { color: #bcd4f0; background: radial-gradient(circle at 38% 32%, rgba(46,111,176,0.3), transparent); box-shadow: 0 0 16px -6px var(--g-shukra); }
.shc-headtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shc-name { font-size: 1.12rem; color: var(--gold); font-weight: 600; line-height: 1.14; }
.shc-src { font-size: 0.6rem; color: var(--ink-faint); font-family: var(--font-ephem); }
.shc-tag { flex: 0 0 auto; font-size: 0.5rem; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; height: fit-content; }
.shc-tag.good { color: #93e2b3; background: rgba(46,139,87,0.18); }
.shc-tag.bad { color: #ed9aa6; background: rgba(196,30,58,0.18); }
.shc-tag.mixed { color: #f5c98a; background: rgba(255,140,0,0.18); }
.shc-tag.viparita { color: #bcd4f0; background: rgba(46,111,176,0.22); }
.shc-block .eyebrow { display: block; margin-bottom: 2px; }
.gold-h { color: var(--gold); }
.shc-block p { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.45; margin: 0; }
.shc-catpill { font-size: 0.5rem; color: var(--ink-faint); background: rgba(255,255,255,0.05); padding: 2px 7px; border-radius: 999px; margin-left: auto; text-transform: none; letter-spacing: 0; }
.sha-empty { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--ink-faint); }

/* classical verse (expandable) */
.shc-verse { margin-top: 4px; border-top: 1px solid var(--glass-border); padding-top: 8px; }
.shc-verse summary { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.shc-verse summary::before { content: "▸"; transition: transform var(--dur-fast); display: inline-block; }
.shc-verse[open] summary::before { transform: rotate(90deg); }
.shc-verse summary::-webkit-details-marker { display: none; }
.shv-dev { font-size: 0.92rem; color: var(--ink); line-height: 1.7; margin: 8px 0 6px;
  padding: 8px 12px; background: rgba(212,168,67,0.06); border-left: 2px solid var(--gold); border-radius: 0 6px 6px 0; }
.shv-tr { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.4; font-style: italic; }
.shv-cite { font-size: 0.6rem; color: var(--gold); margin-top: 5px; }

/* mode toggle */
.sha-mode { display: flex; gap: 8px; margin-bottom: 18px; }
.sha-mode button { padding: 9px 20px; border-radius: 999px; background: transparent; border: 1px solid var(--glass-border);
  color: var(--ink-soft); cursor: pointer; font-family: var(--font-data); font-size: 0.8rem; font-weight: 600; }
.sha-mode button.on { background: var(--gold); color: #1a1407; border-color: var(--gold); }

/* niyam */
.niyam-principle { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 20px; max-width: 920px;
  border-left: 3px solid var(--gold); padding-left: 14px; }
.niyam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 8px; }
.niyam-card { background: var(--glass-fill); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 16px; }
.niyam-card.b-good { border-left: 3px solid var(--m-green); }
.niyam-card.b-bad { border-left: 3px solid var(--m-red); }
.niyam-card.b-mixed { border-left: 3px solid var(--m-amber); }
.niyam-h { display: block; color: var(--ink-faint); margin-bottom: 10px; }
.niyam-h.big { font-size: 0.62rem; color: var(--gold); margin: 24px 0 12px; letter-spacing: 0.18em; }
.niyam-src { color: var(--ink-faint); text-transform: none; letter-spacing: 0; font-size: 0.78em; margin-left: 6px; }
.niyam-table { display: flex; flex-direction: column; gap: 1px; }
.nt-head, .nt-row { display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr; gap: 8px; align-items: center; padding: 7px 6px; }
.nt-head { color: var(--ink-faint); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--glass-border); }
.nt-row { font-size: 0.8rem; border-radius: 6px; }
.nt-row:hover { background: rgba(255,255,255,0.03); }
.nt-p { font-weight: 600; color: var(--ink); }
.nt-row .gold { color: var(--gold); font-weight: 700; }
.nt-tag { font-size: 0.52rem; padding: 2px 7px; border-radius: 5px; text-align: center; text-transform: uppercase; letter-spacing: 0.05em; }
.nt-tag.ok { color: #93e2b3; background: rgba(46,139,87,0.16); }
.nt-tag.no { color: #ed9aa6; background: rgba(196,30,58,0.16); }
.niyam-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.niyam-chip { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--ink-soft);
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 7px; padding: 5px 9px; }
.niyam-chip i { font-style: normal; color: var(--gold); font-weight: 700; }
.niyam-age { display: flex; flex-direction: column; gap: 4px; }
.na-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 0.76rem; color: var(--ink-soft); }
.na-age { color: var(--gold); }
.nb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.nb-name { font-size: 1.02rem; color: var(--gold); font-weight: 600; line-height: 1.12; }
.nb-src { font-size: 0.58rem; color: var(--ink-faint); font-family: var(--font-ephem); white-space: nowrap; }
.niyam-card ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.niyam-card li { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.35; }
.nc-note { font-size: 0.76rem; color: var(--ink-soft); line-height: 1.42; margin: 0; }
.niyam-noremedy { margin-top: 20px; padding: 16px; border-radius: var(--r-md); background: rgba(196,30,58,0.07); border: 1px solid rgba(196,30,58,0.22); }
.nr-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.nr-chip { font-size: 0.7rem; color: #ed9aa6; background: rgba(196,30,58,0.12); border-radius: 6px; padding: 4px 10px; }
/* graha dignity table */
.dig-table { min-width: 720px; display: flex; flex-direction: column; gap: 1px; }
.dig-head, .dig-row { display: grid; grid-template-columns: 0.8fr 1fr 1fr 1.2fr 1.1fr 0.7fr 0.7fr 0.8fr; gap: 8px; align-items: center; padding: 8px 6px; }
.dig-head { color: var(--ink-faint); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.07em; border-bottom: 1px solid var(--glass-border); }
.dig-row { font-size: 0.74rem; color: var(--ink-soft); border-bottom: 1px solid rgba(255,255,255,0.03); }
.dig-row:hover { background: rgba(255,255,255,0.02); }
.dig-p { color: var(--gold); font-weight: 600; }
.dig-nat { font-size: 0.62rem; padding: 2px 8px; border-radius: 20px; text-align: center; }
.dig-nat.benefic { color: #93e2b3; background: rgba(46,139,87,0.16); }
.dig-nat.malefic { color: #ed9aa6; background: rgba(196,30,58,0.16); }
.dig-nat.variable { color: var(--gold); background: rgba(212,168,67,0.14); }
