/* Keep list, preview and result in the same viewport-sized frame. Expanding a
   disclosure must only grow the scrollable content, never re-center the modal.
   The running test and its small confirmation dialogs have their own layout. */
.bk-company-test[role=presentation]:not([data-fullpage=true]) {
  box-sizing: border-box;
  height: 100dvh;
  grid-template-rows: minmax(0, 1fr);
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
}
.bk-company-test:not([data-fullpage=true]) > .bk-test-modal {
  box-sizing: border-box;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  min-width: 0;
}
.bk-company-test > .bk-test-modal > header + div {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
@media (max-width: 700px) {
  .bk-company-test[role=presentation]:not([data-fullpage=true]) {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  }
}

/* Test dialogs are already inside the safe-area frame. Never apply the
   learning-page header offset a second time to their title row. */
.bk-company-test .bk-test-modal > header.bk-test-dialog-header,
dialog.bk-question-review > header {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 16px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex: none !important;
}
.bk-company-test .bk-test-dialog-header h2 { margin: 0 !important; line-height: 1.3 !important; }
.bk-company-test .bk-test-modal > footer { padding: 12px 24px !important; }
.bk-company-test .bk-test-modal > div { padding-top: 20px; }
.bk-test-page .bk-test-quiz > details {
  white-space: normal;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 12px !important;
  margin: 0 0 12px !important;
}
.bk-test-page .bk-test-quiz > details:not([open]) > :not(summary) { display: none !important; }
.bk-test-page .bk-test-quiz > details > summary { margin: 0 !important; padding: 0 !important; line-height: 1.5; }
.bk-test-page .dots .quiz-dot-button[aria-current] { outline: none; }
.bk-test-page .dots .quiz-dot-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.bk-test-page .quiz-navigator-toggle { display: grid; place-items: center; }
.bk-test-page .quiz-navigator-toggle > svg { width: 20px; height: 20px; display: block; transition: transform .18s; }
.bk-test-page .quiz-navigator-toggle[aria-expanded=true] > svg { transform: rotate(180deg); }
.bk-test-submit-short { display: none; }
.bk-review-save-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.bk-review-save-row > small { flex: 1; min-width: 0; max-width: 65ch; }
.bk-question-review .bk-review-save-row > button { flex: 0 0 auto; margin: 0 0 0 auto; font-weight: 700; }
.bk-question-review-body fieldset { min-width: 0; }
.bk-question-review-body :is(input,textarea) { min-width: 0; }
.bk-question-review-body fieldset legend { padding: 0 8px; font-weight: 700; }
.bk-question-review-body textarea { resize: vertical; min-height: 112px; }
.bk-question-review-body :is(input,textarea):focus-visible {
  outline: 2px solid var(--eval-score,#a9e46c);
  outline-offset: 2px;
}
.ek-learning-theme .bk-question-review-body :is(input,textarea):focus-visible { outline-color: #ffb347; }
@media (max-width: 600px) {
  .bk-company-test .bk-test-modal > header.bk-test-dialog-header,
  dialog.bk-question-review > header { padding: 12px 14px !important; gap: 12px !important; }
  .bk-company-test .bk-test-modal > footer { padding: 10px 14px !important; }
  .bk-company-test .bk-test-modal > div { padding: 16px 14px; }
  .bk-test-submit-short { display: inline; }
  .bk-test-submit-wide { display: none; }
  .bk-review-save-row { flex-wrap: wrap; gap: 12px; }
  .bk-review-save-row > small { flex-basis: 100%; }
  .bk-question-review-body { padding: 16px !important; gap: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-test-page .quiz-navigator-toggle > svg { transition: none; }
}

.bk-test-page .quiz-question-nav > button { gap: 6px; }

.bk-test-entry { flex-wrap:wrap; }
.bk-test-entry > span:not(.bk-test-news) { flex:1; min-width:130px; }
.bk-test-entry .bk-test-news, .bk-company-test .bk-test-news {
  display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center;
  gap:6px; padding:6px 10px; border:1px solid #8cbf69; border-radius:999px;
  background:#214234; color:#d0f8a9; font-size:12px; font-weight:750; line-height:1.2;
  white-space:nowrap; vertical-align:middle;
}
.bk-test-entry .bk-test-news > span, .bk-company-test .bk-test-news > span { display:inline; }
.bk-test-news > svg { flex:none; }
.bk-company-test h3 > .bk-test-news { margin-inline-start:10px; }
.ek-learning-theme .bk-test-entry .bk-test-news,
body.ek-learning-theme .bk-company-test .bk-test-news,
.bk-company-test[data-notice-world="volt"] .bk-test-news {
  background:#493526; color:#ffd38b; border-color:#aa7c39;
}

.bk-test-disclosure,
.bk-tests-loading,
.bk-test-list-intro {
  --test-accent: #97dce7;
  --test-surface: #0a2733;
  --test-line: #345663;
  --test-muted: #acc5ce;
  --test-text: #e9f5fa;
  --test-ghost: rgb(151 220 231 / 12%);
  color: var(--test-text);
  min-width: 0;
}
.ek-learning-theme :is(.bk-test-disclosure,.bk-tests-loading,.bk-test-list-intro),
[data-notice-world="volt"] :is(.bk-test-disclosure,.bk-tests-loading,.bk-test-list-intro),
.bk-tests-loading[data-world="volt"] {
  --test-accent: #ffc16d;
  --test-surface: #211b2e;
  --test-line: #564562;
  --test-muted: #c9bdd4;
  --test-text: #f6f0fc;
  --test-ghost: rgb(220 203 240 / 12%);
}
.bk-test-disclosure {
  padding: 0;
  border: 1px solid var(--test-line);
  border-radius: 16px;
  background: var(--test-surface);
  font-size: 13px;
  line-height: 1.65;
}
.bk-test-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-height: 64px;
  box-sizing: border-box;
  list-style: none;
  cursor: pointer;
  color: var(--test-text);
}
.bk-test-disclosure > summary::-webkit-details-marker { display: none; }
.bk-test-disclosure > summary::marker { content: ''; }
.bk-disclosure-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; color: var(--test-accent); background: var(--test-ghost); border-radius: 11px; }
.bk-disclosure-copy { flex: 1; min-width: 0; }
.bk-disclosure-copy > strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.bk-disclosure-copy > small { display: block; margin-top: 4px; color: var(--test-muted); font-size: 12px; line-height: 1.5; }
.bk-disclosure-chevron { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--test-line); border-radius: 50%; color: var(--test-accent); }
.bk-disclosure-chevron svg { display: block; transition: transform .2s ease; }
.bk-test-disclosure[open] > summary .bk-disclosure-chevron svg { transform: rotate(180deg); }
.bk-test-disclosure > summary:focus-visible { outline: 2px solid var(--test-accent); outline-offset: 3px; border-radius: 16px; }
.bk-disclosure-content { padding: 0 18px 18px; border-top: 1px solid var(--test-line); }
.bk-disclosure-content p { color: var(--test-muted); margin: 16px 0; }
.bk-disclosure-content p:last-child { margin-bottom: 0; }
.bk-disclosure-content ul { margin: 16px 0; padding-left: 20px; color: var(--test-muted); }
.bk-disclosure-content li + li { margin-top: 8px; }
.bk-disclosure-content .bk-grade-disclaimer { border-top: 1px solid var(--test-line); padding-top: 14px; font-size: 12px; }
.bk-grade-color[data-grade="1"] { --grade-color: #9de5b1; }
.bk-grade-color[data-grade="2"] { --grade-color: #b9e582; }
.bk-grade-color[data-grade="3"] { --grade-color: #f6db81; }
.bk-grade-color[data-grade="4"] { --grade-color: #ffc078; }
.bk-grade-color[data-grade="5"] { --grade-color: #ffab94; }
.bk-grade-color[data-grade="6"] { --grade-color: #ff9eb3; }
.bk-test-scoreboard .bk-score-summary h4.bk-grade-color { color: var(--grade-color, var(--eval-score)); }
.bk-grade-scale { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.bk-grade-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--grade-color) 30%, var(--test-surface)); border-radius: 12px; background: color-mix(in srgb, var(--grade-color) 7%, var(--test-surface)); }
.bk-grade-step-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--grade-color); }
.bk-grade-step-heading b { font-size: 16px; }
.bk-grade-step > span { font-size: 12px; color: var(--test-text); }
.bk-grade-step > small { font-size: 12px; color: var(--test-muted); }
.bk-grade-step[data-current="true"] { border-color: var(--grade-color); box-shadow: inset 0 0 0 1px var(--grade-color); background: color-mix(in srgb, var(--grade-color) 12%, var(--test-surface)); }
.bk-grade-step > em { font-size: 11px; font-style: normal; font-weight: 700; color: var(--grade-color); margin-top: 4px; }
.bk-test-list-intro { margin-bottom: 18px; }
.bk-test-list-intro > p { color: var(--test-muted); font-size: 14px; line-height: 1.65; margin: 0 0 16px; }
.bk-test-list-info > summary { padding: 10px 14px; min-height: 56px; }
.bk-test-list-info .bk-disclosure-icon { height: 32px; flex-basis: 32px; background: transparent; }
.bk-test-list-info .bk-disclosure-copy > strong { font-size: 13px; }
.bk-tests-loading { padding: 22px; border: 1px solid var(--test-line); border-radius: 18px; background: var(--test-surface); }
.bk-tests-loading-heading { display: flex; align-items: center; gap: 18px; }
.bk-tests-loading-heading > div { min-width: 0; }
.bk-tests-loading-heading h3 { font-size: 20px !important; line-height: 1.35 !important; margin: 0 !important; color: var(--test-text); }
.bk-tests-loading-heading p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; color: var(--test-muted); }
.bk-tests-loading-emblem { position: relative; display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px; color: var(--test-accent); }
.bk-tests-loading-emblem > i { position: absolute; inset: 0; border: 2px solid var(--test-ghost); border-top-color: var(--test-accent); border-radius: 50%; animation: bk-tests-orbit 2.4s linear infinite; }
.bk-tests-loading-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.bk-tests-loading-card { display: grid; gap: 13px; padding: 18px; border: 1px solid var(--test-line); border-radius: 12px; }
.bk-tests-loading-card > span { display: block; background: var(--test-ghost); border-radius: 5px; animation: bk-tests-breathe 2.2s ease-in-out infinite; }
.bk-tests-loading-card:nth-child(2) > span { animation-delay: .2s; }
.bk-tests-skeleton-tag { width: 35%; height: 13px; }
.bk-tests-skeleton-title { width: 82%; height: 14px; }
.bk-tests-skeleton-line { width: 60%; height: 7px; }
.bk-tests-skeleton-button { width: 100%; height: 32px; margin-top: 5px; }
@keyframes bk-tests-orbit { to { transform: rotate(360deg); } }
@keyframes bk-tests-breathe { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@media (max-width: 600px) {
  .bk-test-disclosure > summary { padding: 14px 12px; gap: 10px; }
  .bk-disclosure-icon { flex-basis: 32px; height: 32px; }
  .bk-disclosure-copy > strong { font-size: 14px; }
  .bk-disclosure-copy > small { font-size: 11px; }
  .bk-disclosure-content { padding: 0 14px 14px; }
  .bk-grade-scale { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .bk-grade-step { padding: 12px; }
  .bk-tests-loading { padding: 18px 14px; }
  .bk-tests-loading-heading { gap: 12px; }
  .bk-tests-loading-heading h3 { font-size: 18px !important; }
  .bk-tests-loading-emblem { width: 46px; height: 46px; flex-basis: 46px; }
  .bk-tests-loading-preview { grid-template-columns: 1fr; margin-top: 20px; }
  .bk-tests-loading-card { padding: 14px; gap: 10px; }
  .bk-tests-loading-card:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-tests-loading-emblem > i, .bk-tests-loading-card > span { animation: none; }
  .bk-disclosure-chevron svg { transition: none; }
}
