:root {
  --red: #c8102e;
  --red-dark: #98001b;
  --red-soft: #fff0f2;
  --white: #ffffff;
  --off-white: #f7f3ee;
  --green: #15805d;
  --accent: #c8102e;
  --accent-strong: #a30824;
  --accent-soft: #fde8ec;
  --ink: #181210;
  --muted: #6f6662;
  --line: rgba(22, 29, 45, 0.09);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 8px 24px rgba(19, 28, 55, 0.07);
  --shadow-lg: 0 32px 80px rgba(17, 24, 39, 0.15);
  --radius-sm: 12px;
  --radius-lg: 30px;
  --shell: min(1200px, calc(100% - 64px));
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  color-scheme: light;
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 98px;
}

html[data-text-size="large"] {
  font-size: 19px;
}

html[data-theme="dark"] {
  --off-white: #191412;
  --ink: #fff8f4;
  --muted: #c2b6af;
  --line: rgba(255, 255, 255, 0.1);
  --accent-soft: #43141e;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(200, 16, 46, 0.025) 8% 14%, transparent 14% 20%, rgba(200, 16, 46, 0.025) 20% 26%, transparent 26%),
    radial-gradient(circle at 4% 6%, rgba(200, 16, 46, 0.08), transparent 28rem),
    radial-gradient(circle at 96% 30%, rgba(93, 31, 24, 0.06), transparent 25rem),
    var(--off-white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.65;
  letter-spacing: -0.008em;
  text-rendering: optimizeLegibility;
}

button,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(200, 16, 46, 0.42);
  outline-offset: 3px;
}

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

