/* Kundali Milan and Panchang. Rides on styles.css for the palette and the
   .card / .field / .primary / .suggest primitives; only what is specific to
   these two screens lives here. */

/* ---------- entry cards on the home screen ---------- */
.tool-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 4px 0 8px;
}
.tool-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.tool-card:hover {
  background: rgba(240, 198, 116, 0.09);
  border-color: rgba(240, 198, 116, 0.4);
  transform: translateY(-1px);
}
a.tool-card { text-decoration: none; }
/* The fifth card (Vrat & Tyohar) spans the row, so the 2-column phone grid stays even. */
.tool-card-wide { grid-column: 1 / -1; }
.tool-icon { font-size: 19px; line-height: 1; }
.tool-name { font-size: 14.5px; font-weight: 600; color: var(--gold-soft); }
.tool-sub { font-size: 12px; color: var(--ink-faint); }

/* ---------- shared tool screen shell ---------- */
#stage-milan, #stage-panchang { flex-direction: column; overflow-y: auto; }
.tool-inner {
  width: min(940px, 94vw);
  margin: 0 auto;
  padding: clamp(20px, 4vh, 40px) 0 48px;
}
.tool-inner > h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 4vw, 36px);
  color: var(--gold-soft); letter-spacing: 0.04em; margin: 0 0 6px; text-align: center;
}
.tool-inner > .tagline { text-align: center; margin: 0 auto 24px; max-width: 56ch; }
.tool-inner > .primary { width: min(340px, 100%); margin: 0 auto; display: block; }
.tool-inner > .error { text-align: center; }

/* ---------- milan ---------- */
.milan-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.milan-card h2 {
  font-family: var(--serif); font-weight: 400; font-size: 19px;
  color: var(--gold); margin: 0 0 14px; letter-spacing: 0.05em;
}
/* The suggestion list must escape the card, not be clipped by it. */
.milan-card .place { position: relative; }

.milan-score {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin: 26px 0 18px; padding: 20px 24px;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.ms-num { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--gold-soft); }
.ms-num span { font-size: 17px; color: var(--ink-faint); margin-left: 6px; }
.ms-meta { flex: 1 1 220px; min-width: 0; }
.ms-verdict { font-size: 16px; margin-bottom: 8px; }
.ms-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,0.09); overflow: hidden; }
.ms-bar i { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.milan-score.good  .ms-bar i { background: var(--green); }
.milan-score.good  .ms-verdict { color: var(--green); }
.milan-score.ok    .ms-verdict { color: var(--gold); }
.milan-score.poor  .ms-bar i { background: var(--rose); }
.milan-score.poor  .ms-verdict { color: var(--rose); }
.ms-note { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }

.koota-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.koota-table td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.kt-name { width: 8.5rem; color: var(--gold-soft); font-size: 14px; white-space: nowrap; }
.kt-score { width: 5rem; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.kt-score.zero { color: var(--rose); }
.kt-note { font-size: 13px; color: var(--ink-dim); line-height: 1.55; }

.milan-extra h3 { margin: 0 0 10px; font-size: 15px; color: var(--gold-soft); }
.milan-extra ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-dim); }
.milan-extra li { margin-bottom: 5px; }
.warn-line { color: var(--rose); font-size: 13px; margin: 12px 0 0; line-height: 1.55; }
.muted-line { color: var(--ink-faint); font-size: 12.5px; margin: 12px 0 0; line-height: 1.55; }

/* ---------- panchang ---------- */
/* .card's backdrop-filter makes each card its own stacking context, so the result
   cards below a tool's form painted over the form's city suggestions: once a
   Panchang was on screen, a city could not be picked on a phone. */
#panchang-form, #muhurat-form, #choghadiya-form { position: relative; z-index: 5; }
.pa-card { margin-bottom: 14px; padding: 20px 22px; }
.pa-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pa-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: 21px;
  color: var(--gold-soft); margin: 0 0 3px; letter-spacing: 0.03em;
}
.pa-sun { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); text-align: right; }

.pa-limbs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-top: 18px;
}
.pa-limbs h4 {
  margin: 0 0 6px; font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
}
.limb-line { font-size: 13.5px; margin-bottom: 3px; }
.limb-line span { color: var(--ink-faint); font-size: 12px; margin-left: 6px; }

.pa-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--gold-soft); }
.pa-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.pa-times > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 13px;
}
.pa-times b { font-family: var(--mono); font-size: 12.5px; }
.pa-times .bad  { border-color: rgba(240, 112, 140, 0.32); color: var(--rose); }
.pa-times .good { border-color: rgba(111, 211, 154, 0.32); color: var(--green); }
.pa-times span { color: var(--ink-dim); }
/* DIVASTRO-111: the date's vrat/festivals with their puja muhurat, parana, moonrise… */
.pa-vrat-item + .pa-vrat-item { margin-top: 14px; }
.pa-vrat-item h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; }
.pa-vrat-item h4 a { color: var(--gold); text-decoration: none; }
.pa-vrat-item h4 a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .ms-num { font-size: 38px; }
  .kt-name { width: auto; white-space: normal; }
  .koota-table td { padding: 9px 6px; }
  .pa-sun { text-align: left; }
}

