/* Learning tab: Year 4 measurement topics. Colours come from the tokens in index.html. */

.learn-wrap { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }

.subtabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--shadow);
  position: sticky; top: 8px; z-index: 5;
}
.subtabs button { border: none; background: transparent; padding: 10px 4px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.subtabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* topic picker */
.topic-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.topic-bar button {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px;
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.topic-bar button .ti { font-size: 28px; line-height: 1; }
.topic-bar button small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.topic-bar button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(16px, 3.5vw, 24px);
}
.card h2 { margin: 0 0 6px; font-size: clamp(19px, 4.5vw, 23px); letter-spacing: -.01em; }
.card h3 { margin: 18px 0 6px; font-size: 16px; }
.card p { margin: 8px 0; }
.card .lead { color: var(--muted); margin-top: 0; }
.step-no {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800;
  margin-right: 8px; vertical-align: 2px;
}

.topic-head { display: flex; gap: 14px; align-items: center; }
.topic-head .big { font-size: 44px; line-height: 1; }
.topic-head h2 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}

.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.toc a {
  font-size: 13px; color: var(--ink); text-decoration: none; padding: 5px 10px;
  border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
}
.toc a:hover { border-color: var(--accent); }

/* unit colours */
.u-mg { --u: var(--u-mg); }
.u-g  { --u: var(--u-g); }
.u-kg { --u: var(--u-kg); }
.u-t  { --u: var(--u-t); }
/* Length borrows the same four colours, smallest unit to biggest. */
.u-mm { --u: var(--u-mg); }
.u-cm { --u: var(--u-g); }
.u-m  { --u: var(--u-kg); }
.u-km { --u: var(--u-t); }

