.period-page {
  max-width: 100%;
}

body:has(.period-page) {
  overflow-x: hidden;
}

.period-page .calc-hero {
  margin-bottom: 20px;
}

.period-page .calc-layout {
  margin-top: 0;
}

.period-calculator-card {
  min-width: 0;
}

.period-result,
.period-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.period-form-message {
  min-height: 1.6em;
  margin: 8px 0 0;
  color: #b45309;
  font-size: 0.9rem;
}

.period-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.period-result-card {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.period-result-card .period-result-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.period-result-card strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.period-result-hijri,
.period-date-hijri {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.period-result-card.is-highlight {
  border: 2px solid var(--primary);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.1);
}

.period-summary {
  margin-top: 14px;
}

.period-table-wrap {
  margin-top: 20px;
  overflow-x: hidden;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 12px;
  background: #fff;
}

.period-table-wrap h3 {
  margin: 0;
  padding: 13px 14px;
  color: var(--primary-dark);
  font-size: 1rem;
}

.period-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.period-table th,
.period-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  text-align: right;
  overflow-wrap: anywhere;
}

.period-table th:first-child,
.period-table td:first-child {
  width: 34%;
}

.period-table th {
  color: var(--muted);
  font-weight: 700;
}

.period-table td {
  color: var(--primary-dark);
  font-weight: 700;
}

.period-result-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.period-actions .btn {
  width: auto;
  flex: 1 1 150px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.period-secondary-btn {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  box-shadow: none;
}

.period-secondary-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.period-copy-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--primary-dark);
  font-size: 0.86rem;
  text-align: center;
}

.period-content-figure {
  margin: 28px auto 22px;
  max-width: 800px;
  text-align: center;
}

.period-content-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.period-content-figure figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.88rem;
}

.period-source-list {
  margin: 0;
  padding-right: 22px;
}

.period-source-list li {
  margin-bottom: 8px;
}

.period-source-list a {
  font-weight: 700;
}

.period-page .faq-section {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

@media (max-width: 900px) {
  .period-page .calc-card-premium {
    order: 1;
  }

  .period-page .calc-aside {
    order: 2;
  }
}

@media (max-width: 560px) {
  .period-result-grid {
    grid-template-columns: 1fr;
  }

  .period-result-card {
    text-align: right;
  }

  .period-result-card strong {
    font-size: 0.98rem;
  }

  .period-table {
    font-size: 0.82rem;
  }

  .period-table th,
  .period-table td {
    padding: 9px 7px;
  }

  .period-table th:first-child,
  .period-table td:first-child {
    width: 30%;
  }
}
