:root {
  --navy: #1F3864;
  --accent: #EFFD35;
  --danger: #C00000;
  --ink: #1C1C1C;
  --muted: #5C6570;
  --paper: #F3F5F8;
  --card: #ffffff;
  --line: #D5DCE6;
  --ok: #1F3864;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { min-height: 100vh; }
img { max-width: 100%; }

a { color: var(--navy); }
button, .btn, input, select, textarea { font: inherit; }

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  flex: 0 0 auto;
  background: transparent;
}
.word { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; line-height: 1.15; }
.desc { font-size: 13px; opacity: 0.9; margin-top: 2px; }

main {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 16px 16px 40px;
}
main.wide { width: min(1100px, 100%); }

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; color: var(--navy); }
h2 { font-size: 20px; margin: 0 0 8px; color: var(--navy); }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.tag { color: var(--navy); font-weight: 700; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 1px 0 rgba(31, 56, 100, 0.04);
}

.login {
  background: var(--paper);
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 40px;
}
.login-logo {
  width: 168px;
  height: 168px;
  border-radius: 28px;
  object-fit: contain;
}
.login-wrap h1, .login-wrap .lede { text-align: center; }
.login-wrap .card { width: min(480px, 100%); }

.name-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.name-list button, .choice, .btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--navy);
  background: var(--accent);
  color: var(--navy);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary, button.secondary {
  background: #fff;
  color: var(--navy);
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.callout {
  background: #fffbe6;
  border: 2px solid var(--navy);
  border-left: 8px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
}
.callout strong { display: block; margin-bottom: 4px; }
@media print {
  .top, .nav, .no-print { display: none !important; }
  body, .wrap { background: #fff; max-width: none; }
  a { color: inherit; text-decoration: none; }
}
.choice input[type="checkbox"] { width: 22px; height: 22px; margin-right: 10px; vertical-align: middle; }
.choice.picked-right { background: #E5F6E8; border-color: #1B7A32; }
.choice.picked-wrong { background: #FDECEC; border-color: var(--danger); }

label { display: block; font-weight: 700; margin: 10px 0 6px; }
input[type="text"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 72px; }

.banner {
  background: #FDECEC;
  color: var(--danger);
  border: 1px solid #F3B4B4;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}
.oknote {
  background: #E7F0FA;
  border: 1px solid #C5D4EA;
  border-radius: 12px;
  padding: 12px 14px;
}
.progress { font-weight: 700; color: var(--navy); margin-bottom: 6px; }

.pad-wrap { background: #fff; border: 2px dashed var(--navy); border-radius: 12px; }
canvas#pad { width: 100%; height: 180px; touch-action: none; display: block; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.nav a, .nav button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
  min-height: 40px;
  color: var(--navy);
}
.pill { display: inline-block; font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--navy); }
.pill.scheduled { background: var(--accent); color: var(--navy); }
.pill.draft { background: #fff; color: var(--navy); }
.week-card h2 { margin-bottom: 4px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.grid th, table.grid td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
table.grid th { background: var(--navy); color: #fff; position: sticky; top: 0; }
.sig-thumb { width: 72px; height: 36px; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.score { font-weight: 700; color: var(--navy); text-decoration: none; }
.miss { color: var(--muted); }

.q-block { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.right { color: #1B7A32; font-weight: 700; }
.wrong { color: var(--danger); font-weight: 700; }

footer.fine { margin-top: 24px; font-size: 13px; color: var(--muted); text-align: center; }
footer.fine a { color: var(--muted); }

@media (max-width: 720px) {
  table.grid { font-size: 13px; }
  .top { padding: 8px 10px; }
}
