:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172026;
  background: #f5f7f8;
}

* { box-sizing: border-box; }

body { margin: 0; background: #f5f7f8; overflow-x: hidden; }

.hero {
  display: grid;
  min-height: 58vh;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(12, 43, 66, 0.93), rgba(0, 112, 126, 0.74)),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  color: #ffffff;
}

.content,
.details-grid,
.app-tool { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.content { padding: 46px 0 54px; }
.logo-panel { display: flex; width: min(100%, 980px); margin-bottom: 32px; padding: 18px 24px; border-radius: 8px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22); }
.logo-panel img { display: block; width: 100%; max-height: 78px; object-fit: contain; object-position: left center; }
.eyebrow { margin: 0 0 12px; color: #7ddbd2; font-size: 13px; font-weight: 800; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; font-size: clamp(36px, 4vw, 58px); line-height: 1.02; letter-spacing: 0; }
.intro { max-width: 760px; margin: 18px 0 18px; color: #eef6f7; font-size: 18px; line-height: 1.55; }
.small { margin: 14px 0 0; color: #dce8ec; font-size: 14px; font-weight: 650; line-height: 1.45; }

.value-line { display: flex; flex-wrap: wrap; gap: 10px; max-width: 900px; margin-bottom: 26px; }
.value-line span { padding: 9px 12px; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: #ffffff; font-size: 14px; font-weight: 800; }

.actions,
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button,
button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; text-decoration: none; }
.primary, #scanButton { background: #f2b544; color: #13212c; }
.secondary { background: #ffffff; color: #13212c; }
#saveSessionButton { background: #2f8f56; color: #ffffff; }
#cardsButton { background: #006f7e; color: #ffffff; }
#resetButton { background: #172026; color: #ffffff; }

.details-band { padding: 34px 0; background: #f5f7f8; }
.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.details-grid article,
.panel,
.question-card,
.panel-card,
.stats-strip article { border: 1px solid #dce3e7; border-radius: 8px; background: #ffffff; box-shadow: 0 10px 24px rgba(23, 32, 38, 0.06); }
.details-grid article { min-height: 174px; padding: 22px; }
.details-grid span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #006f7e; color: #ffffff; font-weight: 800; }
.details-grid h2 { margin: 18px 0 8px; color: #172026; font-size: 20px; }
.details-grid p { margin: 0; color: #51606d; font-size: 15px; line-height: 1.55; }

.workspace { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 18px; padding-top: 34px; padding-bottom: 36px; }
.workspace[hidden] { display: none; }
.panel,
.question-card,
.panel-card { padding: 22px; }
.panel h2 { margin: 0 0 14px; color: #0c4f62; font-size: 22px; }
.panel label { display: grid; gap: 7px; margin-bottom: 12px; color: #33414a; font-size: 14px; font-weight: 850; }
.status-message { min-height: 22px; margin: 12px 0 0; color: #51606d; font-size: 14px; font-weight: 800; line-height: 1.4; }
.status-message[data-tone="ok"] { color: #11683a; }
.status-message[data-tone="warn"] { color: #9b2d13; }
textarea,
input,
select { width: 100%; border: 1px solid #d1d9de; border-radius: 8px; color: #172026; font: inherit; }
textarea { min-height: 124px; resize: vertical; padding: 12px; line-height: 1.45; }
input,
select { min-height: 42px; padding: 0 10px; background: #ffffff; }
.answers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.scan-stage { display: grid; gap: 16px; align-content: start; }
.question-card { display: grid; gap: 12px; }
.kicker { margin: 0; color: #006f7e; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.question-card h2 { margin: 0; color: #13212c; font-size: clamp(24px, 3vw, 36px); line-height: 1.14; letter-spacing: 0; }
.answers-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.answers-preview li { min-height: 46px; padding: 12px; border: 1px solid #dce3e7; border-radius: 8px; background: #f8fafb; font-weight: 850; }
.answers-preview .correct { border-color: #4fb477; background: #e8f6ee; color: #11683a; }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-strip article { padding: 16px; }
.stats-strip strong { display: block; color: #0c4f62; font-size: 34px; line-height: 1; }
.stats-strip span { display: block; margin-top: 7px; color: #51606d; font-size: 13px; font-weight: 850; text-transform: uppercase; }

.results-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 16px; }
.panel-card h3 { margin: 0 0 14px; color: #13212c; font-size: 19px; }
.student-list { display: grid; gap: 8px; }
.student-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; min-height: 44px; padding: 9px 10px; border-radius: 8px; background: #f7f9fa; }
.student-row strong { color: #172026; }
.badge { min-width: 34px; padding: 5px 8px; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 900; }
.badge.ok { background: #dff4e8; color: #11683a; }
.badge.warn { background: #fde7df; color: #9b2d13; }
.badge.wait { background: #e9edf1; color: #51606d; }
.recommendations { display: grid; gap: 10px; }
.recommendations article { padding: 12px; border-radius: 8px; background: #f7f9fa; }
.recommendations strong { display: block; margin-bottom: 5px; color: #0c4f62; }
.recommendations p { margin: 0; color: #51606d; line-height: 1.45; }

.print-sheet { display: none; }
.scan-card { display: grid; width: 210px; height: 210px; place-items: center; border: 8px solid #111; break-inside: avoid; page-break-inside: avoid; }
.scan-card strong { display: grid; width: 74px; height: 74px; place-items: center; background: #ffffff; color: #111; font-size: 44px; }

#tooltip { position: fixed; z-index: 10; display: none; max-width: 240px; padding: 7px 9px; border-radius: 7px; background: #172026; color: #ffffff; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); font: 700 12px/1.3 system-ui, sans-serif; pointer-events: none; }

.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #0c2b42, #006f7e); }
.login-panel { width: min(100%, 430px); padding: 30px 28px; border-radius: 8px; background: #ffffff; box-shadow: 0 24px 52px rgba(0, 0, 0, 0.24); text-align: center; }
.brand-mark { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 18px; border-radius: 8px; background: #0c4f62; color: #ffffff; font-weight: 900; }
.login-panel h1 { margin: 0 0 10px; color: #0c4f62; font-size: 28px; }
.login-panel p { margin: 0; color: #51606d; line-height: 1.55; }
.google-button-wrap { display: grid; place-items: center; margin: 24px 0 0; }
.login-domain { margin-top: 20px !important; font-size: 13px; }
.login-domain strong { display: block; margin-top: 3px; }
.login-error { min-height: 24px; margin-top: 14px !important; color: #be2d2d !important; font-weight: 800; }

@media (max-width: 940px) {
  .content,
  .details-grid,
  .app-tool { width: min(760px, calc(100% - 32px)); }
  .hero { min-height: auto; }
  .details-grid,
  .workspace,
  .results-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content,
  .details-grid,
  .app-tool { width: calc(100% - 24px); }
  .content { padding: 28px 0 34px; }
  .logo-panel { margin-bottom: 24px; padding: 12px 14px; }
  .logo-panel img { max-height: 58px; }
  h1 { font-size: clamp(36px, 15vw, 52px); }
  .intro { font-size: 16px; }
  .button,
  button,
  .actions,
  .panel-actions,
  .panel-actions button { width: 100%; }
  .button,
  button { min-height: 48px; }
  .details-band { padding: 22px 0; }
  .details-grid article,
  .panel,
  .question-card,
  .panel-card { padding: 18px; }
  .workspace { gap: 14px; padding-top: 16px; padding-bottom: 20px; }
  .answers-grid,
  .answers-preview,
  .stats-strip { grid-template-columns: 1fr; }
  textarea { font-size: 16px; }
  .student-row { grid-template-columns: 1fr auto; }
  .student-row span:first-of-type { grid-column: 1 / -1; }
}

@media print {
  body { background: #ffffff; }
  .hero,
  .details-band,
  .app-tool,
  #tooltip { display: none !important; }
  .print-sheet { display: grid; grid-template-columns: repeat(2, 210px); gap: 24px; padding: 24px; }
}
