/* ============================================================
   OwlENT — bright clinical-doodle visual system
   White paper, confident black ink, teaching blue, and alert red.
   ============================================================ */

:root {
  --paper: #fcfdff;
  --paper-warm: #fffefd;
  --ink: #10141c;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #172033;
  --line-soft: #d8e2f0;
  --blue: #3f7ff2;
  --blue-deep: #205dcf;
  --blue-soft: #edf4ff;
  --blue-faint: #f6f9ff;
  --red: #ed2438;
  --red-deep: #c8172b;
  --red-soft: #fff0f2;
  --green: #198754;
  --green-soft: #eaf8f0;
  --amber: #b86e00;
  --amber-soft: #fff7df;
  --radius: 22px 18px 24px 17px;
  --radius-sm: 14px 11px 15px 10px;
  --shadow-blue: 7px 7px 0 rgba(63, 127, 242, 0.48);
  --shadow-red: 7px 7px 0 rgba(237, 36, 56, 0.48);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  line-height: 1.55;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 22%, rgba(63, 127, 242, 0.055) 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 62%, rgba(237, 36, 56, 0.04) 0 1px, transparent 1.5px);
  background-size: 25px 25px, 31px 31px;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(63, 127, 242, 0.38);
  outline-offset: 3px;
}

a { color: var(--blue-deep); }
a:hover { color: var(--red-deep); }

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.3rem, 5vw, 4.5rem); margin: 0; }
h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); }
p { margin-top: 0; }

/* ---------- persistent site chrome ---------- */

.site-body { padding-top: 76px; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 8px clamp(18px, 4vw, 58px);
  background: rgba(252, 253, 255, 0.94);
  border-bottom: 2px solid rgba(63, 127, 242, 0.42);
  backdrop-filter: blur(12px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 3%;
  bottom: -4px;
  height: 2px;
  background: rgba(63, 127, 242, 0.22);
  transform: rotate(-0.08deg);
  pointer-events: none;
}

.brand-mark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark img { width: 46px; height: 54px; object-fit: contain; }
.brand-word { font-size: 1.05rem; letter-spacing: -0.04em; }
.brand-word span, .site-footer strong span { color: var(--red); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-nav.home-hidden { visibility: hidden; pointer-events: none; }
.nav-home span { display: block; font-size: 1.6rem; line-height: 1; transform: translateY(-1px); }

.site-nav a {
  position: relative;
  padding: 8px 2px;
  color: var(--ink-soft);
  font-weight: 800;
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 3px;
  background: var(--blue);
  border-radius: 99px;
  transform: scaleX(0) rotate(-1deg);
  transition: transform 150ms ease;
}

.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1) rotate(-1deg); }

