* { box-sizing: border-box; }
body { margin: 0; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 48px;
  background: var(--md-sys-color-surface, #f8f7fc); color: var(--md-sys-color-on-surface, #1a1a1e);
  font-family: Roboto, system-ui, sans-serif; }
.view { width: 100%; }
.view.narrow { max-width: 440px; margin-top: 6vh; }
.view.wide { max-width: 880px; }
.card-pad { display: block; padding: 24px; margin-bottom: 16px; }
.stack { display: grid; gap: 14px; margin-top: 16px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.full { width: 100%; }
.muted { color: var(--md-sys-color-on-surface-variant, #5a5a62); }
.small { font-size: 0.85rem; }
.error { color: var(--md-sys-color-error, #b3261e); }
.success { color: #1e7d32; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px;
  background: var(--md-sys-color-secondary-container, #e3defc); margin: 12px 0; }
.plain-btn { font: inherit; cursor: pointer; border: 0; border-radius: 999px; padding: 9px 18px;
  background: var(--md-sys-color-primary, #4a4a9e); color: #fff; display: inline-block; }
.plain-btn.secondary { background: transparent; color: var(--md-sys-color-primary, #4a4a9e);
  border: 1px solid var(--md-sys-color-outline, #999); }
.file-label { cursor: pointer; }
.doc-row, .section-box, .attempt-row { border: 1px solid var(--md-sys-color-outline-variant, #ccc); border-radius: 12px; padding: 16px; }
.section-box { border-left: 8px solid var(--box-color, #4a4a9e); }
.section-box h3 { margin: 0 0 6px; }
.doc-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.bar-track { height: 8px; border-radius: 4px; background: var(--md-sys-color-surface-container-high, #e5e3ee); overflow: hidden; }
.bar-fill { height: 100%; background: var(--md-sys-color-primary, #4a4a9e); transition: width .2s; }
.score-bar { height: 14px; border-radius: 7px; background: var(--md-sys-color-surface-container-high, #e5e3ee); overflow: hidden; }
.score-fill { height: 100%; }
.score-fill.good { background: #2e7d32; } .score-fill.mid { background: #ef8f00; } .score-fill.bad { background: #c62828; }
.option-btn { font: inherit; text-align: left; cursor: pointer; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--md-sys-color-outline, #999); background: transparent; color: inherit; }
.option-btn.selected { border-color: var(--md-sys-color-primary, #4a4a9e); background: var(--md-sys-color-primary-container, #dbe4ff); }
.avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; font-weight: 600;
  background: var(--md-sys-color-primary-container, #dbe4ff); color: var(--md-sys-color-on-primary-container, #12315e); }
input[type="number"], input[type="text"].inline, textarea.inline { font: inherit; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline, #999); background: transparent; color: inherit; width: 100%; }
label.fld { display: grid; gap: 4px; font-size: .85rem; }
table.dept { width: 100%; border-collapse: collapse; }
table.dept th, table.dept td { padding: 8px; border-bottom: 1px solid var(--md-sys-color-outline-variant, #ddd); text-align: left; }
tr.flagged td { background: #fdecea; color: #7f1d1d; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--md-sys-color-secondary-container, #e3defc); }
.pill.pass { background: #d9f2dd; color: #14532d; } .pill.fail { background: #fdecea; color: #7f1d1d; }
[hidden] { display: none !important; }

/* --- v0.2 routed shell --- */
body { background: var(--md-sys-color-surface, #f8f7fc); color: var(--md-sys-color-on-surface, #1a1a1e); font-family: Roboto, system-ui, sans-serif; }
#shell, #page { max-width: 920px; margin: 0 auto; padding: 16px 16px 0; }
#page { padding-bottom: 48px; }
.view.narrow { margin: 6vh auto 0; }
a.brand { text-decoration: none; color: inherit; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { border: 1px solid var(--md-sys-color-outline-variant, #ccc); border-radius: 12px; padding: 14px; display: grid; gap: 2px; }
.stat-num { font-size: 1.6rem; font-weight: 600; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--md-sys-color-error, #b3261e); color: #fff; font-size: .75rem; font-weight: 700; vertical-align: 2px; }
.option-btn.correct { border-color: #2e7d32; background: #d9f2dd; }
.option-btn.wrong { border-color: #c62828; background: #fdecea; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #23232a; color: #fff; padding: 12px 20px; border-radius: 999px; transition: all .25s; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
code { background: var(--md-sys-color-surface-container-high, #e5e3ee); padding: 2px 8px; border-radius: 6px; word-break: break-all; }

/* --- v0.3: logo, landing, plans, settings --- */
.brand-mark { height: 34px; width: auto; border-radius: 6px; }
.login-logo { width: 100%; max-width: 420px; display: block; margin: 4px auto 10px; }
.hero { text-align: center; padding: 28px 8px 8px; }
.hero-logo { width: 100%; max-width: 560px; }
.hero-line { font-size: 1.15rem; max-width: 620px; margin: 14px auto 18px; }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 12px; }
.plan-card { border: 1px solid var(--md-sys-color-outline-variant, #ccc); border-radius: 14px; padding: 14px 16px; }
.plan-card.current { border-color: var(--md-sys-color-primary, #4a4a9e); border-width: 2px; }
.plan-price { font-size: 1.25rem; font-weight: 600; margin: 2px 0; }
.steps li { margin: 8px 0; }
label.check { display: flex; gap: 8px; align-items: center; font-size: .95rem; }
select.inline { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--md-sys-color-outline, #999); background: transparent; color: inherit; }

/* --- v0.4: marketing site chrome --- */
#sitefoot { max-width: 920px; margin: 0 auto; padding: 0 16px 32px; }
.site-footer { border-top: 1px solid var(--md-sys-color-outline-variant, #ccc); margin-top: 24px; padding-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 14px; }
.footer-grid a { display: block; color: inherit; text-decoration: none; padding: 3px 0; font-size: .92rem; }
.footer-grid a:hover { text-decoration: underline; }
table.compare { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.compare th, table.compare td { border: 1px solid var(--md-sys-color-outline-variant, #ccc); padding: 8px 10px; text-align: left; vertical-align: top; }
table.compare th { background: var(--md-sys-color-surface-container-high, #e5e3ee); }
.legal h3 { margin: 18px 0 6px; }
.legal p, .legal li { line-height: 1.55; }
.faq-item { margin: 12px 0; }
textarea.inline { width: 100%; }

/* Certificate (v0.5.0) */
.cert { background: var(--hatch-widget-surface, #fff); border: 2px solid #4a4a9e; border-radius: 12px; padding: 36px 40px; text-align: center; }
.cert-mark { width: 64px; height: 64px; object-fit: contain; }
.cert-brand { letter-spacing: 4px; font-weight: 700; color: #4a4a9e; margin: 4px 0 0; }
.cert-title { font-size: 1.7rem; font-weight: 700; margin: 10px 0 18px; }
.cert-name { font-size: 1.5rem; font-weight: 700; margin: 4px 0; }
.cert-test { font-size: 1.15rem; font-weight: 600; margin: 4px 0 18px; }
.cert-stats { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin: 14px 0 20px; }
.cert-stats > div { display: flex; flex-direction: column; }
.cert-num { font-size: 1.25rem; font-weight: 700; }
.cert-sections { text-align: left; margin: 0 auto 16px; max-width: 560px; }
@media print {
  .topbar, #sitehead, #sitefoot, .no-print { display: none !important; }
  .cert { border-width: 3px; }
  body { background: #fff; }
}