/* Choghadiya: a four-column table does not fit a phone, and scrolling sideways
   hid the advice column with no sign it was there. Each slot becomes a card. */
@media (max-width: 700px) {
  #choghadiya-result thead { display: none; }
  #choghadiya-result table,
  #choghadiya-result tbody,
  #choghadiya-result tr,
  #choghadiya-result td { display: block; width: 100%; }
  #choghadiya-result tr { padding: 10px 6px; }
  #choghadiya-result td { padding: 2px 4px !important; }
  #choghadiya-result td:first-child { font-size: 15px; }
}

/* ---------- home: Today strip and sample answer (DIVASTRO-101) ----------
   Both sit inside .home-inner, which is centred text; these are read left to
   right like a card. Same double gold frame as the tool cards, so they read as
   part of the page rather than an advert dropped into it. */
.today-strip, .sample-qa {
  width: 100%; max-width: 560px; margin: 0 auto 16px; text-align: left;
  background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: 18px;
  box-shadow: 0 8px 22px var(--frame-glow), inset 0 0 0 4px var(--card-bg), inset 0 0 0 5px rgba(var(--gold-rgb), 0.28);
}
.today-strip[hidden], .sample-qa[hidden] { display: none; }

.today-strip { padding: 8px 10px 6px; }
/* Every child of .home-inner is its own z-index:1 layer (styles.css), so the city
   suggestions would slide UNDER the tool cards that follow. Lift the strip. */
.sacred .home-inner > .today-strip { z-index: 3; }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.today-title {
  font-family: var(--serif); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold);
}
.today-city {
  min-height: 44px; padding: 0 6px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--ink-dim); text-decoration: underline dotted rgba(var(--gold-rgb), 0.7);
  text-underline-offset: 4px;
}
.today-city .caret { color: var(--gold); text-decoration: none; display: inline-block; }
.today-picker { position: relative; padding: 0 4px 6px; }
.today-picker input { width: 100%; }

/* The tappable body: three facts and a chevron. Its height is fixed by the
   label line plus a reserved value line, so the skeleton and the loaded strip
   are the same size and nothing below moves when the numbers arrive. */
.today-body {
  display: grid; grid-template-columns: 1.3fr 1fr 1.1fr auto; align-items: start; gap: 8px;
  width: 100%; min-height: 56px; padding: 6px 4px 6px; margin: 0;
  background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.today-body:hover { background: rgba(var(--gold-rgb), 0.06); }
.today-body:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.today-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.today-cell small { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.02em; }
.today-cell b {
  font-size: 14.5px; font-weight: 600; color: var(--gold-soft); line-height: 1.25;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-height: 1.25em;
}
.today-cell.bad b { color: var(--rose); }
.today-cell.bad.now b { text-decoration: underline; text-underline-offset: 3px; }
.today-body .go { align-self: center; font-size: 22px; line-height: 1; color: var(--gold); }

/* Skeleton: soft gold bars where the values will be. */
.today-strip.loading .today-cell b {
  width: 80%; border-radius: 6px;
  background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.12), rgba(var(--gold-rgb), 0.3), rgba(var(--gold-rgb), 0.12));
  background-size: 200% 100%; animation: today-shimmer 1.6s linear infinite;
}
@keyframes today-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .today-strip.loading .today-cell b { animation: none; } }

/* Sample question and answer */
.sample-qa { padding: 14px 16px 10px; margin-top: 8px; }
.sample-tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--pill-ink); background: var(--pill-bg); border: 1px solid var(--pill-edge); border-radius: 999px; padding: 2px 10px;
}
.sample-q {
  margin: 10px 0 8px; margin-left: auto; max-width: 88%; width: fit-content;
  padding: 8px 12px; border-radius: 14px 14px 4px 14px;
  background: var(--user-bubble); border: 1px solid rgba(var(--gold-rgb), 0.6); color: var(--ink); font-size: 14.5px;
}
.sample-a { border-left: 4px solid #b3172f; padding: 2px 0 2px 12px; }
.sample-a p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.sample-note { display: block; font-size: 12.5px; color: var(--ink-faint); }
.sample-cta {
  display: block; margin: 8px 0 0 auto; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--gold-soft);
}
.sample-cta:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Short phones (360x640 is the most common budget Android): the blurb repeats
   what the tagline and the button already say, and its three lines are exactly
   what kept the Today strip below the fold. */
@media (max-width: 700px) and (max-height: 700px) {
  #stage-home .home-blurb { display: none; }
}

@media (max-width: 380px) {
  .today-body { grid-template-columns: 1.2fr 1fr 1.1fr auto; gap: 6px; }
  .today-cell b { font-size: 14px; }
}
