:root {
  --blue: #1e4d7b;
  --blue-2: #2b6ea8;
  --paper: #f6f8fb;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #627d98;
  --line: #d9e2ec;
  --good: #1b7a45;
  --good-bg: #e8f6ee;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #c9a227;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
header.app {
  background: var(--blue);
  color: #fff;
  padding: 16px 0;
}
header.app .wrap { padding-top: 0; padding-bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0; font-weight: 700; }
header .sub { opacity: .85; font-size: 13px; margin-top: 2px; }
header .nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
header .nav a {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 13px;
  border: 1px solid rgba(255,255,255,.45); padding: 7px 12px; border-radius: 9px;
}
header .nav a.active, header .nav a:hover { background: rgba(255,255,255,.16); }
.links { margin-top: 12px; }
.links a { display: inline-block; margin: 4px 8px 0 0; color: var(--blue); font-weight: 700; }
.progress {
  height: 6px; background: #d0dbe6; border-radius: 99px; overflow: hidden; margin: 12px 0 0;
}
.progress > span { display: block; height: 100%; background: var(--blue-2); width: 0; transition: width .25s; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

h2 { margin: 0 0 8px; font-size: 20px; color: var(--blue); }
h3.section {
  margin: 28px 0 10px;
  font-size: 16px;
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
  padding-bottom: 4px;
}
p.lead { color: var(--muted); margin: 0 0 14px; }

label { display: block; font-weight: 600; margin: 10px 0 6px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #9fb3c8;
  border-radius: 10px;
  background: #fff;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #8bb8e0; border-color: var(--blue-2); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.q { margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.q.compact { padding: 10px 14px; margin: 0 0 10px; }
.q.compact input[type="text"] { margin-top: 8px; }
.q .n { font-weight: 700; color: var(--blue); }
.q .pts { color: var(--muted); font-size: 12px; font-weight: 600; float: right; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.opts label, .checks label {
  font-weight: 500;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.opts label:hover, .checks label:hover { background: #eef4fa; }
.checks { display: grid; gap: 6px; margin-top: 8px; }
.table-fill { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table-fill th, .table-fill td { border: 1px solid #9fb3c8; padding: 6px; }
.table-fill th { background: #f0f4f8; text-align: left; width: 28%; }

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button, .btn {
  appearance: none;
  border: 0;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary { background: #627d98; }
button.ghost, .btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
button:disabled { opacity: .55; cursor: not-allowed; }

.score {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.ring {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #d9e2ec 0);
}
.ring span {
  width: 70px; height: 70px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-weight: 800; color: var(--blue); font-size: 20px;
}
.grade { font-size: 42px; font-weight: 800; color: var(--blue); line-height: 1; }
.ok { background: var(--good-bg); border-left: 4px solid var(--good); }
.no { background: var(--bad-bg); border-left: 4px solid var(--bad); }
.part { background: #fff8e6; border-left: 4px solid var(--warn); }
.review { margin-top: 8px; font-size: 14px; }
.review .you, .review .right { margin-top: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { background: #eef4fa; border-radius: 10px; padding: 10px; }
.stat b { display: block; color: var(--blue); }
.journal { width: 100%; border-collapse: collapse; font-size: 14px; }
.journal th, .journal td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.journal .who {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.warn-box { background: #fff8e6; border: 1px solid #e6d089; padding: 10px 12px; border-radius: 10px; }