/* Farsi Bible account and progress interface v0.4 */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.account-form {
  display: grid;
  gap: 1rem;
}

.account-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.account-form input[type="email"],
.account-form input[type="password"],
.account-form input[type="text"] {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid #b7c4ce;
  border-radius: 0.7rem;
  font: inherit;
}

.account-form input:focus {
  outline: 3px solid rgba(47, 93, 124, 0.2);
  border-color: #2f5d7c;
}

.account-form button:disabled,
.account-status-panel button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.account-check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
}

.account-check input {
  width: auto;
}

.account-help,
.account-message {
  margin: 0.15rem 0;
  color: #52606d;
}

.account-message {
  white-space: pre-line;
}

.account-message.is-error {
  color: #a61b1b;
  font-weight: 700;
}

.account-status-panel,
.account-privacy-panel {
  margin: 1.5rem 0;
}

.progress-section-heading,
.progress-list-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.75rem;
}

.progress-section-heading h2,
.progress-list-heading h2 {
  margin-bottom: 0.35rem;
}

.progress-section-heading p:last-child,
.progress-list-heading p:last-child {
  margin-top: 0.35rem;
  color: #52606d;
}

.progress-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.75rem;
}

.progress-stat {
  display: grid;
  gap: 0.35rem;
}

.progress-stat span {
  color: #52606d;
}

.progress-stat strong {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  color: #17324d;
}

.progress-mastery-section {
  margin: 2rem 0;
}

.mastery-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.mastery-stage-card {
  --stage-background: #f5f7fa;
  --stage-border: #c5d0d8;
  --stage-badge: #687684;
  border: 1px solid var(--stage-border);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--stage-background);
  box-shadow: 0 0.35rem 1rem rgba(23, 50, 77, 0.06);
}

.mastery-stage-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 5.4rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.mastery-stage-card > summary::-webkit-details-marker {
  display: none;
}

.mastery-stage-card > summary::after {
  content: "＋";
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  color: #52606d;
  font-size: 0.95rem;
}

.mastery-stage-card[open] > summary::after {
  content: "−";
}

.mastery-stage-label {
  display: grid;
  gap: 0.2rem;
  padding-right: 1.5rem;
}

.mastery-stage-label strong {
  color: #17324d;
  font-size: 1.05rem;
}

.mastery-stage-label small {
  color: #52606d;
  line-height: 1.35;
}

.mastery-stage-count {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  min-width: 2rem;
  text-align: right;
  color: #17324d;
  font-size: 1.35rem;
  font-weight: 800;
}

.mastery-stage-content {
  max-height: 24rem;
  overflow: auto;
  border-top: 1px solid var(--stage-border);
  background: rgba(255, 255, 255, 0.72);
}

.mastery-stage-list {
  display: grid;
}

.mastery-stage-word {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid rgba(197, 208, 216, 0.7);
}

.mastery-stage-word:last-child {
  border-bottom: 0;
}

.mastery-stage-word-rank,
.mastery-stage-word-score {
  color: #687684;
  font-size: 0.82rem;
  font-weight: 700;
}

.mastery-stage-word-score {
  text-align: right;
}

