/* «خيل الفرسان» (fursan-horses.js): the horses of فرسان الاتحاد and مدرسة فرسان الاتحاد in «الفرسان» — their tiles, card,
   sheets, the arena's page and the print sheet; the same parts as the stables' (stables.html), in «فرسان»'s own colours. */
:root{--rest-tint:#FBE3E1;--rest-ink:#9B1C1C;--rest-dot:#DC2626;--sil:#C2B8A6;--sil-ground:#ECE7DD;--fld-tint:#F4EBD3;--fld-ink:#7A5714;
  --th-bg:#1F3149;--th-ink:#FFFFFF;--th-line:#B48E3A;--zebra:#F7F4EE;--paper:#FFFFFF;--out:#AB3E26;--btn-on-navy:#D6B66C;--on-btn-on-navy:#141B24;
  --col:color-mix(in srgb,var(--ink) 30%,var(--line))}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--rest-tint:#3A1D1A;--rest-ink:#FFA59A;--rest-dot:#F87171;--sil:#4A5668;--sil-ground:#1A2431;
  --fld-tint:#332B1A;--fld-ink:#E6C77E;--th-bg:#15253A;--zebra:rgba(255,255,255,.035);--out:#F19077}}
:root[data-theme="dark"]{--rest-tint:#3A1D1A;--rest-ink:#FFA59A;--rest-dot:#F87171;--sil:#4A5668;--sil-ground:#1A2431;
  --fld-tint:#332B1A;--fld-ink:#E6C77E;--th-bg:#15253A;--zebra:rgba(255,255,255,.035);--out:#F19077}
/* search boxes, and the options' small words */
.sel{position:relative;display:flex;align-items:center;gap:8px;height:44px;padding-inline:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);min-width:0}
.sel span{flex:none;font-size:12.5px;font-weight:600;color:var(--muted)}
.sel input{flex:1;min-width:0;height:100%;padding:0;border:0;background:transparent;font-weight:700;font-size:16px;color:var(--ink);-webkit-appearance:none;appearance:none}
.sel input:focus{outline:none}
.sel input::placeholder{color:var(--muted);font-weight:500;font-size:14px}
.sel:focus-within{border-color:var(--focus);box-shadow:0 0 0 3px var(--focus-ring)}
.opt span small{margin-inline-start:6px;font-size:12px;font-weight:500;opacity:.78}
.opts legend{margin:0 0 8px;padding:0;font-size:13px;font-weight:700;color:var(--muted)}
.opts legend i{font-style:normal;font-weight:500}
/* a sheet as a page (the arena, Excel) */
.pg{display:flex;flex-direction:column;min-height:100%}
/* the card */
dialog.sheet.hzc{width:min(640px,calc(100% - 32px))}
@media (max-width:719px){dialog.sheet.hzc{width:100%}}
.btns{display:flex;flex-wrap:wrap;gap:8px}
.ph-field{display:grid;gap:8px}
.ph-l{font-size:13px;font-weight:600;color:var(--muted)}
.ph-l i{font-style:normal;font-weight:400}
.ph-x{position:absolute;top:4px;inset-inline-start:4px;display:grid;place-items:center;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:rgba(10,14,20,.72);color:#FFFFFF;font-size:17px;line-height:1}
.e-t{font-size:16px;font-weight:700;color:var(--ink)}
.loading{margin:0;padding:18px 4px;color:var(--muted)}
.btn.file{position:relative;overflow:hidden}
.btn.file input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0;padding:4px;border:0;border-radius:14px;background:var(--surface-2)}
.seg label{position:relative;display:block}
.seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.seg span{display:flex;align-items:center;justify-content:center;gap:8px;height:46px;border-radius:11px;font-weight:700;color:var(--muted)}
.seg .ic{width:18px;height:18px}
.seg input:checked+span{background:var(--surface);color:var(--ink);box-shadow:0 1px 4px var(--shadow)}
.seg input[value="in"]:checked+span{color:var(--in)}
.seg input[value="out"]:checked+span{color:var(--out)}
.seg input:focus-visible+span{outline:2px solid var(--focus);outline-offset:2px}
.opts{margin:0;padding:0;border:0}
.check{display:flex;align-items:center;gap:10px;font-size:14.5px;font-weight:600}
.check input{width:20px;height:20px;margin:0;accent-color:var(--btn)}
.preview{display:grid;justify-items:center;gap:10px;padding:14px;border-radius:16px;background:var(--surface-2)}
.pv-pages{display:grid;justify-items:center;gap:12px;width:100%}
.pv-pages img,.pv-ph{display:block;width:min(100%,340px);max-width:100%;aspect-ratio:595/842;height:auto;border-radius:3px;background:var(--paper);box-shadow:0 8px 26px -10px var(--shadow)}
.pv-ph{display:grid;place-items:center;color:#5B6470;font-size:13px}
.preview.busy img{opacity:.5}
.pv-cap{font-size:12.5px;color:var(--muted)}
.msg.ok{color:var(--ok)}
.msg.bad{color:var(--crit)}
.sil{flex:none;fill:currentColor;stroke:none}
.back{display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-weight:700;font-size:14px;cursor:pointer}
.back .ic{width:18px;height:18px}
.back:hover{border-color:var(--muted)}
.gseg{display:inline-flex;gap:2px;padding:3px;border-radius:999px;border:1px solid var(--line);background:var(--surface)}
.gseg button{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border:0;border-radius:999px;background:transparent;color:var(--muted);font:inherit;font-weight:700;font-size:13.5px;cursor:pointer;white-space:nowrap}
.gseg button[aria-pressed="true"]{background:var(--navy);color:var(--navy-ink)}
.mvs{max-width:860px}
.mvs-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0 2px 10px}
.mvs-head h2{margin:0;font-family:var(--font-display);font-weight:800;font-size:18px}
.log{display:grid;gap:6px;min-width:0}
.day{display:flex;justify-content:space-between;gap:8px;margin:14px 4px 2px;font-size:13px;font-weight:700;color:var(--muted)}
.day:first-child{margin-top:0}
.day span:last-child{font-weight:500}
.mvw{display:grid;gap:6px}
.mv{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font:inherit;text-align:start}
button.mv{cursor:pointer}
button.mv:hover{border-color:var(--muted)}
.mv-ic{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:var(--in-tint);color:var(--in)}
.mv-ic .ic{width:20px;height:20px}
.mv-main{display:grid;gap:2px;min-width:0;line-height:1.45}
.mv-main b{font-size:15px;font-weight:700;overflow-wrap:anywhere}
.mv-more{color:var(--muted);font-weight:700}
.mv-route{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;font-size:13.5px;font-weight:700}
.mv-route .ic{width:15px;height:15px;transform:scaleX(-1);color:var(--muted)}
.mv-route .to{color:var(--in)}
.mv-by{display:block;font-size:12px;font-weight:600;color:var(--muted)}
.mv-by b{color:var(--ink);font-weight:700}
.mv-amt{font-size:17px;font-weight:800;white-space:nowrap;text-align:center;line-height:1.2}
.mv-amt small{display:block;font-size:11.5px;font-weight:600;color:var(--muted)}
.mv-names{display:flex;flex-wrap:wrap;gap:6px;padding-block:2px 4px;padding-inline:54px 6px}
.mv-names .chip{height:32px;font-size:13px}
.sx-n{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:13px;font-weight:700;color:var(--ink);white-space:nowrap}
.sx-n b{font-variant-numeric:tabular-nums}
.sx-n.r{border-color:transparent;background:var(--rest-tint);color:var(--rest-ink)}
.sx-n.r i{width:9px;height:9px;border-radius:50%;background:var(--rest-dot)}
.sx-n.ok{border-color:transparent;background:var(--ok-tint);color:var(--ok)}
button.sx-n{cursor:pointer;font:inherit;font-size:13px;font-weight:700}
button.sx-n[aria-pressed="true"]{box-shadow:inset 0 0 0 2px currentColor}
.an-none{display:grid;place-items:center;height:100%;color:var(--sil);background:linear-gradient(to bottom,transparent 72%,var(--sil-ground) 72%)}
.an-none .sil{width:74%;height:auto}
.an-place{position:absolute;inset-block-start:8px;inset-inline-start:8px;max-width:calc(100% - 16px);padding:2px 9px;border-radius:999px;background:rgba(14,20,30,.74);color:#FFFFFF;font-size:11.5px;font-weight:700;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.an-tick{position:absolute;inset-block-start:8px;inset-inline-end:8px;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid #FFFFFF;background:rgba(14,20,30,.45);color:#FFFFFF;box-shadow:0 1px 4px rgba(0,0,0,.4)}
.an-tick .ic{width:18px;height:18px;stroke-width:3}
.sx{flex:none;padding:0 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11.5px;font-style:normal;font-weight:800;line-height:1.75}
.cd-ph{position:relative;display:block;width:100%;aspect-ratio:4/3;margin:0;padding:0;border:0;border-radius:16px;background:var(--surface-2);overflow:hidden;color:var(--muted)}
.cd-ph img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.cd-ph .an-none .sil{width:60%}
.cd-ph .an-place{font-size:12.5px;padding:3px 11px}
.cd-zoom{position:absolute;inset-block-end:10px;inset-inline-end:10px;display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:999px;background:rgba(14,20,30,.72);color:#FFFFFF;font-size:12px;font-weight:700}
.cd-zoom .ic{width:15px;height:15px}
.aid-badge{position:absolute;inset-block-start:10px;inset-inline-end:10px;display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#C81E1E;color:#FFFFFF;box-shadow:0 0 0 2px rgba(255,255,255,.9),0 6px 16px -6px rgba(0,0,0,.55)}
.aid-badge .ic{width:24px;height:24px;stroke-width:2.3}
.cd-title{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.cd-title h3{margin:0;font-family:var(--font-display);font-weight:800;font-size:clamp(21px,6vw,26px);line-height:1.45}
.cd-title .sx{font-size:13px;padding:1px 11px}
.cd-kind{font-size:13px;font-weight:700;color:var(--muted)}
.facts{display:grid;grid-template-columns:1fr 1fr;gap:1px;margin:0;border:1px solid var(--line);border-radius:16px;background:var(--line);overflow:hidden}
.facts>div{display:grid;gap:1px;min-width:0;padding:9px 12px;background:var(--surface)}
.facts>div.wide{grid-column:1/-1}
.facts dt{font-size:12px;font-weight:700;color:var(--muted)}
.facts dd{margin:0;font-size:15px;font-weight:700;line-height:1.55;overflow-wrap:anywhere}
.facts dd.no{color:var(--muted);font-weight:500}
.facts dd small{font-size:12px;font-weight:600;color:var(--muted)}
.rest-box{display:grid;gap:8px;padding:12px 14px;border-radius:16px;background:var(--rbg,var(--rest-tint));color:var(--rfg,var(--rest-ink))}
.rest-box p{margin:0;font-size:14px;line-height:1.75}
.rest-box b{font-size:15.5px}
.rest-box .btns .btn{height:40px;background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.5);color:inherit}
.rest-box.light .btns .btn{background:rgba(255,255,255,.55);border-color:rgba(67,20,7,.25)}
.rest-box.light .rest-bar{background:rgba(67,20,7,.14)}
.rest-bar{height:8px;border-radius:999px;background:rgba(255,255,255,.28);overflow:hidden}
.rest-bar i{display:block;height:100%;border-radius:999px;background:currentColor}
.cd-acts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.cd-acts .btn{width:100%;padding:0 10px}
.cd-acts .wide{grid-column:1/-1}
.cd-more{display:flex;flex-wrap:wrap;gap:4px 16px}
.hist{display:grid;gap:0;margin:0;padding:0;list-style:none}
.hist li{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:8px 0;border-top:1px solid var(--line)}
.hist li:first-child{border-top:0}
.hist .h-ic{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--surface-2);color:var(--muted)}
.hist .h-ic .ic{width:16px;height:16px}
.hist .h-ic.move{background:var(--in-tint);color:var(--in)}
.hist .h-ic.rest{background:var(--rest-tint);color:var(--rest-ink)}
.hist .h-ic.done{background:var(--ok-tint);color:var(--ok)}
.hist p{margin:0;font-size:13.5px;line-height:1.6}
.hist small{display:block;font-size:12px;color:var(--muted)}
.hist-t{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 0 -6px;font-size:14.5px;font-weight:800}
dialog.ask{width:min(420px,calc(100% - 32px));max-height:calc(100% - 32px);margin:auto;padding:0;border:0;border-radius:22px;background:var(--surface);color:var(--ink);box-shadow:0 30px 60px -20px rgba(0,0,0,.5);overflow-y:auto;overscroll-behavior:contain}
dialog.ask::backdrop{background:rgba(8,12,20,.55)}
.ask-in{display:grid;justify-items:center;gap:10px;padding:26px 20px 20px;text-align:center}
.ask-ic{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;background:var(--warn-tint);color:var(--warn)}
.ask-ic.med{background:var(--rest-tint);color:var(--rest-ink)}
.ask-ic .ic{width:28px;height:28px}
.ask h2{margin:2px 0 0;font-size:19px;line-height:1.5}
.ask p{margin:0;font-size:14px;line-height:1.8;color:var(--muted)}
.ask .seg,.ask .field,.ask .grid2{width:100%;text-align:start}
.ask .err:empty{display:none}
.ask-btns{display:grid;gap:8px;width:100%;margin-top:6px}
.ask .ph-field{width:100%;text-align:start}
.ask .ph-field .msg:empty{display:none}
.medf{display:grid;gap:0;margin:0;padding:0;list-style:none}
.medf li{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:9px 0;border-top:1px solid var(--line)}
.medf li:first-child{border-top:0}
.medf .h-ic{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--rest-tint);color:var(--rest-ink)}
.medf .h-ic .ic{width:16px;height:16px}
.medf .h-ic.injury{background:var(--warn-tint);color:var(--warn)}
.medf p{margin:0;font-size:13.5px;line-height:1.75}
.medf .md-k{display:inline-block;margin-inline-start:6px;padding:0 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);font-size:11.5px;font-style:normal;font-weight:800}
.medf .md-now{background:var(--rest-tint);color:var(--rest-ink)}
.medf .md-d{color:var(--ink)}
.medf small{color:var(--muted)}
.medf .md-acts{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:2px}
.medf .md-ph{display:block;width:96px;aspect-ratio:4/3;margin:6px 0 2px;padding:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--surface-2);cursor:zoom-in}
.medf .md-ph img{display:block;width:100%;height:100%;object-fit:cover}
.medf .md-acts .link{font-size:13px}
.medf .md-none{display:block;grid-column:1/-1;padding:6px 0;color:var(--muted);font-size:13.5px}
.md-add{justify-self:start}
.f-photo{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.f-prev{position:relative;flex:none;width:112px;aspect-ratio:4/3;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:var(--surface-2)}
.f-prev img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.sexes{display:flex;flex-wrap:wrap;gap:6px}
.days{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.days .opt span{justify-content:center;width:100%;height:48px;font-size:15px;font-weight:800}
.rest-prev{margin:0;padding:10px 12px;border-radius:12px;background:var(--rest-tint);color:var(--rest-ink);font-size:13.5px;font-weight:600;line-height:1.75}
.places-pick{display:grid;gap:8px;margin:0;padding:0;border:0}
.places-pick .opt span{justify-content:space-between;width:100%;height:50px;padding:0 16px;border-radius:14px;font-size:15px;font-weight:700}
.places-pick .opt small{font-size:12.5px;font-weight:700;opacity:.75}
.places-pick .opt input:disabled+span{opacity:.5}
.im-sum{display:flex;flex-wrap:wrap;gap:6px 8px;margin:0}
.im-tw{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.im-t{width:100%;min-width:760px;border-collapse:collapse;font-size:13px}
.im-t th{padding:8px;background:var(--th-bg);color:var(--th-ink);border-bottom:2px solid var(--th-line);font-size:12px;font-weight:700;text-align:start;white-space:nowrap}
.im-t td{padding:7px 8px;border-top:1px solid var(--col);white-space:nowrap}
.im-t tbody tr:nth-child(even) td{background:var(--zebra)}
.im-t td.bad{color:var(--crit);font-weight:700;white-space:normal}
.drop{display:grid;justify-items:center;gap:8px;padding:22px 14px;border:1.5px dashed var(--line);border-radius:16px;text-align:center;color:var(--muted)}
.drop .btn.ghost{color:var(--ink)}
.ph-or{margin-top:6px;font-size:13px}
.ed-ph{display:grid;gap:4px;justify-items:start}
.ed-ph .msg:empty{display:none}
.ac-only{font-style:normal;font-weight:500;font-size:12.5px;color:var(--muted)}
.stampsw{font-size:13.5px;margin:0}
.pv-img{display:grid;place-items:center;min-height:200px;border-radius:14px;background:var(--surface-2);overflow:hidden}
.pv-img img{display:block;max-width:100%;max-height:70vh;object-fit:contain}
.pub{gap:12px}
.pub-title{display:grid;justify-items:center;gap:2px;text-align:center}
.pub-title h2{font-size:clamp(22px,6.4vw,27px);line-height:1.45}
.pub .g-sub{margin:0;text-align:center}
.act-field{background:var(--brass);color:#141B24}
.sx-n.f{border-color:transparent;background:var(--fld-tint);color:var(--fld-ink)}
.sx-n.f .ic{width:14px;height:14px}
.field-box{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;padding:12px 14px;border-radius:16px;background:var(--fld-tint)}
.field-box p{flex:1 1 230px;margin:0;font-size:14px;line-height:1.8;color:var(--ink)}
.field-box p>.ic{width:18px;height:18px;margin-inline-end:4px;vertical-align:-3px;color:var(--fld-ink)}
.field-box b{color:var(--fld-ink)}
.field-box small{font-size:12.5px;color:var(--muted)}
.btn.go-in{background:var(--in-solid);color:var(--on-fill)}
.undo-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 12px;border-radius:14px;background:var(--ok-tint)}
.undo-row p{flex:1 1 200px;margin:0;font-size:14px;font-weight:700;line-height:1.7;color:var(--ok)}
.undo-row .btn{height:38px}
.hist .h-ic.field{background:var(--fld-tint);color:var(--fld-ink)}
.hist .h-ic.back{background:var(--in-tint);color:var(--in)}
.hist .h-ic.auto{background:var(--warn-tint);color:var(--warn)}
.hist .h-now{color:var(--fld-ink);font-weight:800}
.fl-now{display:grid;gap:8px;margin:0 0 12px;padding:12px;border-radius:16px;background:var(--fld-tint)}
.fl-now-t{display:flex;align-items:center;gap:8px;margin:0;font-size:14.5px;font-weight:800;color:var(--fld-ink)}
.fl-now-t .ic{width:18px;height:18px}
.fl-chips{display:flex;flex-wrap:wrap;gap:6px}
.fl-chips .chip{height:auto;min-height:38px;padding:4px 12px;font-size:13.5px}
.fl-chips .chip small{font-size:12px;font-weight:600;color:var(--muted)}
.fl-none{margin:0;font-size:13.5px;font-weight:600;color:var(--fld-ink)}
.fl-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 10px;margin:0 0 12px}
.fl-bar .gseg{max-width:100%;overflow-x:auto;scrollbar-width:none}
.fl-w{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px}
.mv.fl .mv-ic{background:var(--in-tint);color:var(--in)}
.mv.fl.open .mv-ic{background:var(--fld-tint);color:var(--fld-ink)}
.mv.fl.auto .mv-ic{background:var(--warn-tint);color:var(--warn)}
.fl-t{display:grid;font-size:12.5px;font-weight:600;line-height:1.65;color:var(--muted)}
.fl-t b{font-weight:700;color:var(--ink)}
.fl-t .fl-auto{color:var(--warn)}
.fl-t .fl-out{font-weight:800;color:var(--fld-ink)}
.fl-del{display:grid;place-items:center;min-width:40px;height:40px;padding:0 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--crit);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.fl-del .ic{width:17px;height:17px}
.fl-del.armed{background:var(--crit-solid);border-color:var(--crit-solid);color:#FFFFFF}
.pr-range{margin-top:10px}
/* «أعمدة الجدول» of «كشف الأسماء» (and its warning when they are more than the page holds) */
#prCols .opt span{height:38px;padding:0 13px;font-size:14px}
.pr-col-b{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:10px}
.pr-cut{margin-top:8px;color:var(--warn);font-weight:700}
.pr-pick{display:grid;gap:8px;margin-top:10px}
.pr-pick-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 10px}
.pr-pick-list{display:grid;gap:6px;max-height:min(46vh,420px);overflow:auto;padding:2px;overscroll-behavior:contain}
.pk-row{position:relative;display:grid;grid-template-columns:24px 44px minmax(0,1fr);align-items:center;gap:10px;min-height:54px;padding:5px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer}
.pk-row input{width:20px;height:20px;margin:0;accent-color:var(--btn);cursor:pointer}
.pk-row:has(input:checked){border-color:var(--ink);background:var(--surface-2)}
.pk-ph{display:block;width:44px;height:44px;border-radius:10px;overflow:hidden;background:var(--surface-2);color:var(--sil)}
.pk-ph img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.pk-ph .sil{display:block;width:100%;height:100%}
.pk-tx{display:grid;min-width:0;line-height:1.45}
.pk-tx b{font-size:14.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pk-tx small{font-size:12px;font-weight:600;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scan .pg-body.sc-body{width:100%;max-width:600px;margin-inline:auto;gap:12px;padding-inline:16px}
.sc-cam{position:relative;width:100%;aspect-ratio:1/1;max-height:min(54vh,520px);border-radius:20px;overflow:hidden;background:#0B1220;box-shadow:0 14px 30px -20px var(--shadow)}
.sc-cam video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#0B1220}
.sc-frame{position:absolute;inset:15%;pointer-events:none}
.sc-frame i{position:absolute;width:34px;height:34px;border:4px solid #E9C46A;filter:drop-shadow(0 1px 3px rgba(0,0,0,.6))}
.sc-frame i:nth-child(1){top:0;left:0;border-right:0;border-bottom:0;border-top-left-radius:14px}
.sc-frame i:nth-child(2){top:0;right:0;border-left:0;border-bottom:0;border-top-right-radius:14px}
.sc-frame i:nth-child(3){bottom:0;left:0;border-right:0;border-top:0;border-bottom-left-radius:14px}
.sc-frame i:nth-child(4){bottom:0;right:0;border-left:0;border-top:0;border-bottom-right-radius:14px}
.sc-line{position:absolute;inset-inline:4%;top:8%;height:2px;border-radius:2px;background:#E9C46A;box-shadow:0 0 12px 2px rgba(233,196,106,.7);animation:scanline 2.4s ease-in-out infinite}
@keyframes scanline{0%,100%{top:8%}50%{top:90%}}
.sc-cam.paused video{filter:brightness(.42) saturate(.6)}
.sc-cam.paused .sc-frame i{border-color:#62CF94}
.sc-cam.paused .sc-line,.sc-cam.off .sc-line{display:none}
.sc-cam.off .sc-frame{opacity:.3}
.sc-say{position:absolute;inset-inline:12px;bottom:12px;margin:0;padding:8px 12px;border-radius:12px;background:rgba(10,16,26,.8);color:#FFFFFF;font-size:13.5px;font-weight:700;line-height:1.6;text-align:center}
.sc-say:empty{display:none}
.sc-say.bad{background:rgba(180,35,24,.94)}
.sc-say.ok{background:rgba(46,106,57,.94)}
.sc-panel{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}
.sc-panel:empty{display:none}
.sc-hint{margin:0;font-size:14px;line-height:1.8;color:var(--muted)}
.sc-hint b{color:var(--ink)}
.sc-an{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:center;gap:12px}
.sc-ph{position:relative;display:block;width:84px;aspect-ratio:1/1;border-radius:14px;overflow:hidden;background:var(--surface-2)}
.sc-ph img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.sc-ph .an-none .sil{width:84%}
.sc-ph .aid-badge{inset-block-start:4px;inset-inline-end:4px;width:26px;height:26px;border-radius:8px}
.sc-ph .aid-badge .ic{width:16px;height:16px}
.sc-id{display:grid;min-width:0;line-height:1.45}
.sc-id b{font-family:var(--font-display);font-size:clamp(19px,5.6vw,23px);font-weight:800;overflow-wrap:anywhere}
.sc-id small{font-size:13px;font-weight:600;color:var(--muted)}
.sc-st{margin:0;padding:10px 12px;border-radius:12px;background:var(--surface-2);font-size:14px;line-height:1.75}
.sc-st.out{background:var(--fld-tint)}
.sc-st.out b{color:var(--fld-ink)}
.sc-st small{display:block;font-size:12.5px;color:var(--muted)}
.sc-warn{margin:0;padding:10px 12px;border-radius:12px;background:var(--rest-tint);color:var(--rest-ink);font-size:13.5px;font-weight:700;line-height:1.7}
.sc-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sc-go{height:62px;padding:0 8px;border-radius:15px;font-size:15.5px;line-height:1.3;white-space:normal}
.sc-go .ic{width:21px;height:21px}
.sc-go.out{background:var(--brass);color:#141B24}
.sc-go.in{background:var(--in-solid);color:var(--on-fill)}
.sc-go:disabled{background:var(--surface-2);color:var(--muted);opacity:1}
.sc-go.armed{background:var(--crit-solid);color:#FFFFFF}
.sc-more{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px}
.sc-done{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px 12px;padding:12px 14px;border-radius:14px;background:var(--ok-tint)}
.sc-done>.ic{width:30px;height:30px;stroke-width:2.6;color:var(--ok)}
.sc-done p{margin:0;font-size:14.5px;line-height:1.75}
.sc-done b{color:var(--ok)}
.sc-done small{display:block;font-size:12.5px;color:var(--muted)}
.sc-done .btn{grid-column:1/-1;justify-self:start;height:38px}
.sc-err{margin:0;padding:10px 12px;border-radius:12px;background:var(--warn-tint);color:var(--warn);font-size:14px;font-weight:600;line-height:1.75}
.sc-alt{display:flex;flex-wrap:wrap;gap:8px}
.sc-alt .btn{flex:1 1 150px}
.sc-pick{display:grid;gap:8px}
.sc-list{display:grid;gap:6px;max-height:46vh;overflow:auto}
.sc-li{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:50px;padding:6px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-weight:700;text-align:start;cursor:pointer}
.sc-li span{display:grid;min-width:0;line-height:1.45}
.sc-li small{font-size:12px;font-weight:600;color:var(--muted)}
.sc-li i{flex:none;padding:1px 8px;border-radius:999px;background:var(--fld-tint);color:var(--fld-ink);font-size:11.5px;font-style:normal;font-weight:800}

/* the section's horses, at the top of «الفرسان» */
.hz-box{gap:12px}
.hz-sum{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.hz-feed{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:2px 11px;border-radius:999px;background:var(--surface-2);font-size:13px;font-weight:700;color:var(--ink)}
.hz-feed .ic{width:15px;height:15px;color:var(--muted)}
.hz-acts{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.hz-acts .btn{height:44px;padding:0 10px;font-size:14px}
.hz-tabs{display:flex;max-width:100%;overflow-x:auto;scrollbar-width:none;justify-self:start}
.hz-tabs button .ic{width:16px;height:16px}
/* a phone: the three side by side, the whole width (no icons) */
@media (max-width:520px){.hz-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));justify-self:stretch;width:100%}.hz-tabs button{justify-content:center;padding:0 6px;font-size:13px}.hz-tabs button .ic{display:none}}
#hzViews{min-width:0}
/* a rider's horses, with their pictures, in his card */
.rdr-top{display:grid;gap:8px;width:100%;margin:0;padding:0;border:0;background:none;font:inherit;color:inherit;text-align:right;cursor:pointer}
.ro .rdr-top{cursor:default}
.hz-rdr:has(.rdr-top:hover){border-color:var(--muted)}
.ro .hz-rdr:has(.rdr-top:hover){border-color:var(--line)}
.hz-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px}
.hz-t{position:relative;display:grid;align-content:start;gap:1px;min-width:0;padding:0 0 7px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font:inherit;text-align:center;overflow:hidden;cursor:pointer}
.hz-t:hover{border-color:var(--muted)}
.hz-t-ph{position:relative;display:block;aspect-ratio:4/3;background:var(--surface-2);overflow:hidden}
.hz-t-ph img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.hz-t-ph .an-none .sil{width:70%}
.hz-t-n{padding:5px 6px 0;font-weight:800;font-size:12.5px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext}
.hz-t-m{padding:0 6px;font-size:11.5px;font-weight:600;line-height:1.4;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hz-fl,.hz-rs,.hz-away{position:absolute;inset-inline:5px;display:flex;align-items:center;justify-content:center;gap:3px;padding:1px 6px;border-radius:999px;font-size:10.5px;font-weight:800;line-height:1.6;white-space:nowrap;overflow:hidden}
.hz-fl{inset-block-end:5px;background:#C3A35A;color:#141B24}
.hz-rs{inset-block-end:5px;background:var(--rbg,#C81E1E);color:var(--rfg,#FFFFFF)}
.hz-fl+.hz-rs{inset-block-end:26px}
.hz-away{inset-block-start:5px;background:rgba(14,20,30,.74);color:#FFFFFF}
.hz-fl .ic,.hz-rs .ic{width:11px;height:11px;stroke-width:2.4}
.hz-t.rest{border-color:var(--rbg);box-shadow:inset 0 -3px 0 var(--rbg)}
.hz-t.picked{border-color:var(--focus);box-shadow:0 0 0 2px var(--focus)}
.hz-t.picked .an-tick{background:var(--focus);border-color:var(--focus)}
.hz-t .an-tick{inset-block-start:5px;inset-inline-end:5px;width:26px;height:26px}
.hz-none{margin:0;font-size:12.5px;color:var(--muted)}
.hz-orph{grid-column:1/-1}
/* a rider's file: each horse with its card */
#rHorses[data-hz="1"]{display:grid;gap:8px}
.hz-rf{display:grid;grid-template-columns:92px minmax(0,1fr);gap:6px 12px;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.hz-rf-ph{grid-row:span 2;display:block;width:92px;aspect-ratio:4/3;padding:0;border:0;border-radius:10px;overflow:hidden;background:var(--surface-2);cursor:pointer}
.hz-rf-ph img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.hz-rf-ph .an-none .sil{width:76%}
.hz-rf-tx{display:grid;align-content:start;min-width:0;line-height:1.5}
.hz-rf-tx b{font-size:15px;font-weight:800;overflow-wrap:anywhere;unicode-bidi:plaintext;text-align:right}
.hz-rf-tx small{font-size:12.5px;font-weight:600;color:var(--muted)}
.hz-rf-tx .hz-own{color:var(--in);font-weight:700}
.hz-rs-l,.hz-fl-l{justify-self:start;display:inline-flex;align-items:center;gap:4px;margin-top:3px;padding:1px 8px;border-radius:999px;font-size:11.5px;font-weight:800}
.hz-rs-l{background:var(--rest-tint);color:var(--rest-ink)}
.hz-fl-l{background:var(--fld-tint);color:var(--fld-ink)}
.hz-rs-l .ic,.hz-fl-l .ic{width:13px;height:13px}
.hz-rf-acts{display:flex;flex-wrap:wrap;gap:6px}
.hz-rf-acts .btn{height:34px}
.hz-rf-acts .btn.danger{width:34px;padding:0}
.hz-rf-acts .btn.danger .ic{width:16px;height:16px}
.hz-rf-add{justify-self:start}
/* «إضافة خيل» to a rider: the record's horses to tap */
.hz-pk{grid-template-columns:44px minmax(0,1fr) auto;width:100%;font:inherit;color:inherit;text-align:start}
.hz-pk-add{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--surface-2);color:var(--ink)}
.hz-pk-add .ic{width:17px;height:17px}
/* the card: its riders, each one his file */
.cd-rider{display:inline;margin:0;padding:0;border:0;background:none;font:inherit;font-weight:700;color:var(--in);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.facts dd .cd-rider+.cd-rider::before{content:"، ";color:var(--muted);text-decoration:none;display:inline-block}
/* the form: the riders, the food and the shoes */
.ed-box{display:grid;gap:10px;margin:0;padding:12px;border:1px solid var(--line);border-radius:16px}
.ed-box legend{padding:0 6px;font-size:13.5px;font-weight:800;color:var(--ink)}
.ed-others{display:grid;gap:8px}
.ed-rg-l{font-size:13px;font-weight:600;color:var(--muted)}
.ed-rg-l i{font-style:normal;font-weight:400}
.ed-rg{display:grid;gap:6px}
.ed-rg-t{font-size:12px;font-weight:800;color:var(--muted)}
.ed-rg .opt span{height:38px;font-size:13.5px}
.opt.taken span{opacity:.45;border-style:dashed}
/* moves out of the section */
.mv-ic.out{background:var(--surface-2);color:var(--out)}
/* picking several to move them */
.hz-selbar{position:fixed;z-index:35;inset-inline:0;bottom:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:10px max(16px,calc((100% - 1120px) / 2)) calc(10px + env(safe-area-inset-bottom,0px));background:var(--navy);color:var(--navy-ink);box-shadow:0 -10px 30px -18px rgba(0,0,0,.6)}
.hz-selbar p{flex:1 1 180px;margin:0;font-size:14px;font-weight:700}
.hz-selbar .btn{height:44px}
.hz-selbar .btn.ghost{background:transparent;border-color:var(--band-line);color:var(--navy-ink)}
.hz-selbar .btn.primary{background:var(--btn-on-navy);color:var(--on-btn-on-navy)}
html.hz-selecting .wrap{padding-bottom:150px}
html.hz-selecting .actions{display:none}
html.hz-selecting .toast{bottom:calc(132px + env(safe-area-inset-bottom,0px))}
@media (min-width:720px){html.hz-selecting .toast{bottom:96px}}
/* the import page */
.im-body{justify-items:stretch;max-width:1000px;margin-inline:auto}
.st-new{color:var(--in);font-weight:800}.st-upd{color:var(--warn);font-weight:800}.st-same{color:var(--muted)}
/* the birth date box: a horse written with its year only, said under the calendar */
#edBornYr .link{padding:0 2px;font-size:inherit;text-decoration:underline}
#dlgEdit .grid2>.field{align-content:start}   /* a field beside a taller one keeps its box under its name */

/* «مواعيد الصحة»: each horse's care (الحدوة، الديدان، التطعيم، الأسنان…), when it was done and when it comes again */
.cr-tools{display:grid;gap:10px;margin:0 0 12px}
.cr-tools .chip{min-height:36px;gap:6px;font-size:13.5px}
.cr-tools .chip small{font-weight:700;opacity:.8}
.cr-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
.cr-kbtn{justify-self:start}
.cr-list{display:grid;gap:6px;min-width:0}
.cr-r{display:grid;grid-template-columns:46px minmax(0,1fr);align-items:center;gap:10px;width:100%;min-height:58px;padding:7px 10px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font:inherit;text-align:start;cursor:pointer}
.cr-r:hover{border-color:var(--muted)}
.cr-r .pk-ph{width:46px;height:46px;border-radius:10px}
.cr-r b{font-size:14.5px;font-weight:800}
.cr-r small{font-size:12px;font-weight:600;color:var(--muted)}
.cr-ps{display:flex;flex-wrap:wrap;gap:4px 6px;margin-top:5px}
.cr-p{display:inline-flex;align-items:center;min-height:24px;padding:1px 9px;border-radius:999px;font-size:12px;font-weight:800;line-height:1.5;background:var(--surface-2);color:var(--muted)}
.cr-p.late{background:var(--crit-tint);color:var(--crit)}
.cr-p.week{background:var(--warn-tint);color:var(--warn)}
.cr-p.ok{background:var(--ok-tint);color:var(--ok)}
.cr-p.dim{opacity:.6}
.cr-box{display:grid;padding:2px 12px;border-radius:14px;background:var(--surface-2);margin:0 0 6px}
.cr-k{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 10px;padding:10px 0;border-top:1px solid var(--line)}
.cr-k:first-child{border-top:0}
.cr-k p{margin:0;font-size:13px;line-height:1.65;color:var(--muted)}
.cr-k p b{color:var(--ink);font-size:14px}
.cr-k .btns{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}
.cr-h{grid-column:1/-1;margin:0;padding:0;list-style:none;font-size:12.5px;color:var(--muted)}
.cr-h li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 0;border-top:1px dashed var(--line)}
.cr-h li span{min-width:0;overflow-wrap:anywhere}
.cr-more{display:grid;gap:4px;max-height:220px;overflow:auto;padding:6px 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.cr-more label{display:flex;align-items:center;gap:8px;min-height:36px;font-size:13.5px;font-weight:600}
.cr-more label small{color:var(--muted);font-weight:600}
.ck-r{display:grid;grid-template-columns:minmax(0,1fr) 84px;gap:6px 8px;padding:10px 0;border-top:1px solid var(--line)}
.ck-r:first-child{border-top:0}
.ck-r .ck-opts{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13.5px;font-weight:600}
.ck-r .ck-opts label{display:inline-flex;align-items:center;gap:6px;min-height:34px}
.ck-r.off input[data-f="name"]{text-decoration:line-through;color:var(--muted)}
@media (max-width:480px){.cr-bar{grid-template-columns:1fr}.cr-bar .btn{width:100%}}
/* «الأعمدة اللي تنضاف للسجل»: the file's columns to tick over its lines */
.im-cols{display:grid;gap:10px;margin:0;padding:12px 14px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.im-cols legend{padding:0 6px;font-size:14px;font-weight:800}
.im-cols legend span{margin-inline-start:4px;font-weight:700;color:var(--muted)}
#imOut{display:grid;gap:12px;min-width:0}
.im-cols .opt span{height:38px;padding:0 13px;font-size:14px}
.im-cols .pr-col-b{margin-top:0}
.im-add{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;cursor:pointer}
.im-add input{width:20px;height:20px;margin:0;accent-color:var(--chip-on)}
.im-cols .hint{margin:0}
.im-t.few{min-width:0}
.im-t td.chg{color:var(--warn);font-weight:800}
.im-t td.chg b{color:inherit}
