/* Study and learning */
.learning-concept-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  grid-template-columns: 138px minmax(0, 1fr);
}

.learning-concept-thumb {
  display: block;
  min-height: 180px;
  background: var(--pp-paper);
}

.learning-concept-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.learning-concept-copy {
  min-width: 0;
  padding: 20px;
}

.learning-concept-copy h3 {
  margin: 9px 0 8px;
}

.learning-concept-copy h3 a {
  color: var(--pp-ink);
  text-decoration: none;
}

.learning-concept-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--pp-green-deep);
  font-size: 0.72rem;
  font-weight: 900;
}

.learning-recommendation {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #5d4b00;
  background: var(--pp-yellow-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.learning-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  align-items: start;
  gap: 20px;
}

.learning-reading-column {
  display: grid;
  gap: 24px;
  padding: clamp(22px, 4vw, 46px);
}

.learning-prose {
  border-color: var(--pp-border);
}

.learning-detail-header h1 {
  margin: 8px 0 0;
}

.learning-detail-header > p,
.learning-prose > p {
  margin: 0;
}

.learning-primary-image {
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--pp-border);
  border-radius: 20px;
  background: var(--pp-canvas);
}

.learning-primary-image img {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
}

.question-explanation {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--pp-border);
  border-radius: 15px;
  background: var(--pp-canvas);
}

.question-explanation :is(h2, h4) {
  margin: 0 0 8px;
  color: var(--pp-ink);
  font-size: 1rem;
}

.question-explanation p {
  margin: 0;
}

.learning-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.language-fallback,
.info-box,
.support-note {
  padding: 12px 15px;
  border: 1px solid var(--pp-border);
  border-radius: 14px;
  color: var(--pp-muted);
  background: var(--pp-canvas);
}

.back-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  color: var(--pp-green-deep);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 900;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

/* Quiz / exam */
.question-card {
  position: relative;
  padding: clamp(22px, 4vw, 40px);
}

.question-card .italian-source {
  margin: 12px 0 20px;
  color: var(--pp-ink);
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 850;
  line-height: 1.36;
  letter-spacing: -0.02em;
}

.translation-block {
  margin-block: 18px;
  padding: 16px 18px;
  border-inline-start: 4px solid var(--pp-green);
  border-radius: 0 15px 15px 0;
  color: var(--pp-muted);
  background: var(--pp-mint-soft);
}

.translation-block[dir="rtl"] {
  border-inline-start: 4px solid var(--pp-green);
  border-radius: 15px 0 0 15px;
}

.quiz-question-image {
  width: auto;
  height: auto;
  max-width: min(100%, 320px);
  max-height: 220px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .quiz-question-image {
    max-height: 180px;
  }

  :is(.question-card, .question-review-card) > .quiz-image-trigger {
    margin-inline: auto;
  }
}

.quiz-answer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-answer-row .btn {
  min-height: 58px;
  font-size: 1rem;
}

.quiz-question-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 8px;
}

.quiz-nav-pill {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  color: var(--pp-muted);
  background: var(--pp-paper);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-nav-pill.current {
  border-color: var(--pp-ink);
  color: var(--pp-ink);
  background: var(--pp-yellow);
}

.quiz-nav-pill.answered {
  border-color: var(--pp-green);
  color: var(--pp-green-deep);
  background: var(--pp-mint-soft);
}

.quiz-stagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quiz-stagebar-end {
  justify-content: flex-end;
}

.quiz-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quiz-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-banner,
.quiz-result-banner {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.quiz-result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--pp-border);
  border-inline-start-width: 5px;
  border-radius: 15px;
  background: var(--pp-canvas);
}

.quiz-result-summary.is-correct {
  border-color: #9fe4cb;
  border-inline-start-color: var(--pp-green-deep);
  background: #ebf9f2;
}

.quiz-result-summary.is-wrong {
  border-color: var(--pp-danger-border);
  border-inline-start-color: var(--pp-danger-ink);
  background: var(--pp-danger-soft);
}

.question-card.correct {
  border-color: #9fe4cb;
}

.question-card.wrong {
  border-color: var(--pp-danger-border);
}