.corner-signin {
  justify-self: end;
  color: var(--ink);
  background: #fff;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 14px 11px 13px 10px;
  box-shadow: 3px 3px 0 rgba(237, 36, 56, 0.55);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.corner-signin:hover {
  color: var(--ink);
  transform: translate(-1px, -1px) rotate(-0.25deg);
  box-shadow: 5px 5px 0 rgba(237, 36, 56, 0.55);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 30px;
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 24px 28px 34px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- landing ---------- */

.home-hero {
  position: relative;
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 42px 24px 52px;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  width: min(680px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-deep);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-owl {
  display: block;
  width: clamp(150px, 18vw, 230px);
  max-height: 290px;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(7px 8px 0 rgba(63, 127, 242, 0.18));
  animation: owl-settle 600ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes owl-settle {
  from { opacity: 0; transform: translateY(12px) rotate(1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.owlent-title {
  display: inline-block;
  position: relative;
  margin-top: -2px;
  font-size: clamp(3.3rem, 7vw, 6.1rem);
  font-weight: 950;
  letter-spacing: -0.075em;
}

.owlent-title span { color: var(--red); }
.owlent-title::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -1%;
  bottom: -5px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  transform: rotate(-0.9deg);
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 42px);
  max-width: 590px;
  margin: 34px auto 0;
}

.portal-card {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.portal-library { box-shadow: var(--shadow-blue); transform: rotate(-0.35deg); }
.portal-quizzes { box-shadow: var(--shadow-red); transform: rotate(0.35deg); }
.portal-card:hover { transform: translate(-3px, -3px) rotate(0); }
.portal-library:hover { box-shadow: 11px 11px 0 rgba(63, 127, 242, 0.5); }
.portal-quizzes:hover { box-shadow: 11px 11px 0 rgba(237, 36, 56, 0.5); }

.portal-copy { position: relative; z-index: 2; }
.portal-copy strong { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1; }

.portal-art {
  position: absolute;
  inset: 1%;
  width: 98%;
  height: 98%;
  object-fit: contain;
  opacity: 0.5;
  transform: scale(1.08);
  pointer-events: none;
}

.doodle-field { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--blue); }
.anatomy-doodle {
  position: absolute;
  width: clamp(170px, 18vw, 300px);
  max-height: 42vh;
  object-fit: contain;
  opacity: 0.46;
}
.doodle-ear { left: 1%; top: 38%; transform: rotate(-8deg); }
.doodle-nose { right: 1%; top: 6%; transform: rotate(7deg); }
.doodle-voice { right: 3%; bottom: 2%; width: clamp(140px, 14vw, 220px); transform: rotate(-5deg); }
.doodle-plus { position: absolute; color: rgba(63, 127, 242, 0.36); font: 2.5rem "Comic Sans MS", cursive; }
.doodle-plus-one { left: 20%; top: 12%; transform: rotate(8deg); }
.doodle-plus-two { left: 19%; bottom: 10%; transform: rotate(-5deg); }
.doodle-dot { position: absolute; width: 18px; height: 18px; border: 3px solid currentColor; border-radius: 50%; opacity: 0.45; }
.doodle-dot-one { left: 10%; top: 16%; }
.doodle-dot-two { right: 21%; top: 50%; color: var(--red); }
.doodle-path { position: absolute; width: 150px; height: 80px; border: 3px dashed rgba(63, 127, 242, 0.26); border-color: rgba(63, 127, 242, 0.26) transparent transparent; border-radius: 50%; }
.doodle-path-one { left: 3%; bottom: 2%; transform: rotate(18deg); }
.doodle-path-two { right: 20%; top: 27%; width: 120px; transform: rotate(-15deg); }

/* ---------- shared interior pages ---------- */

.page-shell,
.quiz-session {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(46px, 7vw, 82px) 0 54px;
}

.page-heading { max-width: 790px; margin-bottom: 38px; }
.page-heading h1 { display: inline-block; position: relative; }
.page-heading h1::after {
  content: "";
  position: absolute;
  left: 2px;
  right: -16px;
  bottom: -8px;
  height: 5px;
  background: var(--blue);
  border-radius: 99px;
  transform: rotate(-0.8deg);
}
.page-heading > p:last-child { max-width: 700px; margin: 24px 0 0; color: var(--ink-soft); font-size: 1.05rem; }

.construction-banner {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
  align-items: center;
  gap: clamp(24px, 5vw, 58px);
  margin-bottom: 56px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--blue-soft);
  border: 3px solid var(--ink);
  border-radius: 31px 24px 35px 22px;
  box-shadow: var(--shadow-blue);
  transform: rotate(-0.15deg);
}
.construction-banner img { width: 100%; max-height: 300px; object-fit: contain; }
.construction-banner h2 { margin: 15px 0 12px; font-size: clamp(1.9rem, 4vw, 3rem); }
.construction-banner p { margin: 0; color: var(--ink-soft); }

.status-sticker,
.quiz-status {
  display: inline-flex;
  padding: 5px 10px;
  color: var(--red-deep);
  background: var(--red-soft);
  border: 2px solid var(--red);
  border-radius: 9px 12px 8px 11px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
}
.section-heading h2 { margin: 4px 0 0; }
.section-kicker { color: var(--blue-deep); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.scribble-note { color: var(--red); font: 0.95rem "Comic Sans MS", "Bradley Hand", cursive; transform: rotate(-2deg); }

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.resource-card {
  min-height: 330px;
  padding: 22px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 rgba(63, 127, 242, 0.26);
  transform: rotate(var(--tilt));
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.resource-card:hover { transform: translateY(-4px) rotate(0); box-shadow: 8px 8px 0 rgba(63, 127, 242, 0.34); }
.resource-card:nth-child(3n + 2) { box-shadow: 5px 5px 0 rgba(237, 36, 56, 0.22); }
.resource-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.resource-card-tools { display: flex; align-items: center; gap: 10px; }
.resource-edit-btn { padding: 5px 10px; color: var(--blue-deep); background: var(--blue-soft); border: 1.5px solid var(--blue); border-radius: 9px 7px 10px 6px; cursor: pointer; font-size: 0.74rem; font-weight: 900; }
.resource-edit-btn:hover { color: #fff; background: var(--blue); }
.topic-number { color: rgba(63, 127, 242, 0.4); font-size: 1.6rem; font-weight: 950; }
.topic-category { color: var(--red-deep); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.resource-card h2 { min-height: 2.15em; margin: 14px 0 10px; }
.resource-card p { color: var(--ink-soft); font-size: 0.92rem; }
.resource-card ul { margin: 18px 0 0; padding: 16px 0 0; border-top: 2px dashed var(--line-soft); list-style: none; }
.resource-card li { position: relative; margin: 8px 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; }
.resource-card li::before { content: "+"; position: absolute; left: 0; color: var(--blue); font-weight: 950; }

/* ---------- quiz menu ---------- */

.quizzes-page { padding-top: 28px; }
.quiz-heading-row { display: grid; grid-template-columns: minmax(0, 1fr) 460px; align-items: center; gap: 30px; margin-bottom: 22px; }
.quiz-heading { margin: 0; }
.thinking-owl-figure { position: relative; width: 460px; aspect-ratio: 920 / 510; overflow: hidden; justify-self: end; }
.thinking-owl-figure img { position: absolute; top: -78.5%; left: -8.7%; display: block; width: 117.4%; height: auto; max-width: none; }
.quiz-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; }
.quiz-card {
  position: relative;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 28px 20px 31px 18px;
  text-align: left;
}
button.quiz-card { cursor: pointer; }
.quiz-card.available { box-shadow: var(--shadow-red); transition: transform 150ms ease, box-shadow 150ms ease; }
.quiz-card.available:hover { transform: translate(-3px, -3px) rotate(-0.25deg); box-shadow: 11px 11px 0 rgba(237, 36, 56, 0.48); }
.quiz-card.coming-soon { background: var(--blue-faint); border-color: #8794a8; box-shadow: 5px 5px 0 rgba(63, 127, 242, 0.18); }
.quiz-card-index { position: absolute; top: 18px; right: 24px; color: rgba(63, 127, 242, 0.2); font-size: 3.4rem; font-weight: 950; line-height: 1; }
.quiz-card h2 { max-width: 80%; margin: 42px 0 12px; font-size: clamp(1.6rem, 3.2vw, 2.55rem); }
.quiz-card p { max-width: 580px; margin-bottom: 20px; color: var(--ink-soft); }
.quiz-meta { margin-top: auto; padding-top: 16px; color: var(--muted); border-top: 2px dashed var(--line-soft); width: 100%; font-size: 0.78rem; font-weight: 800; }
.quiz-launch { margin-top: 17px; color: var(--red-deep); font-weight: 900; }
.quiz-launch b { margin-left: 8px; font-size: 1.25rem; }
.coming-soon .quiz-status { color: var(--blue-deep); background: var(--blue-soft); border-color: var(--blue); }
.quiz-more-card { min-height: 220px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.3); border: 2px dashed rgba(100, 116, 139, 0.38); border-radius: var(--radius); color: var(--muted); }
.quiz-more-card h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }

/* ---------- TI-RADS start ---------- */

.breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.trainer-heading { margin-bottom: 22px; }
.trainer-heading > div:first-child { max-width: 780px; }
.trainer-heading h1 { margin-bottom: 18px; }
.trainer-heading p:last-child { color: var(--ink-soft); }
.format-intro { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; color: var(--red-deep); font: 1rem "Comic Sans MS", cursive; transform: rotate(-0.3deg); }
.format-intro i { height: 2px; max-width: 160px; flex: 1; background: var(--red); transform: rotate(1deg); }

.format-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.format-btn {
  position: relative;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(63, 127, 242, 0.28);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.format-btn:nth-child(2) { box-shadow: 6px 6px 0 rgba(237, 36, 56, 0.25); transform: rotate(0.3deg); }
.format-btn:hover { transform: translate(-3px, -4px) rotate(0); box-shadow: 10px 10px 0 rgba(63, 127, 242, 0.34); }
.format-btn:nth-child(2):hover { box-shadow: 10px 10px 0 rgba(237, 36, 56, 0.34); }
.format-number { position: absolute; top: 14px; right: 18px; color: rgba(63, 127, 242, 0.18); font-size: 4rem; font-weight: 950; line-height: 1; }
.format-level { position: relative; z-index: 1; color: var(--blue-deep); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase; }
.format-btn strong { position: relative; z-index: 1; max-width: 90%; margin: 44px 0 14px; font-size: 1.5rem; line-height: 1.08; }
.format-btn > span:not(.format-number):not(.format-level) { color: var(--ink-soft); font-size: 0.9rem; }

.reference-drawer { margin-top: 35px; padding: 0 22px; background: var(--blue-faint); border: 2px solid var(--line); border-radius: var(--radius-sm); }
.reference-drawer summary { padding: 16px 0; cursor: pointer; color: var(--blue-deep); font-weight: 900; }

/* ---------- ACR reference chart ---------- */

.chart-section { padding: 5px 0 24px; text-align: left; }
.chart-title { margin: 0 0 18px; font-size: 1.05rem; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.chart-col { padding: 13px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.chart-col h3 { margin: 0 0 10px; padding-bottom: 8px; color: var(--red-deep); border-bottom: 2px dashed var(--line-soft); font-size: 0.8rem; letter-spacing: 0.03em; text-transform: uppercase; }
.chart-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; color: var(--ink-soft); font-size: 0.78rem; }
.chart-pts { flex-shrink: 0; min-width: 28px; padding: 1px 8px; color: var(--blue-deep); background: var(--blue-soft); border-radius: 999px; font-family: ui-monospace, monospace; font-weight: 900; text-align: center; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 2px dashed var(--line-soft); font-size: 0.8rem; }
.chart-legend-title { color: var(--muted); }
.chart-legend-item { padding: 4px 9px; background: #fff; border: 1px solid var(--line-soft); border-radius: 7px; font-family: ui-monospace, monospace; }
.chart-legend-item b { color: var(--red-deep); }

/* ---------- quiz Cheat Sheet ---------- */

.cheat-sheet-tab { position: fixed; z-index: 72; right: 0; top: 50%; padding: 18px 10px; color: #fff; background: var(--blue-deep); border: 3px solid var(--ink); border-right: 0; border-radius: 14px 0 0 11px; box-shadow: -4px 4px 0 rgba(237, 36, 56, 0.38); cursor: pointer; font-weight: 900; letter-spacing: 0.04em; writing-mode: vertical-rl; transform: translateY(-50%); transition: padding 140ms ease, background 140ms ease; }
.cheat-sheet-tab:hover { padding-right: 14px; background: var(--red-deep); }
.cheat-sheet-backdrop { position: fixed; inset: 76px 0 0; z-index: 79; background: rgba(10, 16, 28, 0.35); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.cheat-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.cheat-sheet-drawer { position: fixed; z-index: 80; top: 76px; right: 0; bottom: 0; width: min(540px, 94vw); overflow-y: auto; padding: 22px 24px 32px; background: var(--paper); border-left: 3px solid var(--ink); box-shadow: -10px 0 0 rgba(63, 127, 242, 0.24); transform: translateX(calc(100% + 12px)); transition: transform 220ms cubic-bezier(.2,.8,.2,1); }
.cheat-sheet-drawer.open { transform: translateX(0); }
.cheat-sheet-header { position: sticky; top: -22px; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: -4px -4px 18px; padding: 10px 4px 12px; background: rgba(252, 253, 255, 0.96); border-bottom: 2px solid var(--line); }
.cheat-sheet-header strong { font-size: 1.25rem; }
.cheat-sheet-header .lightbox-close { position: static; }
.cheat-sheet-drawer .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- quiz session ---------- */

.quiz-session { width: min(1460px, calc(100% - 32px)); padding-top: 28px; }
.quiz-session-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 10px; }
.format-tracker { color: var(--ink-soft); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.06em; text-align: center; text-transform: uppercase; }
.perfect-score { justify-self: end; color: var(--blue-deep); font-size: 0.82rem; font-weight: 900; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr); gap: clamp(24px, 4vw, 52px); align-items: start; }
.quiz-image { position: sticky; top: 100px; }
.case-label { margin-bottom: 14px; }
.case-label h1 { font-size: clamp(1.35rem, 3vw, 2.3rem); }
.map-img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; background: #0b0d11; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-blue); }
.question-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 2px 0 15px; }
.question-heading span { font-size: 1.5rem; font-weight: 950; }
.question-heading p { margin: 0; color: var(--muted); font-size: 0.78rem; }

fieldset.question {
  margin: 0 0 15px;
  padding: 17px 18px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 rgba(63, 127, 242, 0.12);
}
fieldset.question legend { max-width: 94%; padding: 0 7px; color: var(--ink); font-weight: 900; line-height: 1.3; }
fieldset.correct { background: var(--green-soft); border-color: var(--green); box-shadow: 3px 3px 0 rgba(25, 135, 84, 0.2); }
fieldset.incorrect { background: var(--red-soft); border-color: var(--red); box-shadow: 3px 3px 0 rgba(237, 36, 56, 0.18); }
fieldset.revealed { background: var(--blue-soft); border-color: var(--blue); }
.indeterminate-note { margin: 10px 0 0; padding: 9px 11px; color: var(--ink-soft); background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 8px; font-size: 0.82rem; }
.indeterminate-note strong { color: var(--blue-deep); }
.radio-row { display: flex; flex-wrap: wrap; gap: 11px 20px; }
.radio-opt, .check-opt { cursor: pointer; }
.radio-opt.block, .check-opt { display: block; margin: 8px 0; }
.radio-opt input, .check-opt input { margin-right: 6px; accent-color: var(--blue); transform: scale(1.08); }
.hint { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.opt-mark { margin-left: 7px; font-weight: 950; }
.mark-good { color: var(--green); }
.mark-bad { color: var(--red-deep); }
.mark-reveal { color: var(--blue-deep); }

select,
.text-input,
.content-textarea {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 2px solid #9aa8bc;
  border-radius: 11px 9px 12px 8px;
}
textarea { resize: vertical; }
select:focus, .text-input:focus, .content-textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(63, 127, 242, 0.16); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 17px; }
button[type="submit"], #next-btn, #again-btn, .primary-btn, .lb-save-btn {
  padding: 11px 20px;
  color: #fff;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px 9px 13px 8px;
  box-shadow: 3px 3px 0 rgba(63, 127, 242, 0.52);
  cursor: pointer;
  font-weight: 900;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}
button[type="submit"]:hover, #next-btn:hover, #again-btn:hover, .primary-btn:hover, .lb-save-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(63, 127, 242, 0.52); }
.secondary-btn {
  padding: 10px 17px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 11px 9px 12px 8px;
  cursor: pointer;
  font-weight: 900;
}
.secondary-btn:hover { background: var(--blue-soft); }
.danger-outline { color: var(--red-deep); border-color: var(--red); }
.link-btn { padding: 0; color: var(--blue-deep); background: none; border: 0; cursor: pointer; font-weight: 900; text-decoration: none; }
.link-btn:hover { color: var(--red-deep); }
.hidden { display: none !important; }

.feedback-box { margin-top: 15px; padding: 14px 16px; background: var(--blue-faint); border: 2px solid var(--line); border-radius: var(--radius-sm); }
.fb-good { background: var(--green-soft); border-color: var(--green); }
.fb-bad { background: var(--red-soft); border-color: var(--red); }
.fb-revealed { background: var(--blue-soft); border-color: var(--blue); }
.breakdown-box { margin-top: 12px; padding-top: 12px; border-top: 2px dashed rgba(100, 116, 139, 0.3); }
.breakdown-row { margin: 6px 0; color: var(--ink-soft); }
.breakdown-row strong { color: var(--ink); }
.source-line { margin: 13px 4px 0; color: var(--muted); font-size: 0.74rem; overflow-wrap: anywhere; }
.source-line a { color: var(--blue-deep); }

/* ---------- results ---------- */

.results-page { max-width: 960px; }
.results-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 34px; margin-bottom: 34px; padding-bottom: 32px; border-bottom: 3px solid var(--ink); }
.score-dial { width: 150px; height: 150px; display: grid; place-items: center; background: conic-gradient(var(--blue) 0 var(--score), var(--blue-soft) var(--score) 360deg); border: 3px solid var(--ink); border-radius: 50% 47% 51% 46%; transform: rotate(-2deg); }
.score-dial::before { content: ""; grid-area: 1 / 1; width: 116px; height: 116px; background: #fff; border: 2px solid var(--ink); border-radius: 47% 52% 48% 53%; }
.score-dial span { grid-area: 1 / 1; position: relative; display: grid; text-align: center; transform: rotate(2deg); }
.score-dial strong { font-size: 2rem; }
.score-dial small { color: var(--muted); font-weight: 800; }
.results-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.score-line { margin: 14px 0 0; color: var(--ink-soft); }
.results-list { display: grid; gap: 11px; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.result-row.revealed-row { background: var(--blue-soft); border-color: var(--blue); }
.pill { display: inline-block; margin: 7px 4px 0 0; padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px; font: 0.72rem ui-monospace, monospace; }
.pill-good { color: var(--green); background: var(--green-soft); }
.pill-bad { color: var(--red-deep); background: var(--red-soft); }
.pill-revealed { color: var(--blue-deep); background: var(--blue-soft); }

/* ---------- generic cards / empty state ---------- */

.card { width: min(920px, calc(100% - 32px)); margin: 46px auto; padding: clamp(22px, 4vw, 36px); background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-blue); }
.card.wide { width: min(1460px, calc(100% - 32px)); max-width: none; }
.empty-state { padding: 42px; color: var(--ink-soft); text-align: center; }
.empty-state h1 { color: var(--ink); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }

/* ---------- auth ---------- */

.auth-body, .manage-body { padding-top: 76px; }
.compact-header { grid-template-columns: 1fr auto; }
.header-back { justify-self: end; color: var(--ink); font-weight: 900; text-decoration: none; }
.auth-shell { width: min(940px, calc(100% - 32px)); min-height: calc(100vh - 76px); display: grid; grid-template-columns: 0.8fr 1.2fr; align-items: center; gap: clamp(24px, 5vw, 58px); margin: 0 auto; padding: 50px 0; }
.auth-illustration { position: relative; text-align: center; }
.auth-illustration img { width: min(310px, 100%); max-height: 420px; object-fit: contain; filter: drop-shadow(8px 8px 0 rgba(63, 127, 242, 0.2)); }
.auth-scribble { position: absolute; top: -24px; right: -8px; color: var(--red); font: 1.05rem "Comic Sans MS", cursive; transform: rotate(8deg); }
.auth-card { width: 100%; margin: 0; box-shadow: var(--shadow-red); }
.auth-card h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.auth-intro { margin: 15px 0 25px; color: var(--ink-soft); }
.auth-footnote { margin: 24px 0 0; padding-top: 18px; color: var(--muted); border-top: 2px dashed var(--line-soft); font-size: 0.76rem; }

/* ---------- Library entry editor ---------- */

.library-entry-form { position: relative; width: min(720px, 100%); max-height: 90vh; overflow-y: auto; padding: 28px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-blue); }
.library-entry-form h2 { margin: 0 0 22px; }
.library-entry-form .content-textarea, .library-entry-form .text-input { max-width: none; }

/* ---------- management ---------- */

#manage-app { padding: 1px 0 48px; }
.manage-card { width: min(1260px, calc(100% - 32px)); max-width: none; box-shadow: var(--shadow-blue); }
.manage-topbar .eyebrow { margin-bottom: 5px; }
.manage-topbar h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.management-home { min-height: 560px; }
.management-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 44px; }
.management-option-card { position: relative; min-height: 330px; display: grid; place-items: center; overflow: hidden; padding: 28px; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); cursor: pointer; text-decoration: none; text-align: center; transition: transform 150ms ease, box-shadow 150ms ease; }
.management-option-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0.35; transform: scale(1.08); pointer-events: none; }
.management-option-card strong { position: relative; z-index: 1; font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
.management-library-card { box-shadow: var(--shadow-blue); transform: rotate(-0.25deg); }
.management-tirads-card { box-shadow: var(--shadow-red); transform: rotate(0.25deg); }
.management-option-card:hover { color: var(--ink); transform: translate(-3px, -3px) rotate(0); }
.management-library-card:hover { box-shadow: 11px 11px 0 rgba(63, 127, 242, 0.5); }
.management-tirads-card:hover { box-shadow: 11px 11px 0 rgba(237, 36, 56, 0.48); }
.tabs { display: flex; gap: 5px; overflow-x: auto; margin: 26px 0 24px; border-bottom: 3px solid var(--ink); }
.tab-btn { flex: 0 0 auto; padding: 11px 16px; color: var(--muted); background: none; border: 0; border-bottom: 5px solid transparent; cursor: pointer; font-weight: 900; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--blue-deep); border-bottom-color: var(--blue); }
.field-label { display: block; margin: 11px 0; color: var(--ink-soft); font-size: 0.86rem; font-weight: 800; }
.field-label input, .field-label textarea { display: block; margin-top: 5px; }
.map-img.preview { max-width: 480px; max-height: 400px; margin-top: 12px; }
.key-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.key-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--ink-soft); font-weight: 800; }
.key-grid select { min-width: 160px; }
.check-row { margin-top: 12px; }
.check-opt.inline { display: inline-block; margin-right: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.small-btn { padding: 6px 11px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 9px 7px 10px 6px; cursor: pointer; font-size: 0.78rem; font-weight: 800; }
.small-btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.small-btn.danger { color: var(--red-deep); border-color: var(--red); }
.small-btn.danger:hover { background: var(--red-soft); }
#snippet-text { width: 100%; padding: 12px; color: var(--ink); background: var(--blue-faint); border: 2px solid var(--line); border-radius: var(--radius-sm); font: 0.8rem ui-monospace, monospace; }
.image-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; padding: 14px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.image-row.removed { opacity: 0.55; background: #f1f4f8; }
.image-row.needs-review { border-color: var(--amber); border-left-width: 6px; }
.review-badge { margin: 7px 0; padding: 7px 10px; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 8px; font-size: 0.78rem; font-weight: 900; }
.approval-row { display: flex; align-items: center; gap: 8px; margin: 7px 0 10px; color: var(--muted); font-size: 0.78rem; }
.approval-select, .lb-approval-select { width: auto; max-width: none; padding: 4px 8px; background: #fff; border: 1.5px solid var(--line-soft); border-radius: 8px; font-size: 0.76rem; font-weight: 900; }
.approval-med-student .approval-select, .approval-med-student .lb-approval-select { color: var(--red-deep); border-color: var(--red); }
.approval-resident .approval-select, .approval-resident .lb-approval-select { color: var(--amber); border-color: var(--amber); }
.approval-attending .approval-select, .approval-attending .lb-approval-select { color: var(--green); border-color: var(--green); }
.thumb-btn { flex: 0 0 auto; padding: 0; background: none; border: 0; cursor: zoom-in; }
.thumb { display: block; width: 120px; height: 90px; object-fit: cover; background: #0b0d11; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.thumb-btn:hover .thumb { border-color: var(--blue); box-shadow: 3px 3px 0 rgba(63, 127, 242, 0.25); }
.image-row-info { min-width: 0; flex: 1; }
.stat-line { margin: 3px 0; color: var(--ink-soft); font-size: 0.8rem; overflow-wrap: anywhere; }
.stat-name { color: var(--ink); font-weight: 900; }

.content-editor-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 21px; background: var(--blue-soft); border: 2px solid var(--line); border-radius: var(--radius-sm); }
.content-editor-intro h2 { margin: 0 0 8px; }
.content-editor-intro p { max-width: 780px; margin: 0; color: var(--ink-soft); }
.content-section { margin-bottom: 24px !important; padding: 22px !important; box-shadow: none !important; }
.content-section .content-textarea { max-width: none; }
.content-editor-heading, .content-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.content-editor-heading { margin: 24px 0 12px; }
.content-editor-heading h3 { margin: 0; }
.content-topic-list, .content-quiz-list { display: grid; gap: 14px; }
.content-topic, .content-quiz { padding: 16px; background: var(--blue-faint); border: 2px dashed #9fb4d5; border-radius: var(--radius-sm); }
.content-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content-two-col .text-input { max-width: none; }
.content-actions { position: sticky; bottom: 12px; z-index: 5; padding: 14px; background: rgba(255, 255, 255, 0.96); border: 2px solid var(--line); border-radius: var(--radius-sm); box-shadow: 4px 4px 0 rgba(63, 127, 242, 0.28); backdrop-filter: blur(8px); }

/* ---------- management lightbox ---------- */

.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 16, 28, 0.82); }
.lightbox-inner { position: relative; width: min(1300px, 100%); max-height: 90vh; display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 22px; overflow: auto; padding: 24px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); }
.lightbox-image img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #0b0d11; border-radius: var(--radius-sm); }
.lightbox-info h2 { margin-top: 0; }
.lightbox-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding-right: 30px; }
.lightbox-nav .small-btn[disabled] { opacity: 0.35; cursor: default; }
.lb-factor { margin: 0 0 11px; padding: 11px; background: var(--blue-faint); border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm); }
.lb-factor strong { display: block; margin-bottom: 6px; }
.lb-factor select.lb-field { max-width: 100%; }
.lb-save-btn:disabled { color: var(--muted); background: #e7ebf0; border-color: #b2bdca; box-shadow: none; cursor: not-allowed; }
.lightbox-close { position: absolute; top: 10px; right: 13px; z-index: 2; padding: 4px 8px; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 50%; cursor: pointer; font-size: 1rem; }
.lightbox-close:hover { color: var(--red-deep); border-color: var(--red); }

/* ---------- in-quiz answer editor ---------- */

.answer-editor-inner { position: relative; width: min(1120px, 100%); max-height: 90vh; display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(380px, 1.1fr); gap: 24px; overflow: auto; padding: 24px; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); }
.answer-editor-image { align-self: start; position: sticky; top: 0; }
.answer-editor-image img { display: block; width: 100%; max-height: 74vh; object-fit: contain; background: #0b0d11; border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.answer-editor-form h2 { margin: 0 0 18px; }
.answer-editor-factor { display: block; margin-bottom: 11px; padding: 11px 12px; background: var(--blue-faint); border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm); }
.answer-editor-factor strong { display: block; margin-bottom: 6px; }
.answer-editor-factor select { max-width: none; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .anatomy-doodle, .doodle-path { display: none; }
}

