html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
}

img,
button,
input,
select,
textarea {
  max-width: 100%;
}

.site-header,
.header-inner,
.header-actions,
.auth-area,
.auth-identity,
main,
.view,
.hero-shell,
.hero-card,
.result-card,
.result-details,
.result-row,
.legal-basis-box {
  min-width: 0;
}

.result-row,
.legal-basis-box,
.source-note,
.bank-explanation,
.question-text,
.choice-text {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 720px) {
  .site-header {
    width: 100%;
    overflow: hidden;
  }

  .header-inner {
    width: min(100% - 24px, 1160px);
    min-height: 0;
    padding: 14px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand-lockup {
    width: 100%;
    min-width: 0;
    flex: 0 1 auto;
  }

  .header-actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .auth-area {
    order: -1;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .auth-identity {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .auth-identity > div {
    min-width: 0;
  }

  .auth-identity strong {
    max-width: calc(100vw - 90px);
    font-size: .86rem;
  }

  .auth-identity span {
    display: none;
  }

  .auth-logout {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    padding: 8px 8px;
    font-size: .76rem;
    text-align: center;
    white-space: nowrap;
  }

  .dashboard-open,
  .header-actions > .text-button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 8px 10px;
    font-size: .76rem;
    text-align: center;
    white-space: nowrap;
  }

  main.container {
    width: min(100% - 20px, 1160px);
    padding-top: 22px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .hero-card,
  .result-card {
    width: 100%;
    max-width: 100%;
    padding: 22px 16px;
    border-radius: 16px;
  }

  .hero-card h1 {
    font-size: clamp(1.7rem, 8.5vw, 2.25rem);
    line-height: 1.12;
  }

  .lead,
  .result-intro {
    font-size: .98rem;
    line-height: 1.62;
  }

  .bank-card,
  .mode-card,
  .question-card,
  .navigator-card {
    max-width: 100%;
  }

  .mode-card {
    min-height: 160px;
    padding: 18px;
  }

  .exam-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .timer {
    align-self: flex-end;
  }

  .question-card {
    padding: 20px 16px;
  }

  .question-text {
    font-size: 1.05rem;
    line-height: 1.62;
  }

  .choice-option {
    padding: 14px 12px;
  }

  .navigator-card {
    padding: 16px;
  }

  .question-navigator {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-question {
    min-width: 0;
    font-size: .8rem;
  }

  .result-card h2 {
    font-size: clamp(2rem, 10vw, 2.7rem);
    line-height: 1.08;
  }

  .result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0;
  }

  .summary-item {
    min-width: 0;
    min-height: 92px;
    padding: 14px;
  }

  .summary-item strong {
    font-size: clamp(1.75rem, 9vw, 2.2rem);
  }

  .result-details > p:first-child {
    font-size: .9rem;
    line-height: 1.5;
  }

  .result-row {
    width: 100%;
    padding: 16px 14px 16px 17px;
  }

  .result-row h4 {
    font-size: 1rem;
    line-height: 1.48;
  }

  .result-row p,
  .legal-basis-box,
  .source-note {
    font-size: .93rem;
    line-height: 1.55;
  }

  .legal-basis-box {
    padding: 12px;
  }

  .source-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .source-links a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .payment-backdrop,
  .dashboard-overlay {
    padding: 10px;
    align-items: end;
  }

  .payment-modal,
  .dashboard-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

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

  .site-footer {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .question-navigator {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .auth-logout,
  .dashboard-open,
  .header-actions > .text-button {
    padding: 7px 7px;
    font-size: .71rem;
  }
}