.question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.question-heading .question-reference {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.question-report-button {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-inline-start: auto;
  padding-inline: 4px;
  color: var(--pp-muted);
  text-decoration: none;
  font-size: var(--pp-text-xs);
  font-weight: 650;
}

.question-report-button:focus-visible {
  outline: 3px solid var(--pp-ink);
  outline-offset: 3px;
}

.question-report-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quiz-image-trigger {
  position: relative;
  display: grid;
  border: 1px solid var(--pp-border);
  border-radius: 18px;
  background: var(--pp-canvas);
  width: fit-content;
  max-width: 100%;
  margin: 16px 0;
  place-items: center;
  padding: 14px;
  cursor: zoom-in;
}

.quiz-image-zoom-badge {
  position: absolute;
  inset-block-start: 9px;
  inset-inline-end: 9px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--pp-ink);
  background: var(--pp-yellow);
}

.quiz-image-zoom-badge svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quiz-image-overlay,
.avatar-picker-dialog,
.avatar-crop-dialog,
.achievement-dialog,
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 25, 19, 0.62);
  backdrop-filter: blur(8px);
}

body.quiz-image-open {
  overflow: hidden;
}

body:is(.achievement-dialog-open, .profile-dialog-open) {
  overflow: hidden;
}

.quiz-image-dialog,
.avatar-picker-card,
.avatar-crop-card,
.achievement-dialog-card,
.admin-question-dialog {
  width: min(100%, 840px);
  max-height: min(90dvh, 900px);
  overflow: auto;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--pp-border);
  border-radius: 24px;
  background: var(--pp-paper);
  box-shadow: var(--pp-shadow);
}

.quiz-image-stage {
  display: grid;
  min-height: min(65dvh, 570px);
  place-items: center;
  padding: 16px;
  border-radius: 18px;
  background: var(--pp-canvas);
}

.quiz-image-stage img {
  width: min(var(--quiz-image-preview-width, 360px), 100%);
  height: auto;
  max-width: 100%;
  max-height: 62dvh;
  object-fit: contain;
}

.quiz-image-stage img.is-low-res {
  image-rendering: crisp-edges;
}

.quiz-image-close {
  margin: 0 0 12px auto;
}

.icon-button {
  display: grid;
  width: var(--pp-control-height-touch);
  height: var(--pp-control-height-touch);
  place-items: center;
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  color: var(--pp-ink);
  background: var(--pp-paper);
  font-size: 1.2rem;
  cursor: pointer;
}

.progression-grid {
  display: grid;
  gap: 14px;
}

.progression-item {
  display: grid;
  gap: 8px;
}

.progression-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Account flow */
.auth-shell {
  display: grid;
  width: min(100% - 32px, 640px);
  margin: 40px auto 70px;
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-lg);
  background: var(--pp-mint-soft);
}

.auth-panel {
  width: 100%;
  max-width: 530px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--pp-shadow);
}

.auth-panel > .callout + form {
  margin-top: var(--pp-space-lg);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: var(--pp-text-sm);
  font-weight: 700;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--pp-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--pp-border);
  content: "";
}

.auth-email-heading {
  margin: 0 0 16px;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.3;
}

.auth-google-option {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.auth-google-option .eyebrow {
  margin: 0;
}

.auth-google-option button {
  width: 100%;
}

.auth-actions > a {
  display: inline-flex;
  min-height: var(--pp-control-height-touch);
  align-items: center;
  gap: 7px;
}

.auth-actions > a .directional-arrow {
  flex: 0 0 auto;
}

.auth-login-links {
  justify-content: flex-start;
}

.auth-inline-link {
  margin-top: -8px;
  font-size: var(--pp-text-sm);
  font-weight: 700;
  text-align: end;
}

.auth-switch {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--pp-border);
  color: var(--pp-muted);
  font-size: var(--pp-text-sm);
  text-align: center;
}

.auth-switch a {
  font-weight: 800;
}

.auth-switch-first {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
  text-align: start;
}

/* Billing and profile */
.premium-page {
  display: grid;
  gap: 24px;
  max-width: 900px;
}

.premium-intro {
  max-width: 760px;
}

.premium-intro h1 {
  margin-block: 8px 16px;
}

.premium-offer,
.premium-current,
.support-coffee {
  display: grid;
  justify-items: start;
  gap: 18px;
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
}

.premium-offer {
  border-color: var(--pp-warning-border);
  background: var(--pp-yellow-soft);
}

