:root {
  --pan-bg: #f7f5fb;
  --pan-card: #ffffff;
  --pan-ink: #242038;
  --pan-muted: #665f78;
  --pan-purple: #5c277b;
  --pan-purple-dark: #3d1459;
  --pan-gold: #e69b24;
  --pan-gold-soft: #fff3d9;
  --pan-border: #e8dfef;
  --pan-shadow: 0 18px 46px rgba(52, 25, 69, 0.09);
}

.panchanga-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 72px;
  color: var(--pan-ink);
}

.panchanga-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 6vw, 66px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 203, 82, 0.34), transparent 28%),
    radial-gradient(circle at 12% 92%, rgba(196, 133, 222, 0.32), transparent 30%),
    linear-gradient(135deg, #3b1054 0%, #692f86 58%, #8c4f88 100%);
  color: #fff;
  box-shadow: var(--pan-shadow);
  text-align: center;
}

.panchanga-hero::before,
.panchanga-hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.panchanga-hero::before { width: 340px; height: 340px; right: -170px; top: -170px; }
.panchanga-hero::after { width: 230px; height: 230px; left: -115px; bottom: -115px; }

.panchanga-eyebrow {
  margin: 0 0 10px;
  color: #ffd985;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.panchanga-hero h1 {
  position: relative;
  margin: 0;
  color: #fff;
  font-size: clamp(2.25rem, 7vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.panchanga-intro {
  position: relative;
  max-width: 760px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, .9);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.panchanga-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, .7fr) auto;
  gap: 12px;
  max-width: 900px;
  margin: 30px auto 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
}

.panchanga-field { text-align: left; }
.panchanga-field label {
  display: block;
  margin: 0 0 6px 3px;
  color: rgba(255, 255, 255, .82);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.panchanga-field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  color: #2d1b37;
  font: inherit;
  outline: none;
}

.panchanga-field input:focus {
  border-color: #ffd36e;
  box-shadow: 0 0 0 3px rgba(255, 211, 110, .27);
}

.panchanga-submit,
.panchanga-location {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.panchanga-submit {
  align-self: end;
  padding: 11px 22px;
  background: linear-gradient(135deg, #ffd66f, #f0a62e);
  color: #38220a;
  box-shadow: 0 8px 22px rgba(25, 8, 35, .24);
}

.panchanga-location {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  background: transparent;
  color: #fff;
}

.panchanga-submit:hover,
.panchanga-location:hover { transform: translateY(-1px); }
.panchanga-submit:focus-visible,
.panchanga-location:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.panchanga-submit:disabled,
.panchanga-location:disabled { cursor: wait; opacity: .64; transform: none; }

.panchanga-status {
  min-height: 28px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .94);
  font-size: .92rem;
}
.panchanga-status[data-state="error"] { color: #ffe5e3; font-weight: 700; }

.panchanga-results { margin-top: 26px; }
.panchanga-summary,
.panchanga-panel,
.panchanga-info {
  border: 1px solid var(--pan-border);
  border-radius: 22px;
  background: var(--pan-card);
  box-shadow: var(--pan-shadow);
}

.panchanga-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
}

.panchanga-summary h2 { margin: 0; color: var(--pan-purple-dark); font-size: clamp(1.35rem, 3.4vw, 2rem); }
.panchanga-summary p { margin: 6px 0 0; color: var(--pan-muted); }
.panchanga-basis {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--pan-gold-soft);
  color: #734813;
  font-size: .84rem;
  font-weight: 750;
  text-align: center;
}

.panchanga-limbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.panchanga-limb {
  min-width: 0;
  padding: 22px 18px 18px;
  border: 1px solid var(--pan-border);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fbf9fd);
  box-shadow: 0 10px 28px rgba(52, 25, 69, .07);
}

.panchanga-limb-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 15px;
  border-radius: 50%;
  background: #f0e5f5;
  color: var(--pan-purple);
  font-size: .78rem;
  font-weight: 900;
}

.panchanga-limb-label {
  margin: 0 0 7px;
  color: var(--pan-muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panchanga-limb-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--pan-purple-dark);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.22;
}

.panchanga-limb-detail {
  min-height: 2.7em;
  margin: 7px 0 0;
  color: var(--pan-muted);
  font-size: .86rem;
}

.panchanga-progress {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8f1;
}
.panchanga-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pan-gold), var(--pan-purple)); }

.panchanga-panel { margin-top: 16px; padding: clamp(22px, 4vw, 34px); }
.panchanga-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panchanga-panel h2,
.panchanga-info h2 { margin: 0; color: var(--pan-purple-dark); font-size: clamp(1.35rem, 3vw, 1.8rem); }
.panchanga-panel-head p { margin: 0; color: var(--pan-muted); font-size: .9rem; }