.units { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.unit {
  border-radius: 12px; padding: 14px; border: 2px solid var(--u);
  background: color-mix(in srgb, var(--u) 9%, var(--panel));
}
.unit .sym { font-size: 30px; font-weight: 800; color: var(--u); line-height: 1; }
.unit .name { font-weight: 700; margin: 2px 0 8px; }
.unit ul { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 6px; }
.unit li { display: flex; gap: 8px; align-items: center; }
.unit li .e { font-size: 24px; width: 30px; text-align: center; flex: 0 0 auto; }
.unit .tag { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* staircase */
.ladder { display: grid; gap: 6px; margin: 14px 0 6px; }
.rung { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.rung .box {
  border-radius: 10px; padding: 10px 14px; font-weight: 700;
  background: color-mix(in srgb, var(--u) 14%, var(--panel)); border: 2px solid var(--u);
}
.rung .box small { font-weight: 400; color: var(--muted); }
.rung:nth-child(1) .box { margin-right: 0; }
.ladder .rung:nth-of-type(1) .box { width: 100%; }
.ladder .rung:nth-of-type(2) .box { width: 88%; }
.ladder .rung:nth-of-type(3) .box { width: 76%; }
.ladder .rung:nth-of-type(4) .box { width: 64%; }
.ladder .arrow { font-size: 13px; font-weight: 700; color: var(--muted); padding-left: 14px; }
.arrows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.arrows div { border-radius: 10px; padding: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.arrows b { display: block; font-size: 17px; }

.tip {
  border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0; font-size: 15px;
}

/* worked examples */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.example { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.example .q { font-weight: 700; font-size: 17px; }
.example ol { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.example .a { margin-top: 6px; font-weight: 800; color: var(--o); }

/* place value chart */
.pv { display: inline-grid; grid-template-columns: repeat(4, 52px); margin: 10px 0; font-variant-numeric: tabular-nums; }
.pv div { text-align: center; padding: 6px 0; border: 1px solid var(--line); }
.pv .h { font-size: 11px; color: var(--muted); background: var(--bg); }
.pv .d { font-size: 24px; font-weight: 800; }
.pv .kg { background: color-mix(in srgb, var(--u-kg) 16%, var(--panel)); }
.pv .g { background: color-mix(in srgb, var(--u-g) 14%, var(--panel)); }
.pv .lab { grid-column: span 1; font-size: 12px; font-weight: 700; border: none; }
.pv .lab.kgl { color: var(--u-kg); }
.pv .lab.gl { grid-column: span 3; color: var(--u-g); }

/* fraction bars */
.fbar { display: flex; height: 44px; border-radius: 10px; overflow: hidden; border: 2px solid var(--u-kg); margin: 6px 0 14px; }
.fbar div {
  flex: 1; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--u-kg) 12%, var(--panel));
  border-right: 2px solid var(--u-kg);
}
.fbar div:last-child { border-right: none; }
.fbar div.on { background: color-mix(in srgb, var(--u-kg) 42%, var(--panel)); }
.flabel { font-size: 14px; font-weight: 600; }

/* scales */
.svg-ink { fill: var(--ink); }
.svg-muted { fill: var(--muted); }
.dial-body { fill: var(--panel); stroke: var(--line); stroke-width: 2; }
.dial-face { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.dial-tick { stroke: var(--ink); stroke-linecap: round; }
.dial-needle { stroke: var(--x); stroke-width: 4; stroke-linecap: round; }
.dial-cap { fill: var(--x); }
.dial-pan { fill: var(--line); }
.beam { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.beam-thin { stroke: var(--muted); stroke-width: 2; }
.stand { fill: var(--muted); }

.scale-demo { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 18px; align-items: center; }
.scale-demo svg { width: 100%; height: auto; }
.scale-demo input[type="range"] { width: 100%; accent-color: var(--accent); }
.readout { font-size: 15px; }
.readout .big { font-size: 26px; font-weight: 800; color: var(--x); }
.how-read { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }

.balance { display: block; width: min(100%, 380px); margin: 8px auto 0; height: auto; }

/* ruler (length) */
.r-body { fill: color-mix(in srgb, var(--u-kg) 22%, var(--panel)); stroke: var(--u-kg); stroke-width: 1.5; }
.r-tick { stroke: var(--ink); stroke-width: 1.2; }
.r-guide { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.obj-pencil { fill: #f2b705; }
.obj-eraser { fill: #f08ca8; }
.obj-wood { fill: #e8c79a; }
.obj-lead, .obj-crayon-tip { fill: #3b3b3b; }
.obj-crayon { fill: #e5484d; }
.obj-ribbon { fill: #3e8ed0; }
.visual svg.ruler { width: auto; max-width: 100%; height: auto; }
.ritem .visual svg.ruler { width: auto; max-width: min(100%, 420px); }
.ruler-demo { display: grid; gap: 12px; }
.ruler-demo svg { width: 100%; height: auto; max-width: 560px; display: block; margin: 0 auto; }
.ruler-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ruler-controls label { margin: 0; display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ruler-controls input[type="range"] { width: 100%; accent-color: var(--accent); }

/* place value chart with the split anywhere (length) */
.pvx { display: inline-grid; margin: 10px 0; font-variant-numeric: tabular-nums; }
.pvx-c2 { grid-template-columns: repeat(2, 52px); }
.pvx-c3 { grid-template-columns: repeat(3, 52px); }
.pvx-c4 { grid-template-columns: repeat(4, 52px); }
.pvx-c5 { grid-template-columns: repeat(5, 52px); }
.pvx div { text-align: center; padding: 6px 0; border: 1px solid var(--line); }
.pvx .h { font-size: 11px; color: var(--muted); background: var(--bg); }
.pvx .d { font-size: 24px; font-weight: 800; }
.pvx .d.b { background: color-mix(in srgb, var(--u-kg) 16%, var(--panel)); }
.pvx .d.s { background: color-mix(in srgb, var(--u-g) 14%, var(--panel)); }
.pvx .lab { font-size: 12px; font-weight: 700; border: none; }
.pvx .lab.b { color: var(--u-kg); }
.pvx .lab.s { color: var(--u-g); }
.pvx .sp1 { grid-column: span 1; } .pvx .sp2 { grid-column: span 2; }
.pvx .sp3 { grid-column: span 3; } .pvx .sp4 { grid-column: span 4; }

/* explorer */
.explorer { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.explorer input[type="text"], .explorer select, .answer input[type="text"], .answer select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.explorer input:focus-visible, .explorer select:focus-visible, .answer input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.conv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.conv div {
  border-radius: 10px; padding: 10px 12px; border: 2px solid var(--u);
  background: color-mix(in srgb, var(--u) 9%, var(--panel)); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.conv b { display: block; font-size: 18px; }
.conv small { color: var(--muted); }

table.guide { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
table.guide th, table.guide td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.guide th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* practice + test */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.levels button { padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.levels button .e { font-size: 28px; }
.levels button small { font-weight: 400; color: var(--muted); font-size: 12px; }
.levels button[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
.tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.tests button { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 14px; }
.tests button small { font-weight: 400; color: var(--muted); }
.tests button .best { font-size: 12px; color: var(--o); font-weight: 700; }

.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.qhead b { color: var(--ink); }
.progress { height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 4px; }
.progress div { height: 100%; background: var(--accent); transition: width .25s ease; }

.prompt { font-size: clamp(18px, 4.6vw, 22px); font-weight: 700; margin: 14px 0 10px; }
.visual { display: flex; justify-content: center; margin: 6px 0 12px; }
.visual svg { width: min(100%, 250px); height: auto; }
.visual .emoji { font-size: 56px; line-height: 1; }

.answer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.answer input[type="text"] { width: 140px; font-size: 20px; font-weight: 700; text-align: center; }
.answer .unit-label { font-size: 18px; font-weight: 700; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; width: 100%; }
.choices button { padding: 14px 10px; font-size: 17px; }
.choices button:disabled { opacity: 1; cursor: default; }
.choices button[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
.choices button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--panel)); }
.choices button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--panel)); }

.qactions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.qactions button { flex: 1; min-width: 120px; }

.feedback { margin-top: 16px; border-radius: 12px; padding: 14px 16px; border: 2px solid; }
.feedback.ok { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }
.feedback.no { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.feedback .verdict { font-weight: 800; font-size: 18px; }
.feedback.ok .verdict { color: var(--good); }
.feedback.no .verdict { color: var(--bad); }
.feedback .why { margin: 8px 0; }
.feedback .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; }
.feedback ol { margin: 4px 0 0; padding-left: 20px; }

.result-top { text-align: center; }
.result-top .score { font-size: 54px; font-weight: 800; line-height: 1.05; }
.result-top .stars { font-size: 30px; letter-spacing: 4px; }
.skills { display: grid; gap: 8px; margin-top: 14px; }
.skill { display: grid; grid-template-columns: 130px 1fr 54px; gap: 10px; align-items: center; font-size: 14px; }
.skill .bar { height: 12px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.skill .bar div { height: 100%; }
.skill .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.review { display: grid; gap: 10px; }
.ritem { border: 1px solid var(--line); border-left: 6px solid var(--bad); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.ritem.ok { border-left-color: var(--good); }
.ritem .rq { font-weight: 700; }
.ritem .rrow { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 15px; }
.ritem .mine { color: var(--bad); font-weight: 700; }
.ritem.ok .mine { color: var(--good); }
.ritem .right { color: var(--good); font-weight: 700; }
.ritem details { margin-top: 8px; font-size: 14px; }
.ritem summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.ritem ol { margin: 6px 0 0; padding-left: 20px; }
.ritem .visual svg { width: min(100%, 180px); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter button { padding: 7px 12px; font-size: 13px; }
.filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

@media (max-width: 560px) {
  .scale-demo { grid-template-columns: 1fr; }
  .scale-demo svg { max-width: 240px; margin: 0 auto; display: block; }
  .ruler-controls { grid-template-columns: 1fr; }
  .arrows { grid-template-columns: 1fr; }
  .skill { grid-template-columns: 100px 1fr 46px; }
  .levels button { padding: 12px 4px; }
}

/* ---- learners, rewards, parents ---------------------------------------- */
.muted { color: var(--muted); font-weight: 400; font-size: 15px; }
.note { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; min-height: 20px; margin: 8px 0 0; }
button.small { padding: 6px 10px; font-size: 13px; }
button.danger { color: var(--bad); }
button.danger[data-armed] { background: var(--bad); color: #fff; border-color: transparent; }

.learner-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px;
}
.learner-bar .lb-hello { flex: 1; font-weight: 600; }
.learner-bar button { padding: 8px 12px; font-size: 14px; }
.lb-av { font-size: 32px; line-height: 1; }
.lb-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.learner-bar .lb-claws {
  display: flex; align-items: baseline; gap: 4px;
  background: color-mix(in srgb, var(--u-kg) 14%, var(--panel)); border-color: var(--u-kg);
}
.lb-claws b { font-size: 18px; }
.lb-claws small { font-weight: 400; color: var(--muted); font-size: 12px; }

.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.kid-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; }
.kid-btn .av { font-size: 40px; line-height: 1.1; }
.kid-btn small { font-weight: 400; color: var(--muted); }
.kid-btn[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
.new-kid { display: grid; gap: 8px; margin-top: 8px; }
.new-kid label, .pick-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.new-kid input[type="text"] { max-width: 320px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick button { font-size: 28px; padding: 6px 10px; line-height: 1.2; }
.avatar-pick button[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.form-error { color: var(--bad); font-size: 14px; min-height: 18px; margin: 0; }

.claw-gain {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 800; font-size: 18px;
  background: color-mix(in srgb, var(--u-kg) 16%, var(--panel)); border: 2px solid var(--u-kg);
  animation: pop .35s ease;
}
.claw-gain span { font-weight: 500; font-size: 14px; color: var(--muted); }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 70% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }

.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 50; width: min(92vw, 360px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--u-kg); box-shadow: var(--shadow); animation: pop .4s ease;
}
.toast .t-icon { font-size: 34px; line-height: 1; }
.toast b { display: block; font-size: 17px; }

.result-top .pct { font-size: 20px; font-weight: 700; }
.reward-box {
  margin: 14px auto 4px; max-width: 420px; text-align: left; border-radius: 14px; padding: 14px 16px;
  background: color-mix(in srgb, var(--u-kg) 12%, var(--panel)); border: 2px solid var(--u-kg);
}
.reward-total { font-size: 22px; font-weight: 800; text-align: center; }
.reward-box ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 15px; }
.reward-box li { display: flex; justify-content: space-between; gap: 10px; }
.badge-new { margin-top: 8px; font-size: 15px; text-align: center; font-weight: 600; }

.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.review-head h2 { margin: 0; }
.review-card[data-show="wrong"] .ritem.ok { display: none; }
.review-card .only-wrong { display: none; }
.review-card[data-show="wrong"] .only-wrong { display: block; }
.rwhy { margin-top: 8px; font-size: 15px; }

.hero { text-align: center; }
.hero-av { font-size: 72px; line-height: 1.1; }
.hero h2 { margin: 4px 0 0; }
.claw-big { font-size: 34px; font-weight: 800; }
.claw-big small { font-size: 15px; font-weight: 600; color: var(--muted); }
.rank-line { font-size: 18px; font-weight: 700; margin-top: 2px; }
.rank-bar { height: 14px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 10px auto 6px; max-width: 360px; }
.rank-bar div { height: 100%; background: var(--u-kg); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.badge {
  text-align: center; border-radius: 12px; padding: 12px 8px; border: 2px solid var(--u-kg);
  background: color-mix(in srgb, var(--u-kg) 10%, var(--panel)); display: flex; flex-direction: column; gap: 2px;
}
.badge .b-icon { font-size: 34px; line-height: 1.1; }
.badge small { color: var(--muted); font-size: 12px; }
.badge.locked { border-color: var(--line); background: var(--bg); }
.badge.locked .b-icon { opacity: .6; }

.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.rank { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.rank span { font-size: 28px; line-height: 1.1; }
.rank small { color: var(--muted); font-size: 12px; }
.rank.done { opacity: .75; }
.rank.here { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); opacity: 1; }

.pack, .log, .att-list, .manage { display: grid; gap: 6px; margin-top: 10px; }
.pack-row, .log-row, .manage-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line);
}
.pack-row.me { border-color: var(--accent); }
.pack-row .pos { font-weight: 800; color: var(--muted); width: 18px; }
.pack-row .av { font-size: 26px; }
.pack-row .nm, .log-row span, .manage-row span { flex: 1; min-width: 0; }
.pack-row small, .log-row small, .manage-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

.att-row { display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 400; padding: 10px 12px; }
.att-row .av { font-size: 28px; }
.att-main { flex: 1; min-width: 0; }
.att-main small { display: block; color: var(--muted); font-size: 12px; }
.att-score { font-weight: 800; font-size: 18px; text-align: right; }
.att-score small { display: block; font-size: 12px; }
.att-score.good small { color: var(--good); }
.att-score.mid small { color: var(--u-kg); }
.att-score.low small { color: var(--bad); }

.ks-head { display: flex; gap: 12px; align-items: center; }
.ks-head .av { font-size: 48px; line-height: 1; }
.ks-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 14px 0 10px; }
.stat-grid div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat-grid b { display: block; font-size: 18px; }
.stat-grid small { color: var(--muted); font-size: 12px; }

@media (max-width: 560px) {
  .subtabs button { flex-direction: column; gap: 0; font-size: 12px; padding: 8px 2px; }
  .subtabs button .i { font-size: 18px; }
  .lb-claws small { display: none; }
}

/* ---- grown-ups --------------------------------------------------------- */
.pav { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.reviewer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.rv-name { flex: 1; min-width: 0; }
.rv-name small { display: block; color: var(--muted); font-size: 13px; }
.animal-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.animal-pick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; }
.animal-pick button small { font-weight: 600; font-size: 12px; color: var(--muted); }
.animal-pick button[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.new-chip {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); vertical-align: 1px;
}
.seen { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.seen .pav { vertical-align: -5px; }
.manage-row .pav { margin-right: -2px; }

/* ---- finding and sorting saved tests ---------------------------------- */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42%), 1fr)); gap: 10px; margin-top: 10px; }
.filters label { margin: 0; display: grid; gap: 4px; }
.filters select, .filters input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; min-width: 0;
}
.filters select:focus-visible, .filters input:focus-visible, .filter-foot input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters input[type="date"] { color-scheme: light dark; }
.filter-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.filter-foot .spacer { flex: 1; }
label.check { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink); font-weight: 600; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.table-wrap { margin-top: 10px; }
.att-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.att-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
.att-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.att-table tbody tr { cursor: pointer; }
.att-table tbody tr:hover { background: var(--bg); }
.att-table tr.is-new td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.att-table small { display: block; color: var(--muted); font-size: 12px; }
.att-table .c-no { white-space: nowrap; }
.att-table .c-when, .att-table .c-kid { white-space: nowrap; }
.att-table .c-score b.good { color: var(--good); }
.att-table .c-score b.mid { color: var(--u-kg); }
.att-table .c-score b.low { color: var(--bad); }
.att-table .c-seen { white-space: nowrap; }
.att-table .c-seen .pav { margin-right: 2px; }
.att-table .c-view { text-align: right; }

/* On phones each test becomes a small card with labels. */
@media (max-width: 640px) {
  .att-table thead { display: none; }
  .att-table, .att-table tbody, .att-table tr, .att-table td { display: block; width: 100%; }
  .att-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px;
    border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--bg);
  }
  .att-table tr.is-new { border-left: 4px solid var(--accent); }
  .att-table tr.is-new td:first-child { box-shadow: none; }
  .att-table td { border: none; padding: 0; white-space: normal; }
  .att-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted); font-weight: 600;
  }
  .att-table .c-view { grid-column: 1 / -1; text-align: left; }
  .att-table .c-view button { width: 100%; }
}

/* parent page: one block per topic in a child's summary */
.ks-topic { border-top: 1px solid var(--line); margin-top: 14px; }
.ks-topic h3 { margin-top: 12px; }
.att-table .c-test small { display: block; }

/* parent page: family sync */
.sync-join { display: grid; gap: 6px; margin-top: 14px; }
.sync-join label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.sync-row { display: flex; gap: 8px; }
.sync-row input, .sync-link {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; min-width: 0;
}
.sync-link { margin-top: 4px; font-size: 13px; }
.sync-row input:focus-visible, .sync-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