.mastery-stage-word-text {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.mastery-stage-word-text strong {
  color: #17324d;
}

.mastery-stage-word-text span {
  color: #52606d;
  font-size: 0.9rem;
}

.mastery-stage-empty {
  margin: 0;
  padding: 1rem;
  color: #687684;
}

.mastery-stage-5 {
  --stage-background: #e7f5e9;
  --stage-border: #8abb96;
  --stage-badge: #247a3d;
}

.mastery-stage-4 {
  --stage-background: #eff7d8;
  --stage-border: #aecb6d;
  --stage-badge: #668c24;
}

.mastery-stage-3 {
  --stage-background: #fff9d8;
  --stage-border: #e7ca50;
  --stage-badge: #d2a600;
}

.mastery-stage-2 {
  --stage-background: #fff0d8;
  --stage-border: #e7ad61;
  --stage-badge: #b76417;
}

.mastery-stage-1 {
  --stage-background: #fde7e7;
  --stage-border: #dc8b8b;
  --stage-badge: #b32929;
}

.mastery-stage-0 {
  --stage-background: #eef1f4;
  --stage-border: #bcc5cd;
  --stage-badge: #687684;
}

.mastery-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  color: #fff;
  background: #687684;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.mastery-badge-5 { background: #247a3d; }
.mastery-badge-4 { background: #6d9228; }
.mastery-badge-3 { background: #d2a600; color: #fff; }
.mastery-badge-2 { background: #c66c18; }
.mastery-badge-1 { background: #bd3030; }
.mastery-badge-0 { background: #737f8b; }

.progress-list-panel {
  margin-top: 2rem;
}

.progress-list-heading {
  margin-top: 0;
}

.progress-list-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 1.2rem 0;
  padding: 0.85rem;
  border-radius: 0.85rem;
  background: #f5f7fa;
}

.progress-list-key > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #52606d;
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-list-key .mastery-badge {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.82rem;
}

.progress-list-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 1.2rem 0 0.9rem;
}

.progress-list-view-label {
  color: #52606d;
  font-weight: 800;
}

.progress-list-view-buttons {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.28rem;
  border: 1px solid #c5d0d8;
  border-radius: 0.8rem;
  background: #f5f7fa;
}

.progress-view-button {
  min-height: 2.45rem;
  padding: 0.48rem 0.95rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #2f5d7c;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.progress-view-button:hover {
  background: #e5edf4;
}

.progress-view-button:focus-visible {
  outline: 3px solid rgba(47, 93, 124, 0.28);
  outline-offset: 2px;
}

.progress-view-button.is-active {
  background: #2f5d7c;
  color: #fff;
  box-shadow: 0 0.12rem 0.32rem rgba(23, 50, 77, 0.18);
}

.progress-metric-explainer {
  margin: 0.9rem 0 1.1rem;
  padding: 1rem 1.05rem;
  border: 1px solid #c9d8e3;
  border-left: 0.34rem solid #2f5d7c;
  border-radius: 0.85rem;
  background: #f5f9fc;
}

.progress-metric-explainer h3 {
  margin: 0 0 0.55rem;
  color: #17324d;
  font-size: 1rem;
}

.progress-metric-explainer p {
  margin: 0.35rem 0;
  color: #52606d;
  line-height: 1.55;
}

.progress-list-instruction {
  margin: 0.65rem 0 0.9rem;
  color: #52606d;
  font-size: 0.9rem;
}

.progress-unit-list {
  display: grid;
  gap: 0.55rem;
}

.progress-unit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem 0.85rem;
  border: 1px solid #d9e1e8;
  border-left-width: 0.36rem;
  border-radius: 0.8rem;
  background: #fff;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.progress-unit-row[data-card-view="full"] {
  padding-block: 0.8rem;
  box-shadow: 0 0.28rem 0.9rem rgba(23, 50, 77, 0.055);
}

.progress-unit-level-5 { border-left-color: #247a3d; }
.progress-unit-level-4 { border-left-color: #6d9228; }
.progress-unit-level-3 { border-left-color: #d2a600; }
.progress-unit-level-2 { border-left-color: #c66c18; }
.progress-unit-level-1 { border-left-color: #bd3030; }
.progress-unit-level-0 { border-left-color: #737f8b; background: #f7f8fa; }

.progress-unit-toggle {
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.progress-unit-toggle:focus-visible {
  outline: 3px solid rgba(47, 93, 124, 0.3);
  outline-offset: 3px;
}

.progress-unit-compact-summary {
  display: grid;
  grid-template-columns: 4rem minmax(8rem, 0.8fr) minmax(10rem, 1.45fr);
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
}

.progress-unit-learning-rank {
  color: #687684;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.progress-unit-compact-word {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #17324d;
  font-size: 1rem;
}

.progress-unit-compact-english {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #52606d;
}

.progress-unit-full-card {
  display: none;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(22rem, 2fr);
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.progress-unit-row[data-card-view="full"] .progress-unit-compact-summary {
  display: none;
}

.progress-unit-row[data-card-view="full"] .progress-unit-full-card {
  display: grid;
}

.progress-unit-row[data-card-view="compact"] .mastery-badge {
  width: 1.68rem;
  height: 1.68rem;
  font-size: 0.78rem;
}

.progress-unit-row[data-card-view="full"] .mastery-badge {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
}

.progress-unit-word {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.progress-unit-word strong {
  color: #17324d;
  font-size: 1.03rem;
}

.progress-unit-word span {
  color: #52606d;
}

.progress-unit-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  color: #52606d;
  font-size: 0.82rem;
}

.progress-unit-metrics span {
  display: grid;
  gap: 0.12rem;
}

.progress-unit-metrics b {
  color: #17324d;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}


.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Retained compatibility rules for existing account pages. */
.progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.progress-table-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.progress-table-wrap {
  overflow-x: auto;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
}

.progress-table th,
.progress-table td {
  padding: 0.72rem;
  border-bottom: 1px solid #d9e1e8;
  text-align: left;
  white-space: nowrap;
}

.progress-table th {
  background: #2f5d7c;
  color: #fff;
}

.learn-header-inner nav {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .progress-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-unit-full-card {
    grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 1.5fr);
  }

  .progress-unit-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .account-grid,
  .progress-summary-grid,
  .progress-overview-grid,
  .mastery-stage-grid {
    grid-template-columns: 1fr;
  }

  .progress-section-heading,
  .progress-list-heading,
  .progress-table-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-list-heading .button {
    width: 100%;
  }

  .progress-unit-row {
    align-items: start;
  }

  .progress-unit-compact-summary {
    grid-template-columns: 3.5rem minmax(6.5rem, 0.85fr) minmax(8rem, 1.3fr);
    gap: 0.55rem;
  }

  .progress-unit-full-card {
    grid-template-columns: 1fr;
  }

  .progress-unit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-list-view-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-list-key {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mastery-stage-card > summary {
    min-height: 5rem;
    padding: 0.85rem;
  }

  .learn-header-inner {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .learn-header-inner nav {
    gap: 0.35rem;
  }

  .learn-header-inner nav a {
    font-size: 0.88rem;
  }
}

@media (max-width: 420px) {
  .progress-unit-compact-summary {
    grid-template-columns: 3.15rem minmax(0, 1fr);
  }

  .progress-unit-compact-english {
    grid-column: 2;
  }

  .progress-unit-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .progress-view-button {
    min-height: 2.3rem;
    padding-inline: 0.8rem;
  }

  .progress-list-key {
    grid-template-columns: 1fr;
  }

  .mastery-stage-word {
    grid-template-columns: 2.8rem minmax(0, 1fr) auto;
    padding-inline: 0.72rem;
  }
}

/* BEGIN Farsi Bible progress rank study view v1.0 */
.progress-unit-gloss-toggle {
  appearance: none;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #17324d;
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.progress-unit-list-latin .progress-unit-compact-summary {
  grid-template-columns: 4rem minmax(0, 1fr);
}

.progress-unit-list-latin .progress-unit-gloss-toggle {
  pointer-events: auto;
  cursor: pointer;
  border-bottom: 1px dotted rgba(47, 93, 124, 0.42);
}

.progress-unit-list-latin .progress-unit-gloss-toggle:hover,
.progress-unit-list-latin .progress-unit-gloss-toggle:focus-visible {
  color: #2f5d7c;
}

.progress-unit-list-latin .progress-unit-gloss-toggle:focus-visible {
  outline: 3px solid rgba(47, 93, 124, 0.24);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

.progress-unit-list-latin .progress-unit-compact-english {
  display: none;
  grid-column: 2;
  margin-top: 0.08rem;
  padding: 0.45rem 0.62rem;
  border-left: 0.2rem solid #c9d8e3;
  border-radius: 0.35rem;
  background: #f5f9fc;
  color: #52606d;
}

.progress-unit-list-latin
  .progress-unit-row[data-gloss-revealed="true"]
  .progress-unit-compact-english {
  display: block;
}

.progress-unit-row[data-card-view="latin"] .mastery-badge {
  width: 1.68rem;
  height: 1.68rem;
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .progress-unit-list-latin .progress-unit-compact-summary {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .progress-unit-list-latin .progress-unit-compact-summary {
    grid-template-columns: 3.15rem minmax(0, 1fr);
  }
}
/* END Farsi Bible progress rank study view v1.0 */

/* BEGIN Farsi Bible progress list filters v1.1 */
.progress-list-filter-controls {
  margin-top: 0.75rem;
}

.progress-list-filter-summary {
  margin-left: auto;
  color: #6e7b87;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: right;
}

.progress-list-filter-note {
  margin: 0.45rem 0 0;
  color: #6e7b87;
  font-size: 0.82rem;
  line-height: 1.45;
}

.progress-filter-empty {
  margin: 1rem 0 0;
}

@media (max-width: 760px) {
  .progress-list-filter-summary {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}
/* END Farsi Bible progress list filters v1.1 */