.premium-offer h2,
.premium-current h2,
.support-coffee h2 {
  margin-block: 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.premium-price,
.home-premium-price {
  margin-block: 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
}

.premium-duration {
  font-weight: 750;
}

.premium-current > p,
.premium-availability p,
.support-coffee p {
  margin: 0;
}

.premium-availability {
  display: grid;
  gap: 8px;
}

.support-coffee {
  border-color: var(--pp-warning-border);
  background: color-mix(in srgb, var(--pp-yellow-soft) 48%, var(--pp-paper));
}

.coffee-cup-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.support-coffee-button {
  gap: 10px;
}

.support-coffee-form {
  margin: 0;
}

.coffee-checkout-shell {
  max-width: 680px;
}

.coffee-checkout-card {
  padding: clamp(20px, 4vw, 32px);
}

.public-footer nav .support-footer-link,
.app-legal-footer nav .support-footer-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: var(--pp-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration-color: var(--pp-border-strong);
  text-underline-offset: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.support-footer-link .coffee-cup-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.public-footer nav .support-footer-link:hover,
.app-legal-footer nav .support-footer-link:hover {
  color: var(--pp-green-deep);
  text-decoration-color: currentColor;
}

.public-footer nav .support-footer-link:focus-visible,
.app-legal-footer nav .support-footer-link:focus-visible {
  color: var(--pp-green-deep);
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 3px;
}

.support-coffee-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
  padding: clamp(18px, 3vw, 26px);
}

.support-coffee-compact h2 {
  font-size: 1.15rem;
  margin-block-end: 8px;
}

.support-coffee-note {
  color: var(--pp-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.support-coffee .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

@media (max-width: 640px) {
  .support-coffee-compact {
    grid-template-columns: minmax(0, 1fr);
  }
}

.support-coffee .muted {
  margin-block-start: 10px;
}

.premium-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.premium-page .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.billing-page {
  display: grid;
  gap: 22px;
}

.billing-intro {
  max-width: 780px;
  padding-block: 8px 4px;
}

.billing-intro h1,
.billing-options-heading h2,
.billing-current-title h2 {
  margin: 8px 0;
}

.billing-current-card {
  display: grid;
  align-items: start;
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  border-color: #ead34e;
  background: linear-gradient(135deg, var(--pp-yellow-soft), #fffdf3 70%);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.billing-current-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--pp-paper);
  background: var(--pp-ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.billing-current-copy > p:last-of-type {
  max-width: 680px;
  margin-block: 8px 18px;
  color: var(--pp-muted);
}

.billing-current-copy .billing-trial-ended {
  max-width: 680px;
  margin: -8px 0 18px;
  padding: 11px 13px;
  border-radius: 13px;
  color: #7c2d28;
  background: var(--pp-coral-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.billing-current-title,
.billing-plan-card-head,
.profile-subscription-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-current-meta,
.profile-subscription-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.billing-current-meta > div,
.profile-subscription-meta > div {
  min-width: 150px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.billing-current-meta dt,
.profile-subscription-meta dt {
  color: var(--pp-muted);
  font-size: var(--pp-text-xs);
  font-weight: 600;
}

.billing-current-meta dd,
.profile-subscription-meta dd {
  margin: 4px 0 0;
  color: var(--pp-ink);
  font-weight: 900;
}

.billing-current-actions {
  display: grid;
  gap: 9px;
  min-width: 190px;
}

.billing-current-actions .btn,
.billing-current-actions form,
.billing-current-actions form .btn {
  width: 100%;
}

.billing-options {
  display: grid;
  gap: 18px;
  padding-block-start: 10px;
}

.billing-options-heading {
  display: grid;
  align-items: end;
  gap: 26px;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
}

.billing-options-heading > p {
  margin: 0;
  color: var(--pp-muted);
}

.billing-plan-card {
  display: flex;
  min-width: 0;
  min-height: 380px;
  flex-direction: column;
  padding: clamp(23px, 4vw, 34px);
  overflow-wrap: anywhere;
}

.billing-plan-card.is-featured {
  border-color: #ead34e;
  background: #fffdf3;
}

.billing-plan-card.is-free-tier {
  background: var(--pp-paper);
}

.billing-plan-card.is-current {
  border: 2px solid var(--pp-ink);
  box-shadow: inset 0 6px 0 var(--pp-yellow);
}

.billing-plan-card-head .eyebrow {
  margin: 0;
}

.billing-selected-mark {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--pp-ink);
  background: var(--pp-yellow);
  font-size: 0.68rem;
  font-weight: 950;
}

.billing-plan-copy {
  display: grid;
  gap: 10px;
  margin-block: 10px 20px;
}

.billing-plan-copy h3 {
  margin: 0;
  font-size: 1.55rem;
}

.billing-plan-price {
  margin: 0;
  color: var(--pp-ink);
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.billing-plan-cadence {
  margin: 0;
  color: var(--pp-green-deep);
  font-weight: 900;
}

.billing-tax-note {
  margin: 0;
  color: var(--pp-muted);
  font-size: var(--pp-text-xs);
  font-weight: 400;
}

.billing-plan-copy > .muted,
.billing-plan-copy > .billing-feature-list {
  margin: 0;
}

.billing-plan-form,
.billing-plan-card > .btn,
.billing-plan-card > .status-pill,
.billing-plan-note {
  margin-top: auto;
}

.billing-plan-form {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
}

.billing-purchase-disclosure {
  margin: 0;
  color: var(--pp-muted);
  font-size: var(--pp-text-sm);
  line-height: 1.6;
}

.billing-legal-consent {
  display: grid;
  align-items: start;
  gap: 9px;
  color: var(--pp-muted);
  font-size: var(--pp-text-sm);
  line-height: 1.6;
  grid-template-columns: auto minmax(0, 1fr);
}

.billing-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: var(--pp-text-sm);
}

.billing-legal-links a {
  display: inline-flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
}

.billing-legal-consent input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--pp-green);
}

.billing-plan-note {
  display: block;
  padding: 12px 14px;
  border-radius: 13px;
  color: var(--pp-muted);
  background: var(--pp-canvas);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.billing-feature-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding: 0;
  color: var(--pp-muted);
  list-style: none;
  font-size: 0.86rem;
}

.billing-feature-list li::before {
  margin-inline-end: 8px;
  color: var(--pp-green-deep);
  content: "✓";
  font-weight: 950;
}

.profile-subscription-card {
  scroll-margin-top: 94px;
  background: linear-gradient(145deg, var(--pp-yellow-soft), var(--pp-paper) 62%);
}

.profile-subscription-heading h2 {
  margin: 7px 0 0;
}

.profile-subscription-meta {
  margin-block: 18px;
}

.profile-subscription-meta > div {
  border: 1px solid rgba(23, 40, 33, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.profile-subscription-action {
  width: 100%;
}

.avatar-grid {
  grid-template-columns: repeat(6, minmax(64px, 1fr));
}

.avatar-option {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--pp-canvas);
}

.avatar-option[aria-pressed="true"] {
  border-color: var(--pp-green);
  box-shadow: 0 0 0 4px rgba(0, 190, 136, 0.15);
}

.avatar {
  display: block;
  border-radius: 18px;
  object-fit: cover;
}

.avatar-lg {
  width: 88px;
  height: 88px;
}

.avatar-xl {
  width: 124px;
  height: 124px;
}

.profile-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.profile-main-card {
  display: grid;
  align-self: start;
  gap: 18px;
}

.profile-summary {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 16px;
  padding-block-end: 18px;
  border-block-end: 1px solid var(--pp-border);
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-summary-avatar,
.profile-picture-avatar {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--pp-border);
  border-radius: 18px;
  object-fit: cover;
}

.profile-summary-avatar {
  width: 64px;
}

.profile-picture-avatar {
  width: 68px;
}

.profile-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-summary-copy .eyebrow,
.profile-summary-copy h1,
.profile-summary-copy p {
  margin: 0;
}

.profile-summary-copy h1 {
  font-size: var(--pp-title-page);
  overflow-wrap: anywhere;
}

.profile-summary-copy > p:last-child {
  color: var(--pp-muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.profile-summary-metrics {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-summary-metrics > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--pp-mint-soft);
}

.profile-summary-metrics > div:last-child {
  background: var(--pp-yellow-soft);
}

.profile-summary-metrics dt {
  color: var(--pp-muted);
  font-size: var(--pp-text-xs);
  font-weight: 600;
}

.profile-summary-metrics dd {
  margin: 0;
  color: var(--pp-ink);
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1;
}

.profile-progression-panel > .eyebrow,
.profile-progression-item p,
.profile-progression-item small {
  margin: 0;
}

.profile-progression-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-progression-item {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding-inline-end: 16px;
}

.profile-progression-item + .profile-progression-item {
  padding-inline: 16px 0;
  border-inline-start: 1px solid var(--pp-border);
}

.profile-progression-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.profile-progression-heading strong {
  flex: 0 0 auto;
}

.profile-progression-item p,
.profile-progression-item small {
  color: var(--pp-muted);
  font-size: var(--pp-text-xs);
  line-height: 1.6;
}

.profile-settings-form,
.profile-settings-sections {
  display: grid;
}

.profile-settings-form {
  gap: 16px;
}

.profile-settings-sections {
  gap: 20px;
}

.profile-settings-section {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 2.8vw, 30px);
}

.profile-settings-heading {
  display: grid;
  gap: 7px;
}

.profile-settings-heading > :is(.eyebrow, .muted) {
  margin: 0;
}

.profile-settings-heading .muted {
  max-width: 780px;
  line-height: 1.5;
}

.profile-settings-heading h2.eyebrow {
  color: var(--pp-ink);
  font-size: var(--pp-text-lg);
  letter-spacing: normal;
  text-transform: none;
}

.profile-settings-fields {
  display: grid;
  gap: 22px;
}

.profile-language-settings {
  display: grid;
  gap: 15px;
}

.profile-support-language-field[hidden] {
  display: none;
}

.profile-support-language-field small {
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

.profile-picture-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-picture-actions {
  flex: 1 1 auto;
}

.profile-picture-actions .btn {
  flex: 1 1 210px;
  min-height: 48px;
}

.profile-save-bar {
  position: static;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--pp-border);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--pp-shadow-sm);
  backdrop-filter: blur(14px);
}

.profile-save-bar[data-dirty="true"] {
  position: sticky;
  inset-block-end: 16px;
}

.profile-save-state,
.profile-language-save-status {
  color: var(--pp-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.avatar-grid,
.achievement-collection,
.achievement-preview {
  display: grid;
  gap: 12px;
}

.avatar-grid-dialog {
  margin-top: 20px;
}

.avatar-option {
  padding: 4px;
  cursor: pointer;
}

.avatar-option img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.avatar-upload-trigger input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.avatar-crop-stage {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1;
  overflow: hidden;
  margin: 20px auto;
  border-radius: 22px;
  background: var(--pp-ink);
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform-origin: center;
}

.avatar-crop-mask {
  position: absolute;
  inset: 10%;
  z-index: 2;
  border: 3px solid var(--pp-yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.avatar-crop-zoom {
  margin-block: 14px;
}

.achievements-summary-header,
.achievement-dialog-header,
.achievement-item-heading,
.achievement-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.achievement-progress-row > .progress-meter {
  flex: 1;
  width: auto;
}

.achievement-progress-row > strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.achievements-summary {
  scroll-margin-top: 94px;
}

.profile-achievements-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
}

.profile-achievements-header {
  flex-wrap: wrap;
}

.profile-achievements-card h2,
.profile-achievements-card p,
.profile-data-controls h2,
.profile-data-controls p {
  margin-block: 0;
}

.profile-achievements-header > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.profile-achievements-header h2,
.profile-data-controls h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.profile-achievements-action {
  max-width: 100%;
  flex: 0 1 auto;
}

.profile-data-actions {
  align-items: stretch;
}

.profile-data-actions form,
.profile-data-actions .btn {
  flex: 1 1 150px;
}

.profile-data-actions .btn {
  width: 100%;
}

.profile-hall-of-fame-link {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-start: 18px;
  padding: 13px 15px;
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  color: var(--pp-ink);
  background: var(--pp-paper);
  text-decoration: none;
}

.profile-hall-of-fame-link:hover,
.profile-hall-of-fame-link:focus-visible {
  border-color: var(--pp-border-strong);
  background: var(--pp-mint-soft);
}

.profile-hall-of-fame-link > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-hall-of-fame-link small {
  color: var(--pp-muted);
}

.profile-hall-of-fame-action {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--pp-mint-soft);
}

.profile-hall-of-fame-action .directional-arrow {
  width: 18px;
  height: 18px;
}

.achievement-dialog-header {
  position: relative;
  padding-inline-end: 54px;
}

.achievement-dialog-close {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
}

.achievement-count,
.achievement-state-label {
  color: var(--pp-muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.achievement-preview {
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.achievement-preview-item,
.achievement-item {
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  background: var(--pp-canvas);
}

.achievement-preview-item {
  display: grid;
  min-height: 78px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  text-align: start;
  color: var(--pp-ink);
  font-size: var(--pp-text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.achievement-collection {
  margin-top: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.achievement-item {
  padding: 17px;
}

.achievement-state-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--pp-ink);
  background: var(--pp-yellow);
  font-weight: 950;
}

.achievement-item.locked,
.achievement-preview-item.locked {
  border-style: dashed;
}

.achievement-item.locked .achievement-state-mark,
.achievement-preview-item.locked .achievement-state-mark {
  color: var(--pp-muted);
  background: var(--pp-border);
}

/* Hall of fame */
.hall-of-fame-heading > div {
  flex: 0 0 auto;
}

.hall-of-fame-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hall-of-fame-card {
  padding: 22px;
  border: 1px solid var(--pp-border);
  border-radius: 22px;
  background: var(--pp-paper);
}

.hall-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.hall-period-empty {
  margin: 16px 0 0;
  color: var(--pp-muted);
  line-height: 1.55;
}

.hall-entry {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: var(--pp-canvas);
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.hall-entry.is-current-user {
  border: 1px solid #8fd7bd;
  background: var(--pp-mint-soft);
}

.hall-entry .avatar {
  width: 42px;
  height: 42px;
}

.hall-entry-copy {
  min-width: 0;
}

.hall-entry-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.hall-entry-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hall-current-user {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--pp-green-deep);
  background: var(--pp-paper);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.hall-rank {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--pp-yellow);
  font-weight: 950;
}

.hall-entry-copy,
.hall-entry-meta {
  display: grid;
}

.hall-entry-meta {
  color: var(--pp-muted);
  font-size: 0.72rem;
}

.rank-gear {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 4px solid var(--gear-ring-color, var(--pp-yellow));
  border-radius: 50%;
  color: var(--gear-text-color, var(--pp-ink));
  background: var(--gear-core-color, var(--pp-mint));
  box-shadow: 0 0 0 3px var(--gear-color, var(--pp-green));
}

.rank-gear-sm {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.rank-gear-md {
  width: 48px;
  height: 48px;
}

.rank-gear-value {
  font-size: var(--pp-text-xs);
  font-weight: 700;
}

/* Dense administrative and feedback screens remain functional and calm. */
.admin-shell,
.table-stack,
.feedback-admin-grid {
  display: grid;
  gap: 20px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  background: var(--pp-paper);
}

.admin-nav a {
  padding: 8px 11px;
  border-radius: 11px;
  color: var(--pp-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-nav a:hover {
  color: var(--pp-ink);
  background: var(--pp-mint-soft);
}

.admin-filter-bar,
.feedback-filter-bar,
.content-import-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.admin-table-panel,
.data-table {
  max-width: 100%;
  overflow-x: auto;
}

.admin-webhook-endpoint {
  overflow-wrap: anywhere;
}

table,
.admin-question-table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--pp-border);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--pp-muted);
  font-size: var(--pp-text-xs);
  font-weight: 600;
}

td {
  font-size: 0.84rem;
}

.table-actions,
.admin-dialog-actions,
.feedback-actions,
.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-question-language-grid,
.translation-grid,
.cards-grid,
.feedback-asset-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-question-source,
.translation-card,
.translation-edit-panel,
.feedback-recent-card,
.feedback-asset-card {
  padding: 17px;
}

.feedback-asset-card {
  min-width: 0;
}

.feedback-asset-card img {
  display: block;
  max-width: 100%;
  height: auto;
}

.feedback-asset-name {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.feedback-admin-list,
.feedback-recent-list {
  display: grid;
  gap: 9px;
}

.feedback-admin-row {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--pp-border);
  border-radius: 15px;
  color: var(--pp-ink);
  background: var(--pp-paper);
  text-decoration: none;
}

.feedback-admin-row-top,
.feedback-admin-row-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.feedback-details-field {
  display: grid;
  min-width: 0;
  gap: 8px;
  font-size: var(--pp-text-sm);
}

.feedback-details-field > :first-child {
  font-weight: 600;
}

.feedback-editor-shell {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--pp-border-strong);
  border-radius: 15px;
  background: var(--pp-paper);
}

.feedback-editor-shell:focus-within {
  border-color: var(--pp-green-deep);
  box-shadow: 0 0 0 3px var(--pp-mint-soft);
}

.feedback-editor-shell trix-toolbar {
  /* Trix normally injects this rule inline, which our strict CSP blocks. */
  display: block;
  min-width: 0;
  position: relative;
  z-index: 2;
  padding: 8px;
  border-bottom: 1px solid var(--pp-border);
  border-radius: 14px 14px 0 0;
  background: var(--pp-canvas);
}

.feedback-editor-shell .trix-button-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  overflow: visible;
}

.feedback-editor-shell .trix-button-group,
.feedback-editor-shell .trix-button-group:not(:first-child) {
  flex-wrap: wrap;
  min-width: 0;
  gap: 4px;
  margin: 0;
  border: 0;
}

.feedback-editor-shell .trix-button-group-spacer {
  display: none;
}

.feedback-editor-shell .trix-button-row .trix-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: none;
  padding: 0;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  background: var(--pp-paper);
}

.feedback-editor-shell .trix-button-row .trix-button::before {
  inset: 0;
  background-size: 22px 22px;
}

.feedback-editor-shell .trix-button-row .trix-button:not(:disabled):hover,
.feedback-editor-shell .trix-button-row .trix-button.trix-active {
  border-color: var(--pp-green-deep);
  background: var(--pp-mint-soft);
}

.feedback-editor-shell .trix-button:focus-visible {
  outline: 2px solid var(--pp-green-deep);
  outline-offset: 2px;
}

.feedback-editor-shell trix-editor {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 420px;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 14px 16px;
  border: 0;
  border-radius: 0 0 14px 14px;
  background: var(--pp-paper);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .feedback-editor-shell .trix-button-row {
    gap: 4px;
  }

  .feedback-editor-shell .trix-button-group {
    display: contents;
  }
}

.feedback-editor-shell trix-toolbar [data-trix-dialog] {
  display: none !important;
}

.feedback-editor-shell trix-toolbar [data-trix-dialog][data-trix-active] {
  display: block !important;
}

.feedback-rendered-html img {
  max-width: 100%;
  height: auto;
}

.achievement-item.earned,
.achievement-preview-item.earned {
  border-color: #ead34e;
  background: var(--pp-yellow-soft);
}

/* Responsive layout */
@media (max-width: 1180px) {
  .profile-layout,
  .learning-concept-card.has-image {
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-concept-thumb {
    min-height: 142px;
    max-height: 170px;
  }
}

@media (max-width: 1020px) {
  :root {
    --pp-sidebar: 204px;
  }

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

  .app-sidebar {
    padding-inline: 12px;
  }

  .app-brand .brand-logo-wide {
    width: 164px;
  }

  .hall-of-fame-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: 72px;
  }

  .public-header {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    padding: 10px 16px;
  }

  /* Hand off to .public-bottom-nav at the same breakpoint. */
  .public-nav {
    display: none;
  }

  .public-header .brand-logo-wide {
    display: none;
  }

  .public-header .brand-logo-icon {
    display: block;
  }

  .public-header-actions {
    gap: 8px;
  }

  .header-account-entry {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: 7px 11px;
    border-radius: var(--pp-radius-control-lg);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
  }

  .public-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 26px;
  }

  .public-shell {
    padding-block-end: calc(var(--pp-mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .account-flow .public-shell {
    padding-block-end: 0;
  }

  .public-main > .section:not(.legal-page, .style-guide-page) {
    padding: 22px 16px 42px;
  }

  .app-legal-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-footer nav {
    gap: 0 20px;
  }

  .app-legal-footer {
    padding: 24px 16px 104px;
  }

  .legal-page {
    padding-block: 26px 42px;
  }

  .legal-hero,
  .legal-document > section,
  .legal-status-card {
    border-radius: 20px;
  }

  .legal-status-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .cookie-notice {
    inset-inline: 10px;
    inset-block-end: calc(var(--pp-mobile-nav-height) + 10px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 110px);
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    border-radius: 18px;
  }

  .public-experience .cookie-notice {
    inset-block-end: calc(10px + env(safe-area-inset-bottom));
  }

  .cookie-notice-visible.public-experience .public-bottom-nav {
    display: none;
  }

  .cookie-notice-actions,
  .cookie-notice-actions form,
  .cookie-notice .btn {
    width: 100%;
  }

  .cookie-notice-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .cookie-notice .btn {
    white-space: normal;
  }

  .cookie-notice-visible.public-experience .public-shell {
    padding-bottom: calc(190px + env(safe-area-inset-bottom));
  }

  .cookie-notice-visible.app-experience .app-workspace {
    padding-bottom: 250px;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar,
  .app-topbar {
    display: none;
  }

  .app-mobile-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 90;
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    border-bottom: 1px solid var(--pp-border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
  }

  .app-mobile-header .brand-logo-wide {
    width: 172px;
  }

  .app-mobile-header .player-avatar {
    width: 39px;
    height: 39px;
  }

  .app-workspace {
    display: block;
  }

  .app-main {
    width: 100%;
    min-height: calc(100dvh - 66px);
    padding: 22px 16px calc(var(--pp-mobile-nav-height) + 26px + env(safe-area-inset-bottom));
  }

  .profile-save-bar[data-dirty="true"] {
    position: fixed;
    inset-inline: 16px;
    inset-block-end: calc(var(--pp-mobile-nav-height) + 16px + env(safe-area-inset-bottom));
    width: auto;
  }

  .profile-settings-form:has(.profile-save-bar[data-dirty="true"]) {
    padding-block-end: 96px;
  }

  .profile-save-bar .btn {
    min-height: 48px;
  }

  .dashboard-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dashboard-notice > a {
    grid-column: 2;
  }

  .app-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    display: grid;
    container-type: inline-size;
    min-height: var(--pp-mobile-nav-height);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--pp-border);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -4px 20px rgba(23, 40, 33, 0.04);
    backdrop-filter: blur(18px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-bottom-nav a {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 11px;
    color: var(--pp-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-align: center;
  }

  @media (max-width: 360px) {
    .app-bottom-nav {
      padding-inline: 2px;
    }

    .app-bottom-nav a {
      padding-inline: 0;
      font-size: 0.75rem;
      letter-spacing: -0.025em;
      overflow-wrap: normal;
      white-space: nowrap;
    }
  }

  .app-bottom-nav a[aria-current="page"] {
    color: var(--pp-green-deep);
    background: var(--pp-mint-soft);
    box-shadow: inset 0 0 0 2px var(--pp-success-border);
  }

  .app-bottom-nav svg {
    width: 22px;
    height: 22px;
  }

  .section-heading,
  .learning-hub-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading .lede {
    max-width: none;
  }

  .dual-grid,
  .category-grid,
  .learning-concept-grid,
  .billing-plan-grid,
  .learning-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .billing-current-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .billing-current-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-options-heading {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-concept-card {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .learning-concept-thumb {
    min-height: 155px;
  }

  .focus-shell {
    width: calc(100% - 20px);
    grid-template-columns: 44px minmax(0, 1fr) max-content;
    gap: 8px;
    padding-block: 6px;
  }

  .focus-back span,
  .focus-language-picker summary span {
    display: none;
  }

  .focus-main {
    padding: 16px 10px 34px;
  }

  .question-card {
    padding: 20px 17px 18px;
  }

  .auth-shell {
    width: min(100% - 24px, 640px);
    margin: 22px auto 48px;
    padding: 12px;
    border-radius: 24px;
  }

  .auth-panel {
    padding: 23px 18px;
    border-radius: 20px;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }

  .achievement-collection,
  .admin-question-language-grid,
  .translation-grid,
  .cards-grid,
  .feedback-asset-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

/* Keep translated navigation readable when zoom or enlarged text leaves too
   little inline space for four labels. The clipped text still names each link. */
@container (max-width: 16em) {
  .app-bottom-nav a > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 480px) {
  .billing-current-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .billing-current-actions {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-summary-avatar {
    width: 56px;
    border-radius: 16px;
  }

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

  .profile-progression-grid {
    gap: 13px;
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-progression-item {
    padding: 0;
  }

  .profile-progression-item + .profile-progression-item {
    padding: 13px 0 0;
    border-block-start: 1px solid var(--pp-border);
    border-inline-start: 0;
  }

  .profile-picture-row,
  .profile-save-bar,
  .achievements-summary-header {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-settings-section {
    gap: 18px;
    padding: 20px 16px;
  }

  .profile-settings-fields {
    gap: 18px;
  }

  .profile-language-settings {
    gap: 13px;
  }

  .profile-picture-actions,
  .profile-picture-actions .btn {
    width: 100%;
  }

  .profile-achievements-action {
    width: 100%;
    justify-content: center;
  }

  .profile-settings-form:has(.profile-save-bar[data-dirty="true"]) {
    padding-block-end: 128px;
  }

  .achievement-dialog-header {
    align-items: flex-start;
  }

  .data-card {
    min-height: 132px;
  }

  .quiz-question-rail {
    grid-template-columns: repeat(6, minmax(34px, 1fr));
  }

  .learning-concept-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-concept-thumb {
    min-height: 140px;
    max-height: 180px;
  }

}
