.alfa-marine-exam-root {
  --amq-blue: #1769c2;
  --amq-blue-dark: #1257a3;
  --amq-ink: #162334;
  --amq-muted: #5b6a7b;
  --amq-border: #d8e0e9;
  --amq-bg: #f3f8ff;
  color: var(--amq-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  max-width: 100%;
  overflow-x: clip;
  width: 100%;
}

.alfa-marine-exam-root *,
.alfa-marine-exam-root *::before,
.alfa-marine-exam-root *::after {
  box-sizing: border-box;
}

/* Hard reset against theme button/link styles (nowrap, floats, fixed widths). */
.alfa-marine-exam-root button,
.alfa-marine-exam-root .amq-button,
.alfa-marine-exam-root .amq-option,
.alfa-marine-exam-root a.amq-button {
  float: none !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.alfa-marine-exam-root .amq-shell {
  align-items: center;
  background: linear-gradient(180deg, #eff7ff 0%, #dcecff 100%);
  display: flex;
  justify-content: center;
  max-width: 100%;
  min-height: 540px;
  min-width: 0;
  overflow-x: clip;
  padding: 28px 16px;
  width: 100%;
}

.alfa-marine-exam-root .amq-card {
  background: #fff;
  border: 1px solid rgba(24, 70, 120, 0.1);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(23, 55, 90, 0.12);
  max-width: min(720px, 100%);
  min-width: 0;
  overflow: hidden;
  padding: 28px;
  width: 100%;
}

.alfa-marine-exam-root .amq-home {
  max-width: 520px;
  text-align: center;
}

.alfa-marine-exam-root .amq-boat {
  color: var(--amq-blue);
  font-size: 54px;
  line-height: 1;
  margin: 0 auto 20px;
}

.alfa-marine-exam-root .amq-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 18px;
}

.alfa-marine-exam-root .amq-logo {
  display: block;
  height: auto;
  max-height: 72px;
  max-width: min(260px, 70%);
  object-fit: contain;
  width: auto;
}

.alfa-marine-exam-root .amq-lang-switch {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.alfa-marine-exam-root .amq-lang-btn {
  background: #fff;
  border: 1px solid var(--amq-border);
  border-radius: 999px;
  color: var(--amq-muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  min-width: 46px;
  padding: 4px 12px;
}

.alfa-marine-exam-root .amq-lang-btn.is-active {
  background: var(--amq-blue);
  border-color: var(--amq-blue);
  color: #fff;
}

.alfa-marine-exam-root .amq-lang-note {
  font-size: 13px;
  margin-top: -4px;
}

.alfa-marine-exam-root .amq-fields {
  margin: 8px 0 4px;
  text-align: left;
}

.alfa-marine-exam-root .amq-fields label {
  display: block;
  margin: 10px 0 6px;
}

.alfa-marine-exam-root .amq-input {
  border: 1px solid var(--amq-border);
  border-radius: 9px;
  display: block;
  font: inherit;
  margin: 0 0 4px;
  padding: 10px 12px;
  width: 100%;
}

.alfa-marine-exam-root .amq-input:focus {
  border-color: var(--amq-blue);
  outline: 3px solid rgba(23, 105, 194, 0.22);
  outline-offset: 1px;
}

.alfa-marine-exam-root .amq-history {
  max-width: 760px;
}

.alfa-marine-exam-root .amq-history-name {
  font-weight: 650;
  margin-top: 18px;
  text-align: center;
}

.alfa-marine-exam-root .amq-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin: 16px 0 8px;
}

.alfa-marine-exam-root .amq-metric {
  background: #f5f9fe;
  border: 1px solid var(--amq-border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.alfa-marine-exam-root .amq-metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.alfa-marine-exam-root .amq-metric span {
  color: var(--amq-muted);
  font-size: 12px;
}

.alfa-marine-exam-root .amq-charts {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1.2fr;
  margin: 20px 0;
}

.alfa-marine-exam-root .amq-donut-wrap,
.alfa-marine-exam-root .amq-trend {
  background: #f8fbff;
  border: 1px solid var(--amq-border);
  border-radius: 14px;
  padding: 16px;
}

.alfa-marine-exam-root .amq-donut {
  border-radius: 50%;
  height: 160px;
  margin: 0 auto;
  position: relative;
  width: 160px;
}

.alfa-marine-exam-root .amq-donut-hole {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  height: 96px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
}

.alfa-marine-exam-root .amq-donut-hole strong {
  font-size: 24px;
  line-height: 1;
}

.alfa-marine-exam-root .amq-donut-hole span {
  color: var(--amq-muted);
  font-size: 11px;
  margin-top: 4px;
  text-align: center;
}

.alfa-marine-exam-root .amq-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

.alfa-marine-exam-root .amq-legend-pass,
.alfa-marine-exam-root .amq-legend-fail {
  font-size: 13px;
  font-weight: 650;
}

.alfa-marine-exam-root .amq-legend-pass {
  color: #258148;
}

.alfa-marine-exam-root .amq-legend-fail {
  color: #c33838;
}

.alfa-marine-exam-root .amq-trend h3,
.alfa-marine-exam-root .amq-attempt-list h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.alfa-marine-exam-root .amq-bars {
  align-items: end;
  display: flex;
  gap: 6px;
  height: 140px;
  justify-content: space-between;
}

.alfa-marine-exam-root .amq-bar-col {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  height: 100%;
  justify-content: end;
  min-width: 0;
}

.alfa-marine-exam-root .amq-bar {
  border-radius: 8px 8px 4px 4px;
  min-height: 8px;
  width: 100%;
  max-width: 28px;
}

.alfa-marine-exam-root .amq-bar.is-pass {
  background: linear-gradient(180deg, #3fbf6a, #258148);
}

.alfa-marine-exam-root .amq-bar.is-fail {
  background: linear-gradient(180deg, #ef6b6b, #c33838);
}

.alfa-marine-exam-root .amq-bar-label {
  color: var(--amq-muted);
  font-size: 11px;
  margin-top: 6px;
}

.alfa-marine-exam-root .amq-attempt-list {
  margin: 8px 0 18px;
}

.alfa-marine-exam-root .amq-attempt {
  background: #fff;
  border: 1px solid var(--amq-border);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin: 10px 0;
  padding: 12px 14px 10px;
}

.alfa-marine-exam-root .amq-attempt.is-pass {
  border-color: #b7dfc2;
  box-shadow: inset 3px 0 0 #258148;
}

.alfa-marine-exam-root .amq-attempt.is-fail {
  border-color: #f0c4c4;
  box-shadow: inset 3px 0 0 #c33838;
}

.alfa-marine-exam-root .amq-attempt-main,
.alfa-marine-exam-root .amq-attempt-score {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alfa-marine-exam-root .amq-attempt-score {
  text-align: right;
}

.alfa-marine-exam-root .amq-attempt-bar {
  background: #e8eef5;
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
}

.alfa-marine-exam-root .amq-attempt-bar span {
  background: var(--amq-blue);
  display: block;
  height: 100%;
}

.alfa-marine-exam-root .amq-attempt.is-pass .amq-attempt-bar span {
  background: #258148;
}

.alfa-marine-exam-root .amq-attempt.is-fail .amq-attempt-bar span {
  background: #c33838;
}

@media (max-width: 640px) {
  .alfa-marine-exam-root .amq-charts {
    grid-template-columns: 1fr;
  }
}

.alfa-marine-exam-root h1,
.alfa-marine-exam-root h2,
.alfa-marine-exam-root h3 {
  color: var(--amq-ink);
  font-family: inherit;
  line-height: 1.35;
  margin: 0 0 16px;
}

.alfa-marine-exam-root h1 {
  font-size: clamp(23px, 4vw, 30px);
  font-weight: 750;
}

.alfa-marine-exam-root h2 {
  font-size: clamp(19px, 3vw, 23px);
  font-weight: 650;
  margin: 22px 0;
}

.alfa-marine-exam-root h3 {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 12px;
}

.alfa-marine-exam-root p {
  margin: 0 0 16px;
}

.alfa-marine-exam-root .amq-home > p,
.alfa-marine-exam-root .amq-muted {
  color: var(--amq-muted);
}

.alfa-marine-exam-root .amq-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.alfa-marine-exam-root .amq-actions-stacked {
  flex-direction: column;
  margin-top: 24px;
}

.alfa-marine-exam-root .amq-button {
  align-items: center;
  appearance: none;
  border: 1px solid var(--amq-border);
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 600;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.alfa-marine-exam-root .amq-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.alfa-marine-exam-root .amq-button:focus-visible,
.alfa-marine-exam-root .amq-option:focus-visible {
  outline: 3px solid rgba(23, 105, 194, 0.38);
  outline-offset: 2px;
}

.alfa-marine-exam-root .amq-primary {
  background: var(--amq-blue);
  border-color: var(--amq-blue);
  color: #fff;
}

.alfa-marine-exam-root .amq-primary:hover:not(:disabled) {
  background: var(--amq-blue-dark);
  border-color: var(--amq-blue-dark);
}

.alfa-marine-exam-root .amq-secondary {
  background: #fff;
  color: #26384a;
}

.alfa-marine-exam-root .amq-secondary:hover:not(:disabled) {
  background: #f2f7fc;
  border-color: #aabed3;
}

.alfa-marine-exam-root .amq-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.alfa-marine-exam-root .amq-meta {
  align-items: center;
  color: var(--amq-muted);
  display: flex;
  font-size: 14px;
  justify-content: space-between;
}

.alfa-marine-exam-root .amq-time {
  color: var(--amq-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.alfa-marine-exam-root .amq-time-low,
.alfa-marine-exam-root .amq-warning {
  color: #bd2c2c;
}

.alfa-marine-exam-root .amq-warning {
  background: #fff0f0;
  border-radius: 7px;
  font-size: 14px;
  padding: 9px 12px;
}

.alfa-marine-exam-root .amq-progress {
  background: #e3edf7;
  border-radius: 100px;
  height: 8px;
  margin: 14px 0 24px;
  overflow: hidden;
}

.alfa-marine-exam-root .amq-progress span {
  background: var(--amq-blue);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 200ms ease;
}

.alfa-marine-exam-root .amq-options {
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.alfa-marine-exam-root .amq-option {
  align-items: flex-start;
  appearance: none;
  background: #fff;
  border: 1px solid var(--amq-border);
  border-radius: 10px;
  color: var(--amq-ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 12px;
  justify-content: flex-start;
  line-height: 1.5;
  max-width: 100%;
  min-width: 0;
  padding: 14px 16px;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
  white-space: normal !important;
  width: 100%;
}

.alfa-marine-exam-root .amq-option:hover {
  background: #f5f9fe;
  border-color: #9ab8d8;
}

.alfa-marine-exam-root .amq-option.amq-selected {
  background: #eef5ff;
  border-color: var(--amq-blue);
  box-shadow: inset 0 0 0 1px var(--amq-blue);
}

.alfa-marine-exam-root .amq-letter {
  flex: 0 0 auto;
  font-weight: 700;
  line-height: 1.5;
}

.alfa-marine-exam-root .amq-option-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.alfa-marine-exam-root .amq-study-label {
  color: var(--amq-blue);
  font-weight: 650;
}

.alfa-marine-exam-root .amq-study-option {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--amq-border);
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 13px 14px;
}

.alfa-marine-exam-root .amq-correct {
  background: #effaf3;
  border-color: #b7dfc2;
  color: #17653a;
}

.alfa-marine-exam-root .amq-correct-label {
  color: #17653a;
  margin-left: auto;
}

.alfa-marine-exam-root .amq-study-nav {
  justify-content: space-between;
  margin: 22px 0 12px;
}

.alfa-marine-exam-root .amq-full {
  width: 100%;
}

.alfa-marine-exam-root .amq-results {
  max-width: 760px;
}

.alfa-marine-exam-root .amq-result-icon {
  align-items: center;
  border-radius: 50%;
  display: flex;
  font-size: 46px;
  font-weight: 700;
  height: 76px;
  justify-content: center;
  margin: 0 auto 18px;
  width: 76px;
}

.alfa-marine-exam-root .amq-pass {
  background: #e6f7eb;
  color: #258148;
}

.alfa-marine-exam-root .amq-fail {
  background: #ffeded;
  color: #c33838;
}

.alfa-marine-exam-root .amq-result-heading,
.alfa-marine-exam-root .amq-score,
.alfa-marine-exam-root .amq-results > .amq-muted {
  text-align: center;
}

.alfa-marine-exam-root .amq-score {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.alfa-marine-exam-root .amq-review {
  margin: 30px 0;
}

.alfa-marine-exam-root .amq-review-item {
  border-radius: 10px;
  margin: 16px 0;
  padding: 16px;
}

.alfa-marine-exam-root .amq-review-correct {
  background: #f0faf3;
}

.alfa-marine-exam-root .amq-review-wrong {
  background: #fff1f1;
}

.alfa-marine-exam-root .amq-review-choice {
  border-radius: 6px;
  margin: 5px 0;
  padding: 6px 8px;
}

.alfa-marine-exam-root .amq-review-picked {
  background: #dbf2e2;
  color: #155b34;
}

.alfa-marine-exam-root .amq-review-picked-wrong {
  background: #ffe0e0;
  color: #8f2727;
}

.alfa-marine-exam-root .amq-review-correct-answer {
  background: #dbf2e2;
  color: #155b34;
}

@media (max-width: 560px) {
  .alfa-marine-exam-root .amq-shell {
    min-height: 460px;
    padding: 14px 8px;
  }

  .alfa-marine-exam-root .amq-card {
    border-radius: 12px;
    padding: 20px 16px;
  }

  .alfa-marine-exam-root .amq-study-nav {
    gap: 8px;
  }

  .alfa-marine-exam-root .amq-study-nav .amq-button {
    flex: 1;
    padding-left: 8px;
    padding-right: 8px;
  }

  .alfa-marine-exam-root .amq-correct-label {
    margin-left: 31px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alfa-marine-exam-root *,
  .alfa-marine-exam-root *::before,
  .alfa-marine-exam-root *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
