/* ==========================================================================
   attendance.html · 09-kufi, page-only components (tokens come from kit.css)
   ========================================================================== */
.view{ padding-block:0 clamp(48px,7vw,96px); }
/* the connection pill grows once the page is cached: keep the bar inside 390 px */
.attendance-page .appbar .appbar-tools > :is(button, a),
.attendance-page .appbar .appbar-tools .textsize,
.attendance-page .appbar .back,
.attendance-page #acc-detail + span > a { display:inline-flex; align-items:center; min-height:44px; }

@media (max-width:420px){ .appbar-in{ gap:6px; } .appbar .back{ padding:0 10px 0 8px; } }
.view[hidden]{ display:none; }
.view.enter{ animation:attIn .24s var(--ease) both; }
@keyframes attIn{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }
.pagehead{ padding-inline:0; }
.h3{ font:800 var(--t-mid)/1.35 var(--f-display); margin-bottom:12px; }

/* ---------- capture ---------- */
.cap{ display:grid; gap:12px; max-width:760px; }
.shoot{ position:relative; display:flex; align-items:center; justify-content:center; gap:18px; min-height:128px; padding:16px 24px;
  background:var(--action, #1739A8); color:#fff; cursor:pointer; font:900 clamp(30px,5vw,44px)/1.25 var(--f-display);
  transition:background .15s var(--ease), transform .15s var(--ease); -webkit-tap-highlight-color:transparent; }
.app-actions .shoot:not(.busy):is(:hover, :active){ background: #102C89; color:#fff; }
.shoot:active{ transform:translateY(2px); }
.shoot svg{ width:52px; height:52px; flex:none; fill:none; stroke:currentColor; }
.shoot input, .pick input{ position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; font-size:0; }
.shoot:focus-within, .pick:focus-within{ outline:4px solid var(--ink); outline-offset:3px; }
.shoot.busy{ background:var(--selected, #E0E2DD); color:var(--ink, #0B0B0B); pointer-events:none; }
.pick{ position:relative; }
.cap-alt{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:520px){ .cap-alt{ grid-template-columns:1fr; } }
.status{ min-height:28px; font:500 18px/1.6 var(--f-text); color:var(--ink-2); }
.status.err{ background:var(--amber-field); color:var(--amber-ink); padding:14px 18px; }

.steps3{ list-style:none; margin:clamp(40px,6vw,72px) 0 0; padding:0; display:grid; grid-template-columns:repeat(3,1fr); gap:4px; }
.steps3 li{ background:var(--paper-2); padding:clamp(20px,2.6vw,32px); display:flex; flex-direction:column; gap:8px; }
.steps3 .n{ font:900 44px/1 var(--f-display); direction:ltr; text-align:end; }
.steps3 b{ font:800 var(--t-mid)/1.35 var(--f-display); }
.steps3 li > span:not(.n){ color:var(--ink-2); line-height:1.65; }
.steps3 .btn{ margin-top:auto; align-self:flex-start; }
@media (max-width:820px){ .steps3{ grid-template-columns:1fr; } .steps3 .btn{ align-self:stretch; } }

/* ---------- sheet ---------- */
.sheet-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:24px; align-items:start; }
@media (max-width:900px){ .sheet-grid{ grid-template-columns:1fr; } }
.sheet-form textarea{ min-height:260px; font-size:19px; }
.form-actions{ display:grid; gap:12px; margin-top:24px; }
.form-actions .btn{ width:100%; }
.sheet-form .note{ margin-top:16px; }
.paper-preview{ margin:0; position:sticky; top:calc(var(--bar-h) + 12px); }
.paper-preview #sheet-preview{ background:#fff; box-shadow:0 0 0 4px var(--paper-2); }
.paper-preview svg{ display:block; width:100%; height:auto; }
.paper-preview figcaption{ margin-top:10px; }
@media (max-width:900px){ .paper-preview{ position:static; } }

/* ---------- check ---------- */
#qr-warn{ margin-bottom:16px; font-size:18px; line-height:1.6; }
.check-grid{ display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:24px; align-items:start; }
@media (max-width:900px){ .check-grid{ grid-template-columns:minmax(0,1fr); } }   /* minmax(0,…): reflow at 320 px (WCAG 1.4.10) */
.photo-wrap canvas{ display:block; width:100%; height:auto; background:#fff; cursor:pointer; touch-action:manipulation; }
.legend{ list-style:none; margin:12px 0 4px; padding:0; display:flex; flex-wrap:wrap; gap:8px 20px; font-size:16px; color:var(--ink-2); }
.legend li{ display:flex; align-items:center; gap:8px; }
.legend i{ width:22px; height:16px; flex:none; }
.legend .k-a{ box-shadow:inset 0 0 0 3px var(--amber, #8A5300); }
.legend .k-q{ box-shadow:inset 0 0 0 3px #C77800; background:#FFF1D6; }
.legend .k-e{ box-shadow:inset 0 0 0 3px #1F5FD1; }
.confirm h2{ font:800 var(--t-mid)/1.35 var(--f-display); margin-bottom:12px; }
.unsure{ list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.unsure li{ background:var(--paper-2); padding:14px; display:grid; grid-template-columns:auto 1fr; gap:10px 14px; align-items:center; }
.unsure li.done{ background: #DDF5E5; }
.unsure canvas{ width:112px; height:auto; display:block; background:#fff; grid-row:span 2; }
.unsure .who{ font:700 19px/1.4 var(--f-text); }
.unsure .who span{ display:block; font-weight:400; font-size:17px; color:var(--ink-2); }
.unsure .seg{ padding:4px; }
.unsure .seg button{ min-height:52px; }
.left-note{ margin-top:12px; }
@media (min-width:900px){ #v-check .actionbar{ margin-top:32px; } }

/* ---------- summary ---------- */
.sum-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:32px; align-items:start; }
@media (max-width:900px){ .sum-grid{ grid-template-columns:minmax(0,1fr); } }
.tbl td.zero{ color:var(--ink-3); }
.pupils li{ background:var(--paper-2); padding:14px 18px; display:grid; grid-template-columns:1fr auto; gap:4px 12px; align-items:center; }
.pupils b{ font:800 21px/1.35 var(--f-display); }
.pupils .c{ font:900 30px/1 var(--f-display); direction:ltr; }
.pupils .w{ grid-column:1 / -1; font-size:17px; color:var(--ink-2); line-height:1.6; }
.pupils .none{ display:block; color:var(--ink-2); }
.export{ margin-top:40px; display:grid; gap:12px; }
.export h2{ font:800 var(--t-mid)/1.35 var(--f-display); }
.export .ready{ font:800 clamp(22px,2.4vw,30px)/1.4 var(--f-display); color:var(--ink); }
.export .d{ color:var(--on-ink-2); line-height:1.7; max-width:62ch; }
.export .row2{ margin-top:8px; }
.export .btn-line{ color:var(--ink); }
.privacy{ margin-top:4px; display:grid; gap:12px; }
.privacy p{ line-height:1.7; }
@media (max-width:520px){ .export .row2, .privacy .row2{ grid-template-columns:1fr; } }

/* ---------- school station ---------- */
.st-entry{ margin-top:4px; padding:clamp(20px,2.6vw,32px); display:grid; grid-template-columns:1fr auto; gap:16px 32px; align-items:center; }
.st-entry h2{ font:800 var(--t-mid)/1.4 var(--f-display); color:var(--ink); }
.st-entry p{ color:var(--on-ink-2); margin-top:8px; line-height:1.7; }
.st-entry .btn-ink{ background:#fff; color:#0B0B0B; }
.st-entry .btn-ink:hover{ background:#E4E3DE; }
@media (max-width:820px){ .st-entry{ grid-template-columns:1fr; } }
.st-grid{ display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:32px; align-items:start; }
@media (max-width:900px){ .st-grid{ grid-template-columns:1fr; } }
.st-main{ display:grid; gap:12px; }
.st-num{ display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; font:800 var(--t-mid)/1.3 var(--f-display); }
.st-num .bignum{ font-size:clamp(64px,9vw,112px); }
.st-count .progress{ margin-top:12px; }
.st-count .note{ margin-top:10px; }
.st-last{ font-size:19px; line-height:1.6; }
.st-list{ list-style:none; margin:12px 0 0; padding:0; display:grid; gap:4px; }
.st-list li{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; min-height:64px; padding:10px 18px; background:var(--paper-2); }
.st-list b{ font:800 20px/1.4 var(--f-display); }
.st-list span{ font-size:17px; color:var(--ink-2); }
.st-list li.is-done{ box-shadow:inset -6px 0 0 var(--green); }
.st-list li.is-done span{ color:var(--green-ink); }
.st-list li.is-wait span{ color:var(--ink-2); }

/* ---------- how it works ---------- */
.how{ padding-block:clamp(56px,8vw,112px); }
.how-h{ font:900 var(--t-head)/1.2 var(--f-display); margin-bottom:28px; }
.how-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
@media (max-width:820px){ .how-grid{ grid-template-columns:1fr; } }
.how .it{ background:var(--band-2); padding:clamp(20px,2.6vw,32px); display:flex; flex-direction:column; gap:10px; }
.how .it b{ font:800 var(--t-mid)/1.4 var(--f-display); color:var(--ink); }
.how .it span:not(.stop){ color:var(--on-ink-2); line-height:1.75; }
.how-foot{ margin-top:24px; }

/* ---------- print: only the A4 sheet ---------- */
#print-sheet{ display:none; }
@media print{
  @page{ size:A4 portrait; margin:0; }
  html, body{ margin:0!important; padding:0!important; background:#fff!important; }
  body > *:not(#print-sheet){ display:none!important; }
  #print-sheet{ display:block!important; width:210mm; height:296.6mm; overflow:hidden; }
  #print-sheet svg{ display:block; width:210mm; height:296.6mm; }
}

/* one h1 per page: the visible view's heading is the h1 (show() swaps the tag); the others are h2 with the same look */
.pagehead h2{ font:900 clamp(40px,6vw,88px)/1.15 var(--f-display); }

/* reflow at 320 px: grid children may shrink below their content width; long words wrap */
.check-grid > *, .sum-grid > *{ min-width:0; }
.sum-grid h2, .check-grid h2{ overflow-wrap:anywhere; }

/* a hidden button stays hidden (.btn sets display) */
.btn[hidden]{ display:none; }
/* 320 px: the unsure row may shrink (crop 96 px, buttons wrap) */
.unsure li{ grid-template-columns:auto minmax(0,1fr); }
.unsure li > *{ min-width:0; }
@media (max-width:360px){ .unsure canvas{ width:96px; } .unsure li{ padding:12px; gap:8px 10px; } }
.unsure{ grid-template-columns:minmax(0,1fr); }
.unsure .seg{ grid-auto-columns:minmax(0,1fr); }
@media (max-width:360px){ .unsure .seg button{ padding:6px 8px; } }

.status:empty{ display:none; }
.cap > details{ background:var(--paper); margin:0; }

.attendance-page .appbar .back,
[data-teacher-page="grades"] .appbar .back,
.paper-roster-choices button,
.paper-roster label { min-height:48px; }
.paper-roster-choices:not([hidden]) { display:grid; gap:8px; margin-block-end:12px; }
.paper-roster {
  list-style:none; padding:0;
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px;
}
.paper-roster label {
  display:flex; flex-wrap:wrap; align-items:center; gap:4px;
  padding:6px; background:var(--paper-2); overflow-wrap:anywhere;
}
.paper-roster mark { font-size:17px; }
.paper-initial {
  display:inline-grid; place-items:center; inline-size:24px; block-size:24px;
  border-radius:50%; background:#E4EDFF; color:#1739A8;
}
@media (min-width:760px) {
  .paper-roster { grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  .view.enter { animation:none; }
}