.skip-link {
  padding: 10px 14px;
  position: fixed;
  z-index: 1000;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  color: var(--white);
  background: var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-toolbar {
  padding-top: env(safe-area-inset-top);
  position: sticky;
  z-index: 100;
  top: 0;
  background: rgba(255, 253, 250, 0.9);
  border-top: 5px solid var(--red);
  border-bottom: 1px solid rgba(54, 38, 33, 0.1);
  box-shadow: 0 8px 30px rgba(45, 27, 22, 0.05);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.toolbar-inner {
  width: var(--shell);
  min-height: 78px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 62px;
  height: 58px;
  flex: 0 0 62px;
  display: block;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.brand small {
  color: #786d68;
  font-size: 0.62rem;
  letter-spacing: 0.035em;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-toggle {
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #645a56;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(22, 29, 45, 0.1);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.header-toggle:hover {
  color: var(--red-dark);
  background: var(--white);
  border-color: rgba(200, 16, 46, 0.25);
  transform: translateY(-1px);
}

.header-toggle[aria-pressed="true"] {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.text-size-icon {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.theme-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.language-picker {
  min-height: 44px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #645a56;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(22, 29, 45, 0.1);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.language-picker:focus-within {
  background: var(--white);
  border-color: rgba(200, 16, 46, 0.32);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.language-picker select {
  max-width: 130px;
  min-height: 42px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.75rem;
  font-weight: 650;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(200, 16, 46, 0.04) 8% 14%, transparent 14% 20%, rgba(200, 16, 46, 0.04) 20% 26%, transparent 26%),
    radial-gradient(circle at 4% 6%, rgba(200, 16, 46, 0.16), transparent 28rem),
    radial-gradient(circle at 96% 30%, rgba(117, 57, 45, 0.11), transparent 25rem),
    var(--off-white);
}

html[data-theme="dark"] .app-toolbar {
  background: rgba(28, 22, 20, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .brand strong {
  color: #fff8f4;
}

html[data-theme="dark"] .brand small,
html[data-theme="dark"] .header-toggle,
html[data-theme="dark"] .language-picker {
  color: #d4c7c0;
}

html[data-theme="dark"] .header-toggle,
html[data-theme="dark"] .language-picker {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .header-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .header-toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

html[data-theme="dark"] .language-picker select {
  color: #fff8f4;
}

html[data-theme="dark"] .language-picker option {
  color: #181210;
  background: #fff;
}

html[data-theme="dark"] .quiz-rules li {
  color: #e6dcd7;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .quiz-rules .critical-rule {
  color: #ffb4c0;
  background: rgba(200, 16, 46, 0.12);
  border-color: rgba(255, 101, 127, 0.18);
}

.quiz-shell {
  width: var(--shell);
  margin-inline: auto;
}

.quiz-section {
  padding-block:
    clamp(58px, 9vw, 118px)
    max(clamp(72px, 10vw, 132px), env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(500px, 1fr);
  align-items: center;
  gap: clamp(44px, 7vw, 100px);
}

.quiz-copy {
  position: relative;
}

.quiz-copy::before {
  content: "KFC";
  position: absolute;
  z-index: -1;
  top: -86px;
  left: -18px;
  color: rgba(200, 16, 46, 0.045);
  font-size: clamp(7rem, 15vw, 12rem);
  font-weight: 950;
  letter-spacing: -0.1em;
  line-height: 1;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-strong);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.eyebrow span {
  min-width: 30px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(200, 16, 46, 0.14);
  border-radius: 999px;
  font-size: 0.57rem;
}

.eyebrow b {
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  overflow-wrap: anywhere;
  letter-spacing: -0.045em;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.quiz-copy > p:not(.eyebrow) {
  max-width: 470px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

.quiz-rules {
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: #525b6d;
  font-size: 0.78rem;
  font-weight: 600;
  list-style: none;
}

.quiz-rules li {
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(22, 29, 45, 0.06);
  border-radius: 12px;
}

.quiz-rules span {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 7px;
}

.quiz-rules b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quiz-rules .critical-rule {
  color: #a82b34;
  background: #fff5f5;
  border-color: rgba(229, 72, 77, 0.1);
}

.quiz-rules .critical-rule span {
  color: var(--white);
  background: var(--red);
}

.quiz-card {
  width: 100%;
  min-width: 0;
  min-height: 620px;
  padding: clamp(30px, 5vw, 50px);
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(200, 16, 46, 0.12) 7% 12%, transparent 12% 17%, rgba(200, 16, 46, 0.12) 17% 22%, transparent 22%) top right / 240px 150px no-repeat,
    radial-gradient(circle at 88% 8%, rgba(200, 16, 46, 0.3), transparent 19rem),
    radial-gradient(circle at 8% 100%, rgba(200, 16, 46, 0.11), transparent 20rem),
    linear-gradient(145deg, #241d1b, #110e0d 68%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 36px 80px rgba(45, 25, 20, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
  scroll-margin-top: calc(82px + env(safe-area-inset-top));
}

.quiz-card::before {
  content: "";
  width: 240px;
  height: 240px;
  position: absolute;
  top: -170px;
  right: -80px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.018), 0 0 0 80px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}

.quiz-start,
.quiz-question,
.quiz-result {
  position: relative;
  z-index: 1;
}

.quiz-start,
.quiz-result {
  align-self: center;
  text-align: center;
}

.quiz-start {
  padding-block: clamp(16px, 4vw, 50px);
}

.quiz-start-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: linear-gradient(145deg, #e21b3c, #a60722);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 15px 34px rgba(200, 16, 46, 0.32), inset 0 1px rgba(255, 255, 255, 0.25);
  font-size: 1.55rem;
  font-weight: 800;
}

.quiz-label {
  margin: 0 0 12px;
  color: #ff8da0 !important;
  font-size: 0.62rem !important;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-start h2,
.quiz-result > h2 {
  margin: 0 0 16px;
  color: var(--white);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.quiz-start > p:not(.quiz-label),
.quiz-result > p:not(.quiz-label) {
  max-width: 480px;
  margin: 0 auto 30px;
  color: #aeb3c0;
  font-size: 0.82rem;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button-primary {
  color: var(--white);
  background: linear-gradient(135deg, #df1738, #b50827);
  border-color: rgba(122, 0, 22, 0.3);
  box-shadow: 0 10px 24px rgba(200, 16, 46, 0.25);
}

.button-primary:hover {
  background: linear-gradient(135deg, #ef2948, #a70622);
  box-shadow: 0 14px 30px rgba(200, 16, 46, 0.34);
  transform: translateY(-2px);
}

.button-wide {
  width: 100%;
  min-height: 52px;
}

.quiz-development-warning {
  margin-bottom: 18px;
  padding: 14px 16px;
  position: relative;
  z-index: 2;
  color: #8a5200;
  background: #fff8e8;
  border: 1px solid rgba(208, 126, 0, 0.28);
  border-radius: 14px;
}

.quiz-development-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #6f4100;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiz-development-warning p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.quiz-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #a3a8b5;
  font-size: 0.68rem;
  font-weight: 650;
}

.progress-track {
  height: 6px;
  margin: 12px 0 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #c8102e, #ff657f);
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(200, 16, 46, 0.48);
  transition: width 220ms ease;
}

.question-label-row {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.question-label-row .quiz-label {
  margin-bottom: 0;
}

.critical-badge {
  padding: 5px 9px;
  color: var(--white);
  background: rgba(229, 72, 77, 0.18);
  border: 1px solid rgba(255, 113, 119, 0.42);
  border-radius: 8px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.quiz-question h2 {
  margin: 0 0 18px;
  color: var(--white);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 680;
  line-height: 1.24;
}

.quiz-reference {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 17px;
  padding: 6px 9px;
  color: #ffc1cb;
  background: rgba(200, 16, 46, 0.12);
  border: 1px solid rgba(255, 101, 127, 0.25);
  border-radius: 8px;
  font-size: 0.68rem;
}

.quiz-reference strong {
  color: #fff1f3;
}

.answer-list {
  display: grid;
  gap: 9px;
}

.answer-option {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #eef0f6;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background 170ms ease, border 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.answer-option:hover:not(:disabled) {
  background: rgba(200, 16, 46, 0.14);
  border-color: rgba(255, 101, 127, 0.52);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateX(3px);
}

.answer-option:disabled {
  cursor: default;
}

.answer-letter {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #b9beca;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 9px;
  font-size: 0.66rem;
  font-weight: 800;
}

.answer-option.is-correct {
  color: #eafff2;
  background: rgba(21, 128, 93, 0.22);
  border-color: rgba(76, 201, 157, 0.48);
}

.answer-option.is-wrong {
  color: #fff0f0;
  background: rgba(229, 72, 77, 0.18);
  border-color: rgba(242, 100, 107, 0.5);
}

.answer-option.is-correct .answer-letter {
  color: var(--white);
  background: #178660;
  border-color: #178660;
}

.answer-option.is-wrong .answer-letter {
  color: var(--white);
  background: #d9444e;
  border-color: #d9444e;
}

.answer-feedback {
  margin-top: 18px;
  padding: 16px 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
  text-align: left;
}

.answer-feedback strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.answer-feedback p {
  margin: 0;
  color: #4e4e4e;
  font-size: 0.78rem;
}

.answer-feedback.is-critical-error {
  background: #fff1f2;
  border-color: rgba(229, 72, 77, 0.34);
}

.answer-feedback.is-critical-error strong,
.answer-feedback.is-critical-error p {
  color: #6f171c;
}

.quiz-next {
  margin-top: 18px;
  margin-left: auto;
}

.result-ring {
  width: 174px;
  height: 174px;
  margin: 0 auto 28px;
  display: grid;
  place-content: center;
  background: linear-gradient(145deg, #d71920, #9d0e15);
  border: 8px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  box-shadow: inset 0 0 0 20px #14161c, 0 18px 44px rgba(0, 0, 0, 0.2);
}

.result-ring strong,
.result-ring span {
  display: block;
  text-align: center;
}

.result-ring strong {
  max-width: 130px;
  font-size: 2.15rem;
  font-weight: 720;
  line-height: 1;
  overflow-wrap: normal;
}

.result-ring span {
  margin-top: 6px;
  color: #d1d5de;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-detail {
  margin-top: -18px !important;
  color: #ff9bac !important;
  font-weight: 800;
}

.inspection-report {
  width: min(100%, 720px);
  margin: 30px auto 0;
  padding: 20px;
  text-align: start;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
}

.inspection-report-grid,
.inspection-category-grid {
  display: grid;
  gap: 10px;
}

.inspection-report-grid,
.inspection-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inspection-report-grid article,
.inspection-category-grid article,
.inspection-overall-result {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
}

.inspection-report-grid span,
.inspection-category-grid span,
.inspection-overall-result span {
  display: block;
  color: #aeb3c0;
  font-size: 0.68rem;
  line-height: 1.35;
}

.inspection-report-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--white);
  font-size: 1.45rem;
}

.inspection-category-grid {
  margin-top: 10px;
}

.inspection-category-grid article {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.inspection-category-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--white);
  font-size: 1.8rem;
}

.inspection-category-grid b,
.inspection-overall-result strong {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
}

.inspection-category-grid .is-pass,
.inspection-overall-result .is-pass {
  color: #8ff0c6;
  background: rgba(22, 134, 83, 0.22);
}

.inspection-category-grid .is-fail,
.inspection-overall-result .is-fail {
  color: #ffacb0;
  background: rgba(215, 25, 32, 0.22);
}

.inspection-critical-metric {
  border-color: rgba(215, 25, 32, 0.22) !important;
}

.inspection-overall-result {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.critical-fail-reason {
  max-width: 720px;
  margin: 22px auto 26px;
  padding: 17px 18px;
  color: var(--white);
  background: rgba(229, 72, 77, 0.13);
  border: 1px solid rgba(242, 100, 107, 0.4);
  border-radius: 14px;
  text-align: left;
}

.critical-fail-reason strong {
  color: #ffacb0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.critical-fail-reason ul {
  margin: 8px 0 0;
  padding-inline-start: 20px;
}

.critical-fail-reason li + li {
  margin-top: 6px;
}

.incorrect-review {
  margin: 34px 0 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.incorrect-review h3 {
  margin: 0 0 16px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.incorrect-list {
  display: grid;
  gap: 10px;
}

.incorrect-item {
  min-width: 0;
  padding: 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.09);
  overflow-wrap: anywhere;
}

.incorrect-item.is-critical {
  border-left: 4px solid var(--red);
}

.incorrect-item-header {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.incorrect-category {
  color: var(--red-dark);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.incorrect-critical {
  min-height: 26px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  color: var(--white);
  background: #d71920;
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(215, 25, 32, 0.22);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.incorrect-question {
  margin: 0 0 11px;
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 800;
  line-height: 1.4;
}

.incorrect-answer,
.incorrect-explanation {
  margin: 5px 0 0;
  color: #4d4d4d;
  font-size: 0.76rem;
  line-height: 1.48;
}

.incorrect-answer strong,
.incorrect-explanation strong {
  color: var(--ink);
}

.incorrect-inspection-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.incorrect-inspection-meta span {
  padding: 6px 9px;
  color: #505664;
  background: #f1f3f7;
  border-radius: 8px;
  font-size: 0.68rem;
}

.result-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.quiz-result.result-pass {
  animation: result-pop 650ms cubic-bezier(0.2, 0.9, 0.25, 1.2);
}

.quiz-result.result-fail {
  animation: result-shake 480ms ease;
}

.site-footer {
  padding:
    28px max(24px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  color: #b9aaa4;
  background: #130f0e;
  border-top: 5px solid var(--red);
}

.footer-inner {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.7rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner strong {
  color: #f1f2f5;
}

.footer-thanks {
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer-thanks > span {
  color: #ef2948;
  font-size: 0.85rem;
}

.noscript-message {
  padding: 16px;
  color: var(--white);
  background: var(--red-dark);
  text-align: center;
}

html[dir="rtl"] body {
  font-family: Tahoma, Arial, ui-sans-serif, sans-serif;
}

html[dir="rtl"] .answer-option,
html[dir="rtl"] .answer-feedback,
html[dir="rtl"] .critical-fail-reason,
html[dir="rtl"] .incorrect-review {
  text-align: right;
}

html[dir="rtl"] .answer-option:hover:not(:disabled) {
  transform: translateX(-3px);
}

html[dir="rtl"] .incorrect-item.is-critical {
  border-right: 4px solid var(--red);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
}

html[dir="rtl"] .quiz-next {
  margin-right: auto;
  margin-left: 0;
}

html[dir="rtl"] .quiz-next > span[aria-hidden="true"],
html[dir="rtl"] .button-wide > span[aria-hidden="true"] {
  transform: rotate(180deg);
}

@keyframes result-pop {
  from { opacity: 0.7; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes result-shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(4px); }
}

@media (max-width: 900px) {
  :root {
    --shell: min(100% - 32px, 760px);
  }

  html {
    scroll-padding-top: 88px;
  }

  .quiz-section {
    padding-top: 52px;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .quiz-copy > p:not(.eyebrow) {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .toggle-label {
    display: none;
  }

  .header-toggle {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  :root {
    --shell: calc(100% - 24px);
  }

  .toolbar-inner {
    min-height: 64px;
    gap: 10px;
  }

  .brand-mark {
    width: 48px;
    height: 45px;
    flex-basis: 48px;
  }

  .brand strong {
    max-width: 120px;
  }

  .brand small {
    display: none;
  }

  .language-picker {
    padding-inline: 8px;
  }

  .language-picker select {
    max-width: 82px;
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
  }

  .quiz-section {
    padding-top: 38px;
    padding-bottom: max(72px, env(safe-area-inset-bottom));
    gap: 34px;
  }

  .quiz-card {
    min-height: 570px;
    padding: 26px 18px;
    border-radius: 23px;
  }

  .quiz-start h2,
  .quiz-result > h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .quiz-question h2 {
    font-size: clamp(1.3rem, 6.5vw, 1.8rem);
  }

  .answer-option {
    grid-template-columns: 29px minmax(0, 1fr);
  }

  .inspection-report {
    padding: 12px;
  }

  .inspection-report-grid,
  .inspection-category-grid {
    grid-template-columns: 1fr;
  }

  .inspection-category-grid article {
    min-height: 104px;
  }

  .incorrect-item-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions,
  .result-actions .button {
    width: 100%;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  :root {
    --shell: calc(100% - 16px);
  }

  .brand strong {
    max-width: 76px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 40px;
    height: 38px;
    flex-basis: 40px;
  }

  .toolbar-actions {
    gap: 4px;
  }

  .header-toggle {
    width: 38px;
    min-height: 38px;
  }

  .language-picker {
    min-height: 38px;
  }

  .language-picker > span[aria-hidden="true"] {
    display: none;
  }

  .quiz-card {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Modern presentation: shared surfaces keep every quiz state theme-aware. */
:root {
  --shell: min(1280px, calc(100% - 80px));
  --page: #f6f5f2;
  --surface: #ffffff;
  --surface-secondary: #f6f6f4;
  --surface-ink: #202020;
  --surface-muted: #656565;
  --surface-line: #e6e5e1;
  --brand-accent: #b80d2a;
}

html[data-theme="dark"] {
  --page: #141414;
  --surface: #202020;
  --surface-secondary: #292929;
  --surface-ink: #f8f7f4;
  --surface-muted: #bdbcb8;
  --surface-line: #3a3937;
  --brand-accent: #ff9aab;
}

body,
html[data-theme="dark"] body {
  background: var(--page);
  display: flex;
  flex-direction: column;
  font-size: 1rem;
}

.app-toolbar,
html[data-theme="dark"] .app-toolbar {
  position: relative;
  background: var(--surface);
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--surface-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.toolbar-inner {
  min-height: 116px;
  padding-block: 18px;
  flex-wrap: wrap;
  gap: 20px 32px;
}

.brand { gap: 22px; }
.brand-copy { min-width: 0; }

.site-logo {
  display: block;
  width: 360px;
  max-width: 100%;
  height: auto;
  flex: 0 1 auto;
  object-fit: contain;
}

.brand .brand-mark {
  display: block;
  width: 128px;
  height: auto;
  max-width: none;
  flex: 0 0 auto;
  object-fit: contain;
  align-self: center;
}

.brand strong,
.brand small {
  max-width: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.brand strong {
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-transform: none;
}

.brand small,
html[data-theme="dark"] .brand small {
  display: block;
  margin-top: 5px;
  color: var(--surface-muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.toolbar-actions { gap: 8px; flex-wrap: wrap; }
.header-toggle,
.language-picker,
html[data-theme="dark"] .header-toggle,
html[data-theme="dark"] .language-picker {
  min-height: 46px;
  background: var(--surface-secondary);
  color: var(--surface-ink);
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  box-shadow: none;
}
.header-toggle { font-size: 0.78rem; padding-inline: 14px; }
.language-picker select { font-size: 0.8rem; max-width: 140px; }
.language-picker:focus-within { background: var(--surface); }
.header-toggle[aria-pressed="true"] { color: #fff; background: var(--red); }

.quiz-shell { flex: 1; }
.quiz-section {
  padding-block: 76px 88px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(40px, 6vw, 88px);
}
.quiz-copy { padding-block: 18px; }
.quiz-copy::before { content: none; }
.eyebrow {
  margin-bottom: 26px;
  gap: 12px;
  color: var(--brand-accent);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.eyebrow span {
  height: 30px;
  min-width: 38px;
  color: var(--brand-accent);
  background: var(--surface);
  border-color: var(--surface-line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}
h1 {
  font-size: clamp(2.8rem, 4.8vw, 4.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.065em;
}
.quiz-copy > p:not(.eyebrow) {
  color: var(--surface-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-top: 24px;
}
.quiz-rules {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-line);
  gap: 4px;
  font-size: 0.86rem;
}
.quiz-rules li,
html[data-theme="dark"] .quiz-rules li {
  color: var(--surface-muted);
  background: transparent;
  border: 0;
  padding: 10px 0;
  gap: 12px;
}
.quiz-rules b { font-weight: 500; }
.quiz-rules span {
  background: var(--surface);
  color: var(--brand-accent);
  border: 1px solid var(--surface-line);
  border-radius: 50%;
}
.quiz-rules .critical-rule,
html[data-theme="dark"] .quiz-rules .critical-rule {
  color: var(--brand-accent);
  background: transparent;
}
.quiz-rules .critical-rule b { font-weight: 700; }

.quiz-card {
  min-height: 0;
  padding: clamp(26px, 3.5vw, 48px);
  color: var(--surface-ink);
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  box-shadow: 0 16px 48px -28px rgba(20, 20, 20, 0.22);
  scroll-margin-top: 24px;
}
.quiz-card::before {
  top: 0;
  right: 44px;
  width: 64px;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--red) 0 12px, transparent 12px 26px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.quiz-start { padding-block: 8px; text-align: start; }
.quiz-start-icon {
  margin: 0 0 36px;
  width: 64px;
  height: 64px;
  color: var(--red);
  background: #fff0f2;
  border: 1px solid #f4dbe0;
  border-radius: 18px;
  box-shadow: none;
  font-size: 2rem;
}
.quiz-label {
  color: var(--brand-accent) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
}
.quiz-start h2,
.quiz-result > h2 {
  color: var(--surface-ink);
  font-size: clamp(2rem, 3vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.045em;
}
.quiz-start > p:not(.quiz-label),
.quiz-result > p:not(.quiz-label) {
  color: var(--surface-muted);
  font-size: 0.94rem;
  line-height: 1.7;
  margin: 22px 0 30px;
}
.button {
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 0.92rem;
}
.button-primary { background: var(--red); box-shadow: none; }
.button-primary:hover { background: var(--red-dark); box-shadow: 0 8px 20px #c8102e20; }
.button-wide { justify-content: space-between; }
.quiz-question h2 { color: var(--surface-ink); font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.35; }
.quiz-progress-row { color: var(--surface-muted); font-size: 0.8rem; flex-wrap: wrap; }
.progress-track { height: 5px; background: var(--surface-line); }
.progress-track span { background: var(--red); box-shadow: none; }
.quiz-reference { background: var(--surface-secondary); border-color: var(--surface-line); color: var(--surface-muted); font-size: 0.78rem; }
.quiz-reference strong { color: var(--surface-ink); }
.critical-badge { color: var(--brand-accent); font-size: 0.65rem; }
.answer-list { gap: 12px; }
.answer-option {
  min-height: 64px;
  padding: 16px;
  background: var(--surface);
  color: var(--surface-ink);
  border-color: var(--surface-line);
  font-size: 0.95rem;
  line-height: 1.5;
}
.answer-letter { color: var(--surface-muted); background: var(--surface-secondary); border-color: var(--surface-line); font-size: 0.75rem; }
.answer-option:hover:not(:disabled) { background: var(--surface-secondary); border-color: var(--brand-accent); box-shadow: none; }
.answer-option.is-correct { color: #125b3c; background: #e7f6ed; border-color: #71b58e; }
.answer-option.is-wrong { color: #942033; background: #fff0f2; border-color: #de8391; }
.answer-feedback,
.incorrect-item { background: var(--surface-secondary); border-color: var(--surface-line); color: var(--surface-ink); box-shadow: none; }
.answer-feedback strong,
.incorrect-question,
.incorrect-answer strong,
.incorrect-explanation strong { color: var(--surface-ink); }
.answer-feedback p,
.incorrect-answer,
.incorrect-explanation { color: var(--surface-muted); font-size: 0.88rem; }
.incorrect-category { color: var(--brand-accent); }
.incorrect-inspection-meta span { background: var(--surface); color: var(--surface-muted); }
.result-ring { color: #fff; box-shadow: none; border-width: 4px; }
.result-detail { color: var(--brand-accent) !important; }
.inspection-report { background: var(--surface-secondary); border-color: var(--surface-line); }
.inspection-report-grid article,
.inspection-category-grid article,
.inspection-overall-result { background: var(--surface); border-color: var(--surface-line); }
.inspection-report-grid span,
.inspection-category-grid span,
.inspection-overall-result span { color: var(--surface-muted); font-size: 0.78rem; }
.inspection-report-grid strong,
.inspection-category-grid strong,
.incorrect-review h3 { color: var(--surface-ink); }
.inspection-category-grid .is-pass,
.inspection-overall-result .is-pass { color: #125b3c; background: #e7f6ed; }
.inspection-category-grid .is-fail,
.inspection-overall-result .is-fail { color: #942033; background: #fff0f2; }
.critical-fail-reason { color: var(--surface-ink); }
.critical-fail-reason strong { color: var(--brand-accent); }
.incorrect-review { border-color: var(--surface-line); }
.site-footer {
  padding: 0;
  color: var(--surface-muted);
  background: transparent;
  border-top: 1px solid var(--surface-line);
}
.footer-inner { padding-block: 26px max(26px, env(safe-area-inset-bottom)); gap: 16px; flex-wrap: wrap; font-size: 0.78rem; }
.footer-inner strong { color: var(--surface-ink); }
.footer-thanks { display: block; }
.footer-thanks > span { margin-inline-end: 5px; }

@media (max-width: 1000px) {
  :root { --shell: calc(100% - 48px); }
  .quiz-section { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 44px 60px; }
  .quiz-copy > p:not(.eyebrow) { max-width: 680px; }
  .quiz-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
  .quiz-card { width: 100%; }
  .quiz-start { max-width: 640px; margin-inline: auto; }
}
@media (max-width: 760px) {
  .toolbar-inner { gap: 20px; }
  .header-toggle { padding: 0; min-width: 46px; }
}
@media (max-width: 560px) {
  :root { --shell: calc(100% - 36px); }
  .toolbar-inner { padding-block: 20px 16px; gap: 18px; }
  .brand { width: 100%; gap: 18px; }
  .brand .brand-mark { width: 112px; height: auto; flex: 0 0 auto; }
  .brand strong { max-width: none; font-size: 1.35rem; }
  .toolbar-actions { width: 100%; flex-wrap: nowrap; }
  .header-toggle { width: 48px; height: 46px; }
  .language-picker { margin-inline-start: auto; }
  .language-picker select { max-width: 140px; }
  .quiz-section { padding-block: 28px 44px; gap: 24px; }
  .quiz-copy { padding-block: 8px; }
  h1 { font-size: 2.85rem; }
  .quiz-rules { grid-template-columns: minmax(0, 1fr); margin-top: 24px; padding-top: 14px; }
  .quiz-card { padding: 28px 20px; border-radius: 20px; }
  .quiz-start-icon { margin-bottom: 28px; }
  .quiz-start h2, .quiz-result > h2 { font-size: 2rem; }
  .footer-inner { align-items: flex-start; gap: 8px; }
}

/* Team photography stays decorative; all quiz copy sits on opaque surfaces. */
.quiz-shell {
  position: relative;
  isolation: isolate;
  padding-top: clamp(230px, 25vw, 360px);
}
.quiz-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: clamp(330px, 38vw, 540px);
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 50%, var(--page) 100%),
    url("../assets/kfc-team-background.png") center 38% / cover no-repeat;
}
html[data-theme="dark"] .quiz-shell::before {
  background:
    linear-gradient(to bottom, rgba(20, 20, 20, 0.12) 30%, var(--page) 100%),
    url("../assets/kfc-team-background.png") center 38% / cover no-repeat;
}
.quiz-section {
  padding-top: 0;
  gap: clamp(24px, 3vw, 40px);
}
.quiz-copy {
  padding: clamp(24px, 3vw, 40px);
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  box-shadow: 0 16px 48px -28px rgba(20, 20, 20, 0.18);
}
@media (max-width: 560px) {
  .quiz-shell { padding-top: 220px; }
  .quiz-shell::before,
  html[data-theme="dark"] .quiz-shell::before {
    height: 310px;
    background-position: center, 42% 30%;
  }
  .quiz-copy { padding: 24px 20px; border-radius: 20px; }
  .quiz-copy h1 { font-size: 2.5rem; }
}
