.fortune-jyotish {
  padding: clamp(12px, 2.5vw, 28px);
  border: 1px solid #cfe3d7;
  border-radius: 16px;
  background: #fbfffd;
}

.fortune-jyotish form,
.jyotish-reading {
  max-width: 55rem;
  margin-inline: auto;
}

.jyotish-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 12px;
}

.jyotish-inputs label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-weight: 600;
}

.jyotish-inputs :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 1rem;
}

.jyotish-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
}

.jyotish-toolbar #action {
  font-weight: 700;
}

.jyotish-audio summary {
  min-height: 44px;
  align-content: center;
  cursor: pointer;
}

.jyotish-audio > div {
  display: grid;
  grid-template-columns: auto minmax(5rem, 8rem);
  align-items: center;
  gap: 4px 8px;
  padding: 8px;
  border: 1px solid #cfe3d7;
  border-radius: 8px;
}

.jyotish-audio label:last-of-type,
.jyotish-audio #fortune-audio-notice {
  grid-column: 1 / -1;
}

.fortune-jyotish :is(#fortune-audio-notice, #jyotish-error, #journal-note):empty {
  display: none;
}

.fortune-jyotish #jyotish-error {
  color: #932e28;
}

.jyotish-progress {
  margin: 14px auto;
  max-width: 55rem;
  padding: 12px;
  border-left: 3px solid #50756a;
  background: #edf6ef;
}

.jyotish-reading {
  padding-top: 20px;
  overflow-wrap: anywhere;
}

.jyotish-reading :is(h3, h4, h5, p) {
  margin: 0 0 8px;
}

.jyotish-birth,
.jyotish-interval,
.jyotish-figure figcaption {
  color: #425b51;
  font-size: .9rem;
}

.jyotish-nakshatra {
  padding: 10px 14px;
  margin: 12px 0 16px;
  border: 1px solid #dccaa4;
  border-radius: 12px;
  background: #fff8e8;
}

.jyotish-nakshatra p:last-child {
  margin-bottom: 0;
}

.jyotish-nakshatra-name {
  font-weight: 700;
}

.jyotish-chart-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: start;
  gap: 16px;
  margin-bottom: 24px;
}

.jyotish-figure {
  margin: 0;
  text-align: center;
}

.jyotish-chart {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 auto 8px;
  border: 1px solid #987744;
  border-radius: 8px;
  box-sizing: border-box;
  background: #fbf5e6;
}

.jyotish-chart polygon {
  fill: #fbf5e6;
  stroke: #987744;
  stroke-width: 1;
}

.jyotish-chart .jyotish-asc-house {
  fill: #e7f1e8;
}

.jyotish-chart .jyotish-period-house {
  fill: #f6dfa2;
}

.jyotish-chart text {
  fill: #4a3820;
  text-anchor: middle;
  font-size: 12px;
}

.jyotish-chart .jyotish-house-bodies {
  fill: #163d33;
  font-size: 14px;
  font-weight: 700;
}

.jyotish-positions {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.jyotish-positions caption {
  margin-bottom: 4px;
  text-align: start;
  font-weight: 700;
}

.jyotish-positions :is(th, td) {
  padding: 5px 4px;
  border-bottom: 1px solid #d9e5db;
  text-align: start;
}

.jyotish-positions thead {
  background: #edf6ef;
}

.jyotish-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 7px;
  margin: 10px 0;
}

.jyotish-timeline .jyotish-period {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  min-height: 88px;
  padding: 6px;
  border: 2px solid #bad0c2;
  border-radius: 8px;
  color: #203b32;
  background: #f5faf6;
  text-align: center;
}

.jyotish-timeline .jyotish-period[aria-pressed="true"] {
  border-color: #896327;
  color: #49361a;
  background: #fff0c9;
}

.jyotish-timeline .jyotish-period:focus-visible {
  outline: 2px solid #295e91;
  outline-offset: 2px;
}

.jyotish-period-dates {
  display: grid;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.jyotish-period-dates time:last-child::before {
  content: "〜 ";
}

.jyotish-period-current {
  font-size: .75rem;
  font-weight: 700;
}

.jyotish-dasha-detail {
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid #cfe3d7;
  border-radius: 10px;
  background: #f3faf5;
  line-height: 1.65;
}

.jyotish-dasha-detail h5 {
  margin: 10px 0 4px;
  font-size: 1rem;
}

.jyotish-dasha-detail ul {
  margin: 0 0 10px;
  padding-inline-start: 1.4em;
}

.jyotish-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fortune-frame[data-jyotish-reading] {
  height: auto !important;
  min-height: 0;
  overflow: visible;
}

.fortune-frame[data-jyotish-reading] :is(#fortune-canvas, #canvas-access, #fortune-state) {
  display: none;
}

.jyotish-journal-detail {
  min-width: 0;
  padding: clamp(2px, 1vw, 10px);
}

@media (prefers-reduced-motion: no-preference) {
  .fortune-jyotish .jyotish-reading {
    animation: jyotish-appear 220ms ease-out both;
  }
}

@keyframes jyotish-appear {
  from { opacity: .25; }
  to { opacity: 1; }
}
