/* Teitch — same navy and light blue as the printed cards. */
:root {
  --navy: #1b365d;
  --ink: #1f2937;
  --grey: #6b7280;
  --line: #d6e0ec;
  --border: #a9bcd3;
  --head: #e8f0fa;
  --tile: #f1f6fc;
  --paper: #ffffff;
  --page: #f6f8fb;
  --red: #9b2c2c;
  --green: #276749;
  --amber: #fff7e0;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Arial, "Segoe UI", system-ui, sans-serif; line-height: 1.45; }
a { color: var(--navy); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--navy); margin: 0 0 0.6rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
small { color: var(--grey); font-size: 0.82rem; font-weight: normal; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.25rem; background: var(--navy); color: #fff; }
.top a { color: #fff; text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.brand { font-family: Georgia, serif; font-size: 1.35rem; font-weight: bold; letter-spacing: 0.02em; }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.92rem; }
.who .link { color: #cfe0f5; }
.preview { background: var(--amber); border-bottom: 1px solid #ecd9a0; padding: 0.4rem 1.25rem; font-size: 0.88rem; }

main { max-width: 960px; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }
.crumbs { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--grey); }
.card { background: var(--paper); border: 1px solid var(--border); border-radius: 6px; padding: 1.1rem 1.25rem; margin: 1rem 0; }
.narrow { max-width: 460px; margin: 3rem auto; }
.lead { font-size: 1.05rem; }
.empty { color: var(--grey); }
.notice { background: #eaf5ec; border: 1px solid #b9dcc2; color: var(--green); border-radius: 4px; padding: 0.5rem 0.8rem; margin: 0.75rem 0; }
.hint { color: var(--grey); font-size: 0.86rem; }
.count { font-family: Arial, sans-serif; font-size: 0.85rem; color: var(--grey); font-weight: normal; margin-left: 0.3rem; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row-head h2 { margin: 0; }

.tiles { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.tile { display: block; background: var(--head); border: 1px solid var(--border); border-radius: 6px; padding: 0.9rem 1rem; text-decoration: none; }
.tile:hover { background: #dce8f7; }
.tile strong { display: block; font-family: Georgia, serif; font-size: 1.1rem; }
.tile span { color: var(--grey); font-size: 0.9rem; }

.stack { display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start; }
.stack > label, .stack > section { width: 100%; }
fieldset.cardline { border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.8rem 0.8rem; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 0.8rem; }
fieldset.cardline legend { font-weight: bold; font-size: 0.92rem; color: var(--navy); padding: 0 0.3rem; }
fieldset.cardline label { font-weight: normal; color: var(--grey); font-size: 0.85rem; }
fieldset.cardline input { width: 100%; }
label { display: block; font-weight: bold; font-size: 0.92rem; color: var(--navy); }
label > input:not([type="checkbox"]), label > textarea, label > select { display: block; margin-top: 0.25rem; }
label > small { display: block; margin-top: 0.2rem; }
input, textarea, select, button { font: inherit; font-weight: normal; color: var(--ink); }
input:not([type="checkbox"]), textarea, select { border: 1px solid var(--border); border-radius: 4px; padding: 0.4rem 0.55rem; background: #fff; }
label > input:not([type="checkbox"]):not([type="date"]), textarea { width: 100%; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid #5b84b8; outline-offset: 1px; }
textarea { resize: vertical; }
.hebrew { font-family: "David", "Frank Ruehl", "Times New Roman", serif; font-size: 1.15rem; line-height: 1.7; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: normal; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; width: 100%; margin-bottom: 0.9rem; }
.fetch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; background: var(--tile); border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.8rem; margin-bottom: 0.9rem; font-size: 0.92rem; }
.card > label { margin-bottom: 0.9rem; }

button { cursor: pointer; border: 1px solid var(--border); background: #fff; border-radius: 4px; padding: 0.4rem 0.9rem; }
button:hover { background: var(--tile); }
button.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: bold; }
button.primary:hover { background: #24477a; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; color: var(--navy); text-decoration: underline; }
button.danger { color: var(--red); }
.bar { display: flex; align-items: center; gap: 1.25rem; position: sticky; bottom: 0; background: var(--page); padding: 0.75rem 0; border-top: 1px solid var(--line); width: 100%; }

table.list { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
table.list th { text-align: left; font-size: 0.82rem; color: var(--grey); font-weight: bold; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
table.list td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list input:not([type="checkbox"]) { width: 100%; }
table.students td:first-child { width: 24%; }
table.students td.actions { white-space: nowrap; width: 1%; }
table.students td.actions form { display: inline-block; margin-left: 0.5rem; }
table.scores td:nth-child(2), table.scores td:nth-child(3) { width: 6.5rem; }
table.scores td:nth-child(2) input, table.scores td:nth-child(3) input { width: 4.5rem; text-align: center; }
table.scores td:nth-child(4) { width: 4rem; text-align: center; }
.standing { display: block; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; padding: 0; margin: 0.5rem 0 1rem; }
.steps li { border: 1px solid var(--line); border-radius: 4px; padding: 0.45rem 0.7rem; background: #fff; }
.steps li strong { display: block; color: var(--navy); font-size: 0.95rem; }
.steps li span { color: var(--grey); font-size: 0.8rem; }
.steps li.now { background: var(--head); border-color: var(--border); }
.steps li.later { opacity: 0.6; }
.steps li a { text-decoration: none; }
.steps li a:hover strong { text-decoration: underline; }

h3 { font-family: Georgia, serif; color: var(--navy); font-size: 1.05rem; margin: 0; }
.recorder { border: 1px solid var(--border); border-radius: 6px; padding: 0.8rem 1rem; margin: 0.9rem 0; background: var(--tile); }
.recorder .whose { margin: 0.5rem 0; font-weight: normal; color: var(--ink); }
.recorder .whose select { display: inline-block; margin: 0 0.4rem; }
.recorder table.list td { background: #fff; }
.warn { background: var(--amber); border: 1px solid #ecd9a0; border-radius: 4px; padding: 0.35rem 0.6rem; margin: 0.4rem 0; font-size: 0.9rem; }
.go { display: flex; align-items: center; gap: 1rem; margin-top: 0.9rem; }
form.inline { display: inline; }
table.recs td.actions { width: 1%; white-space: nowrap; }
table.recs select { max-width: 14rem; }
[hidden] { display: none !important; }

/* results */
a.button { display: inline-block; text-decoration: none; border-radius: 4px; padding: 0.45rem 0.95rem; }
a.button.primary { background: var(--navy); color: #fff; font-weight: bold; }
a.button.primary:hover { background: #24477a; }
a.button.off { opacity: 0.45; cursor: not-allowed; }
.grade { font-family: Georgia, serif; font-size: 2rem; font-weight: bold; color: var(--navy); background: var(--head); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.8rem; }
.grade small { font-size: 1rem; color: var(--grey); }
.log { background: #0f1b2e; color: #dbe7f7; border-radius: 4px; padding: 0.8rem 1rem; max-height: 22rem; overflow: auto; font-size: 0.85rem; white-space: pre-wrap; min-height: 6rem; }
dl.report { margin: 0.8rem 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
dl.report dt { font-family: Georgia, serif; font-weight: bold; color: var(--navy); }
dl.report dd { margin: 0; }
ul.attention { margin: 0.4rem 0; padding-left: 1.2rem; }
ul.attention li { margin: 0.25rem 0; }
.student audio { width: 100%; height: 2.2rem; margin: 0.3rem 0; }
table.rows td { vertical-align: top; padding: 0.4rem 0.35rem; }
table.rows td:nth-child(1) { width: 6.5rem; }
table.rows td:nth-child(2) { width: 22%; }
table.rows td.tight { width: 7rem; font-size: 0.85rem; }
table.rows select { width: 100%; margin-bottom: 0.25rem; padding: 0.25rem; }
table.rows textarea, table.rows input:not([type="checkbox"]) { width: 100%; font-size: 0.92rem; }
table.rows td:nth-child(3) textarea { background: #fbeaea; }
table.rows td:nth-child(4) textarea { background: #eaf5ec; }
table.rows td:nth-child(4) input { margin-top: 0.25rem; font-size: 0.82rem; }
table.rows tr.listen td { background: var(--amber); }
table.rows tbody tr:last-child td { border-top: 2px dashed var(--border); }
.hebrew-sm { font-family: "David", "Times New Roman", serif; font-size: 1.05rem; }
.check.small { display: flex; font-size: 0.82rem; margin-top: 0.15rem; }
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; }
details { margin-top: 0.8rem; font-size: 0.9rem; }
summary { cursor: pointer; color: var(--navy); }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  table.students thead { display: none; }
  table.students tr { display: block; padding: 0.5rem 0; }
  table.students td { display: block; width: auto !important; border: 0; padding: 0.15rem 0; }
}