@media (max-width: 980px) {
  .quiz-heading-row { grid-template-columns: 1fr 320px; }
  .thinking-owl-figure { width: 320px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .format-buttons { grid-template-columns: 1fr; }
  .format-btn { min-height: 230px; }
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-image { position: sticky; top: 76px; z-index: 20; align-self: start; padding: 8px 0 14px; background: var(--paper); }
  .map-img { max-height: 42vh; }
  .answer-editor-inner { grid-template-columns: 1fr; }
  .answer-editor-image { position: static; }
  .answer-editor-image img { max-height: 36vh; }
}

@media (max-width: 760px) {
  .site-body, .auth-body, .manage-body { padding-top: 68px; }
  .site-header { min-height: 68px; grid-template-columns: auto 1fr auto; gap: 12px; padding: 7px 14px; }
  .brand-mark img { width: 38px; height: 46px; }
  .brand-word { display: none; }
  .site-nav { justify-self: center; gap: 15px; }
  .site-nav a { font-size: 0.8rem; }
  .corner-signin { padding: 8px 10px; font-size: 0.7rem; }
  .home-hero { min-height: calc(100vh - 68px); padding-top: 34px; }
  .hero-owl { width: 142px; }
  .home-actions { grid-template-columns: 1fr; max-width: 390px; gap: 20px; }
  .doodle-plus-one { left: 8%; top: 12%; }
  .doodle-plus-two { left: auto; right: 8%; bottom: 9%; }
  .doodle-dot-one { left: 9%; top: 33%; }
  .doodle-dot-two { right: 9%; top: 55%; }
  .site-footer { flex-direction: column; gap: 8px; }
  .construction-banner { grid-template-columns: 1fr; }
  .construction-banner img { max-height: 230px; }
  .resource-grid, .quiz-menu-grid { grid-template-columns: 1fr; }
  .quiz-heading-row { grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
  .thinking-owl-figure { justify-self: center; }
  .resource-card { min-height: 0; }
  .quiz-session-bar { grid-template-columns: 1fr auto; }
  .quiz-image { top: 68px; }
  .format-tracker { display: none; }
  .results-hero { grid-template-columns: 1fr; }
  .score-dial { width: 125px; height: 125px; }
  .score-dial::before { width: 96px; height: 96px; }
  .auth-shell { grid-template-columns: 1fr; padding: 36px 0; }
  .auth-illustration { display: none; }
  .compact-header { grid-template-columns: 1fr auto; }
  .manage-topbar { align-items: flex-start; }
  .content-editor-intro { flex-direction: column-reverse; }
  .content-two-col { grid-template-columns: 1fr; gap: 0; }
  .management-option-grid { grid-template-columns: 1fr; }
  .management-option-card { min-height: 280px; }
  .lightbox-inner { grid-template-columns: 1fr; }
  .cheat-sheet-backdrop { inset: 68px 0 0; }
  .cheat-sheet-drawer { top: 68px; }
}

@media (max-width: 520px) {
  .site-header { grid-template-columns: auto 1fr auto; gap: 6px; padding-inline: 9px; }
  .site-nav { display: flex; gap: 8px; }
  .site-nav a { font-size: 0.68rem; }
  .nav-home span { font-size: 1.25rem; }
  .corner-signin { justify-self: end; }
  .home-hero { padding-left: 16px; padding-right: 16px; }
  .owlent-title { font-size: 3.4rem; }
  .portal-card { padding: 20px; }
  .thinking-owl-figure { width: 280px; }
  .page-shell, .quiz-session { width: min(100% - 22px, 1180px); padding-top: 36px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .construction-banner { padding: 18px; box-shadow: 5px 5px 0 rgba(63, 127, 242, 0.42); }
  .format-btn { min-height: 250px; }
  .case-label { align-items: flex-start; flex-direction: column; gap: 4px; }
  .map-img { max-height: 34vh; }
  .question-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  fieldset.question { padding: 14px 12px; }
  .radio-row { gap: 10px 13px; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions button { width: 100%; }
  .card { width: calc(100% - 22px); margin: 28px auto; padding: 18px; }
  .topbar, .manage-topbar { align-items: flex-start; flex-direction: column; }
  .image-row { flex-direction: column; }
  .thumb { width: 160px; height: 110px; }
  .content-actions { position: static; }
  .library-entry-form { padding: 22px 16px; }
  .cheat-sheet-tab { padding: 14px 8px; font-size: 0.78rem; }
  .cheat-sheet-drawer { width: 100%; padding-inline: 16px; }
  .cheat-sheet-drawer .chart-grid { grid-template-columns: 1fr; }
}

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