:root {
  --ink: #15231f;
  --paper: #f3f0e7;
  --white: #fffdf8;
  --mint: #b8f2cf;
  --green: #0d6b4d;
  --lime: #d9f06b;
  --orange: #e66a36;
  --red: #b33a32;
  --line: #c8c4b8;
  --muted: #65716b;
  --shadow: 0 18px 50px rgba(21, 35, 31, 0.12);
  --header-rule: #30443d;
  --header-control: #24362f;
  --header-muted: #b9c5c0;
  --field-bg: #f7f5ef;
  --notice-bg: #fff1b9;
  --correct-bg: #e8f5ed;
  --incorrect-bg: #fbe8e6;
}

html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { min-width: 320px; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { min-height: 44px; border-radius: 7px !important; font-weight: 750 !important; }
button:not(:disabled):hover { transform: translateY(-1px); }
:focus-visible { outline: 3px solid var(--orange) !important; outline-offset: 3px !important; box-shadow: none !important; }

.site-masthead {
  position: sticky; top: 0; z-index: 40; min-height: 78px; padding: 12px clamp(18px, 4vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  color: var(--white); background: var(--ink); border-bottom: 1px solid var(--header-rule);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 2px 12px 2px 2px; background: var(--lime); color: var(--ink); font: 700 1rem Georgia, "Times New Roman", serif; }
.brand-icon { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font: 500 clamp(1rem, 2vw, 1.25rem) Georgia, "Times New Roman", serif; }
.brand small { display: block; margin-top: 3px; color: var(--header-muted); font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.training-chip { padding: 7px 10px; border: 1px solid var(--header-rule); border-radius: 5px; color: var(--lime); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

#root > div { min-height: calc(100vh - 78px) !important; padding: clamp(18px, 4vw, 48px) !important; background: var(--paper) !important; color: var(--ink) !important; }
#root > div > div { width: min(1080px, 100%) !important; max-width: none !important; }
#root .mt-12 { margin-top: clamp(24px, 5vw, 52px) !important; }
#root .rounded-lg { border-radius: 10px !important; }
#root .shadow-xl { border: 1px solid var(--line); background: var(--white) !important; box-shadow: var(--shadow) !important; }
#root .shadow { border: 1px solid var(--line); background: var(--white) !important; box-shadow: 0 5px 18px rgba(21,35,31,.08) !important; }
#root h1, #root h2.text-3xl { color: var(--ink) !important; font-family: Georgia, "Times New Roman", serif; font-weight: 500 !important; letter-spacing: -.035em; }
#root h1 { font-size: clamp(2.65rem, 7vw, 5.7rem) !important; line-height: .94 !important; }
#root h2.text-3xl { font-size: clamp(2rem, 4vw, 3.5rem) !important; line-height: 1 !important; }
#root h3 { color: var(--ink) !important; }
#root p, #root .text-gray-400, #root .text-gray-600 { color: var(--muted) !important; }
#root .p-8 { padding: clamp(22px, 4vw, 42px) !important; }
#root .bg-white, #root .bg-gray-800, #root .bg-gray-700 { background: var(--white) !important; color: var(--ink) !important; }
#root .bg-gray-50, #root .bg-gray-100, #root .bg-gray-200, #root .bg-indigo-50, #root .bg-indigo-100 { background: var(--field-bg) !important; color: var(--ink) !important; }
#root .text-white, #root .text-gray-200, #root .text-gray-900, #root .text-indigo-900, #root .text-indigo-400 { color: var(--ink) !important; }
#root .text-indigo-600, #root .text-indigo-700 { color: var(--green) !important; }
#root .border-gray-200, #root .border-gray-300, #root .border-gray-700, #root .border-indigo-300, #root .border-indigo-500, #root .border-indigo-600 { border-color: var(--line) !important; }
#root .bg-indigo-600, #root .bg-green-600 { background: var(--green) !important; color: #fff !important; border-color: var(--green) !important; }
#root .bg-indigo-600:hover, #root .bg-green-600:hover { background: #09573f !important; }
#root .bg-red-600 { background: var(--red) !important; color: #fff !important; }
#root .bg-green-50, #root .bg-green-100 { background: var(--correct-bg) !important; }
#root .border-green-200, #root .border-green-500, #root .border-green-600 { border-color: var(--green) !important; }
#root .text-green-400, #root .text-green-500, #root .text-green-600, #root .text-green-800, #root .text-green-900 { color: var(--green) !important; }
#root .bg-red-50 { background: var(--incorrect-bg) !important; }
#root .border-red-200, #root .border-red-500 { border-color: var(--red) !important; }
#root .text-red-600 { color: var(--red) !important; }
#root .text-yellow-500, #root .text-yellow-600 { color: #7a5a00 !important; }
#root input, #root select { min-height: 44px; border: 1px solid var(--line) !important; border-radius: 8px !important; background: var(--white) !important; color: var(--ink) !important; }
#root label:has(input[type="file"]), #root label:has(input[type="file"]) + div { display: none !important; }
#root img { border-radius: 10px; border: 1px solid var(--line); background: #fff; }
#root .grid { gap: 12px !important; }
#root button.p-2 { width: 44px; min-width: 44px; padding: 8px !important; }
#root h3.text-lg.font-bold + button { display: none !important; }

/* The React app marks its outer frame with bg-gray-900 in dark mode. */
#root > .bg-gray-900 { color-scheme: dark; background: #0f1a17 !important; color: #f3f0e7 !important; }
#root > .bg-gray-900 .shadow-xl { border-color: #3b5048 !important; background: #182823 !important; box-shadow: 0 18px 50px rgba(0, 0, 0, .28) !important; }
#root > .bg-gray-900 .shadow { border-color: #3b5048 !important; background: #22342e !important; }
#root > .bg-gray-900 h1,
#root > .bg-gray-900 h2.text-3xl,
#root > .bg-gray-900 h3,
#root > .bg-gray-900 .text-white,
#root > .bg-gray-900 .text-gray-200,
#root > .bg-gray-900 .text-gray-900,
#root > .bg-gray-900 .text-indigo-900,
#root > .bg-gray-900 .text-indigo-400 { color: #f3f0e7 !important; }
#root > .bg-gray-900 p,
#root > .bg-gray-900 .text-gray-400,
#root > .bg-gray-900 .text-gray-600 { color: #b9c5c0 !important; }
#root > .bg-gray-900 .bg-white,
#root > .bg-gray-900 .bg-gray-800,
#root > .bg-gray-900 .bg-gray-700 { background: #182823 !important; color: #f3f0e7 !important; }
#root > .bg-gray-900 .bg-gray-50,
#root > .bg-gray-900 .bg-gray-100,
#root > .bg-gray-900 .bg-gray-200,
#root > .bg-gray-900 .bg-indigo-50,
#root > .bg-gray-900 .bg-indigo-100 { background: #22342e !important; color: #f3f0e7 !important; }
#root > .bg-gray-900 .border-gray-200,
#root > .bg-gray-900 .border-gray-300,
#root > .bg-gray-900 .border-gray-700,
#root > .bg-gray-900 .border-indigo-300,
#root > .bg-gray-900 .border-indigo-500,
#root > .bg-gray-900 .border-indigo-600 { border-color: #3b5048 !important; }
#root > .bg-gray-900 input,
#root > .bg-gray-900 select { border-color: #3b5048 !important; background: #22342e !important; color: #f3f0e7 !important; }
#root > .bg-gray-900 .bg-green-50,
#root > .bg-gray-900 .bg-green-100 { background: #173d31 !important; }
#root > .bg-gray-900 .bg-red-50 { background: #3c2524 !important; }

.site-footer { padding: 26px clamp(18px, 4vw, 64px); display: grid; grid-template-columns: 1fr 1fr; gap: 28px; color: var(--header-muted); background: var(--ink); border-top: 1px solid var(--header-rule); font-size: .82rem; line-height: 1.55; }
.site-footer strong { display: block; margin-bottom: 3px; color: var(--lime); text-transform: uppercase; letter-spacing: .07em; }
.site-footer p { max-width: 680px; }

.acknowledgement { width: min(650px, calc(100% - 32px)); padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
.acknowledgement::backdrop { background: rgba(21, 35, 31, .76); }
.acknowledgement[open] { display: grid; grid-template-columns: auto 1fr; gap: 20px; }
.acknowledgement-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 2px 12px 2px 2px; background: var(--notice-bg); color: #7a5a00; font: 700 1.6rem Georgia, serif; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: .73rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.acknowledgement h2 { margin: 0 0 14px; font: 500 clamp(1.7rem, 4vw, 2.45rem)/1 Georgia, "Times New Roman", serif; letter-spacing: -.03em; }
.acknowledgement p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }
.acknowledge-button { margin-top: 10px; padding: 10px 20px; border: 0; background: var(--green); color: #fff; cursor: pointer; }

@media (max-width: 900px) {
  #root .md\:grid-cols-10, #root .md\:grid-cols-6, #root .md\:grid-cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 620px) {
  .site-masthead { position: static; align-items: flex-start; }
  .training-chip { display: none; }
  .brand small { max-width: 190px; }
  #root > div { padding: 14px !important; }
  #root .p-8 { padding: 20px !important; }
  #root .flex.gap-3, #root .flex.gap-4, #root .flex.gap-6 { flex-direction: column; }
  #root .grid-cols-2, #root .grid-cols-3, #root .grid-cols-5, #root .md\:grid-cols-2, #root .md\:grid-cols-5, #root .md\:grid-cols-6, #root .md\:grid-cols-10 { grid-template-columns: 1fr !important; }
  #root img { width: 100%; height: auto; }
  .site-footer { grid-template-columns: 1fr; gap: 16px; }
  .acknowledgement[open] { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-masthead, .site-footer, .acknowledgement, #root button, #root input, #root select { display: none !important; }
  #root > div, #root .shadow-xl { padding: 0 !important; background: #fff !important; border: 0 !important; box-shadow: none !important; }
}