.panchanga-timelines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panchanga-timeline {
  padding: 18px;
  border: 1px solid var(--pan-border);
  border-radius: 16px;
  background: #fcfbfd;
}
.panchanga-timeline h3 { margin: 0 0 13px; color: var(--pan-purple); font-size: 1rem; }
.panchanga-timeline ol { margin: 0; padding: 0; list-style: none; }
.panchanga-timeline li { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 9px 0 9px 18px; color: var(--pan-muted); }
.panchanga-timeline li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--pan-gold); box-shadow: 0 0 0 4px #fff0d0; }
.panchanga-timeline li + li { border-top: 1px dashed #e7ddec; }
.panchanga-timeline time { color: #7b5220; font-weight: 800; font-variant-numeric: tabular-nums; }
.panchanga-timeline strong { color: var(--pan-ink); }

.panchanga-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.panchanga-fact { padding: 17px; border-radius: 15px; background: #f8f3fb; }
.panchanga-fact span { display: block; color: var(--pan-muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.panchanga-fact strong { display: block; margin-top: 6px; color: var(--pan-purple-dark); font-size: 1rem; }

.panchanga-info { margin-top: 16px; padding: clamp(24px, 5vw, 40px); }
.panchanga-info > p { color: var(--pan-muted); }
.panchanga-definition-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.panchanga-definition { padding: 16px; border-left: 3px solid var(--pan-gold); border-radius: 0 12px 12px 0; background: #fbf8fd; }
.panchanga-definition h3 { margin: 0 0 6px; color: var(--pan-purple); font-size: .95rem; }
.panchanga-definition p { margin: 0; color: var(--pan-muted); font-size: .86rem; }
.panchanga-method { margin-top: 24px; padding: 18px; border-radius: 14px; background: var(--pan-gold-soft); color: #654111; font-size: .92rem; }
.panchanga-internal-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.panchanga-internal-links a { padding: 9px 13px; border: 1px solid #d9c8e2; border-radius: 999px; color: var(--pan-purple); text-decoration: none; font-weight: 750; font-size: .88rem; }
.panchanga-internal-links a:hover { background: #f4ecf8; }

.panchanga-error-box { margin-top: 16px; padding: 18px; border: 1px solid #eac5c2; border-radius: 15px; background: #fff4f3; color: #8a2e27; }

@media (max-width: 980px) {
  .panchanga-limbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panchanga-definition-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panchanga-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .panchanga-shell { width: min(100% - 20px, 1120px); margin-top: 18px; }
  .panchanga-hero { padding: 28px 16px; border-radius: 21px; }
  .panchanga-form { grid-template-columns: 1fr; padding: 12px; }
  .panchanga-submit { width: 100%; }
  .panchanga-summary { align-items: flex-start; flex-direction: column; padding: 20px; }
  .panchanga-basis { max-width: none; }
  .panchanga-limbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panchanga-timelines { grid-template-columns: 1fr; }
  .panchanga-panel-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .panchanga-definition-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .panchanga-limbs,
  .panchanga-facts { grid-template-columns: 1fr; }
  .panchanga-limb { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 13px; }
  .panchanga-limb-number { grid-row: 1 / span 3; margin: 0; }
  .panchanga-progress { grid-column: 2; }
  .panchanga-timeline li { grid-template-columns: 76px minmax(0, 1fr); padding-left: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .panchanga-submit,
  .panchanga-location { transition: none; }
}

/* Match the established Brahma-muhurta page visual system. */
:root {
  --pan-bg: #f5f9ff;
  --pan-card: #ffffff;
  --pan-ink: #1a237e;
  --pan-muted: #546e7a;
  --pan-purple: #7b1fa2;
  --pan-purple-dark: #4a0072;
  --pan-gold: #ffb300;
  --pan-gold-soft: #fff3e0;
  --pan-border: #f3e5f5;
  --pan-shadow: 0 10px 28px rgba(74, 0, 114, .07);
}

.panchanga-shell {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto 72px;
  padding: 0 20px;
  color: var(--pan-ink);
}

.panchanga-start { margin: 44px 0; }

.panchanga-section-title {
  position: relative;
  margin: 0 0 16px;
  padding-bottom: 10px;
  color: var(--pan-purple-dark);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 500;
  text-align: left;
}

.panchanga-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 90px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pan-purple), #ff9800);
}

.panchanga-hero {
  overflow: visible;
  padding: 22px;
  border: 1px solid var(--pan-border);
  border-radius: 14px;
  background: var(--pan-card);
  color: var(--pan-ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .06);
  text-align: left;
}

.panchanga-hero::before,
.panchanga-hero::after { display: none; }

.panchanga-eyebrow {
  margin: 0 0 7px;
  color: #7e57c2;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.panchanga-intro {
  max-width: 820px;
  margin: 0;
  color: #37474f;
  font-size: 1.05rem;
}

.panchanga-form {
  grid-template-columns: minmax(0, 1.5fr) minmax(170px, .7fr) auto;
  max-width: none;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.panchanga-field label {
  margin: 0 0 6px;
  color: #7e57c2;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.panchanga-field input {
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid rgba(123, 31, 162, .18);
  border-radius: 12px;
  background: #fff;
  color: #263238;
}

.panchanga-field input:focus {
  border-color: rgba(123, 31, 162, .5);
  box-shadow: 0 0 0 4px rgba(123, 31, 162, .12);
}

.panchanga-submit,
.panchanga-location {
  border-radius: 12px;
  font-weight: 600;
}

.panchanga-submit {
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--pan-gold), #ff9800);
  color: #1a237e;
  box-shadow: 0 10px 22px rgba(255, 179, 0, .28);
}

.panchanga-location {
  margin-top: 12px;
  padding: 12px 16px;
  border: 0;
  background: linear-gradient(135deg, var(--pan-purple), var(--pan-purple-dark));
  color: #fff;
  box-shadow: 0 10px 22px rgba(123, 31, 162, .22);
}

.panchanga-submit:focus-visible,
.panchanga-location:focus-visible {
  outline: 3px solid rgba(123, 31, 162, .28);
  outline-offset: 3px;
}

.panchanga-status {
  min-height: 0;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(123, 31, 162, .12);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff3e0, #f3e5f5);
  color: var(--pan-purple-dark);
  font-size: .98rem;
}

.panchanga-status[data-state="error"] {
  background: linear-gradient(135deg, #ffebee, #f3e5f5);
  color: #8a2e27;
}

.panchanga-results { margin-top: 44px; }

.panchanga-summary,
.panchanga-panel,
.panchanga-info {
  border: 1px solid var(--pan-border);
  border-radius: 14px;
  background: var(--pan-card);
  box-shadow: var(--pan-shadow);
}

.panchanga-summary { padding: 22px; }
.panchanga-summary h2 { color: var(--pan-purple-dark); font-weight: 600; }
.panchanga-summary p { color: var(--pan-muted); }

.panchanga-basis {
  border: 1px solid rgba(123, 31, 162, .12);
  background: linear-gradient(135deg, #fff3e0, #f3e5f5);
  color: var(--pan-purple-dark);
}

.panchanga-limbs { gap: 14px; margin: 16px 0; }

.panchanga-limb {
  padding: 20px 18px 18px;
  border: 1px solid var(--pan-border);
  border-top: 4px solid var(--pan-purple);
  border-radius: 14px;
  background: var(--pan-card);
  box-shadow: var(--pan-shadow);
}

.panchanga-limb-number {
  background: rgba(123, 31, 162, .1);
  color: var(--pan-purple-dark);
}

.panchanga-limb-label,
.panchanga-limb-detail { color: var(--pan-muted); }
.panchanga-limb-value { color: var(--pan-purple-dark); }
.panchanga-progress { background: #f3e5f5; }
.panchanga-progress span { background: linear-gradient(90deg, var(--pan-purple), #ff9800); }

.panchanga-panel { margin-top: 16px; padding: 22px; }
.panchanga-panel h2,
.panchanga-info h2 { color: var(--pan-purple-dark); font-weight: 600; }
.panchanga-panel-head p { color: var(--pan-muted); }

.panchanga-timeline {
  border: 1px solid rgba(123, 31, 162, .14);
  border-radius: 12px;
  background: #fff;
}

.panchanga-timeline h3 { color: var(--pan-purple-dark); }
.panchanga-timeline li { color: var(--pan-muted); }
.panchanga-timeline li::before {
  background: var(--pan-purple);
  box-shadow: 0 0 0 4px #f3e5f5;
}
.panchanga-timeline time { color: #7e57c2; }
.panchanga-timeline strong { color: #263238; }

.panchanga-fact {
  border: 1px solid rgba(123, 31, 162, .1);
  background: linear-gradient(135deg, #fff3e0, #f3e5f5);
}
.panchanga-fact span { color: #7e57c2; }
.panchanga-fact strong { color: var(--pan-purple-dark); }

.panchanga-info { margin-top: 44px; padding: 22px; }
.panchanga-info h2 {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 10px;
}
.panchanga-info h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 90px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pan-purple), #ff9800);
}
.panchanga-info > p { color: var(--pan-muted); }

.panchanga-definition {
  border-left: 4px solid var(--pan-purple);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(74, 0, 114, .06);
}
.panchanga-definition h3 { color: var(--pan-purple-dark); }
.panchanga-definition p { color: var(--pan-muted); }

.panchanga-internal-links { margin-top: 22px; }
.panchanga-internal-links a {
  padding: 9px 13px;
  border: 1px solid rgba(123, 31, 162, .22);
  border-radius: 10px;
  background: #fff;
  color: var(--pan-purple-dark);
  font-weight: 600;
}
.panchanga-internal-links a:hover,
.panchanga-internal-links a:focus-visible {
  background: #f3e5f5;
  outline: none;
}

.panchanga-error-box {
  border-radius: 12px;
  background: linear-gradient(135deg, #ffebee, #f3e5f5);
}

@media (max-width: 700px) {
  .panchanga-shell { width: 100%; margin-top: 0; padding: 0 15px; }
  .panchanga-start { margin: 36px 0; }
  .panchanga-hero { padding: 20px; border-radius: 14px; }
  .panchanga-form { grid-template-columns: 1fr; padding: 0; }
  .panchanga-location { width: 100%; }
  .panchanga-summary,
  .panchanga-panel,
  .panchanga-info { padding: 20px; }
}
