/* Rules added with the stress-test fixes. Loaded after portal.css. */
.who > a { display: inline-flex; text-decoration: none; }
.case .rownote + .actions { margin-top: .5rem; }
form.plain + form.plain { margin-top: .25rem; }
/* licence card: the name takes at most two lines, so the Khmer and club lines always show */
.lic .nm .n{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}

/* ---- competitions and entries ---- */
textarea{border:1px solid #B9BCCF;border-radius:6px;padding:9px 11px;background:#fff;width:100%;min-width:0;font-weight:400;resize:vertical}
input[type=radio]{width:18px;height:18px;margin-top:4px;flex:none}
.check input[type=radio]{margin-top:4px}
legend.small{font:600 .95rem var(--display)}
ul.why{list-style:none;margin:0;padding:0;display:grid;gap:8px}
ul.why li{display:grid;gap:2px}
.facts dd{white-space:normal}
/* tables that stack into blocks on a phone, so nothing scrolls sideways */
@media (max-width:640px){
  .scroll table.stack{min-width:0;display:block}
  .stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .stack tbody,.stack tfoot{display:block}
  .stack tr{display:grid;gap:6px;padding:14px 0;border-bottom:1px solid var(--line)}
  .stack tbody tr:last-child{border-bottom:0}
  .stack td{display:flex;gap:12px;justify-content:space-between;align-items:baseline;padding:0;border:0;min-width:0}
  .stack td::before{content:attr(data-label);flex:none;color:var(--muted);font-size:.85rem}
  .stack td:not([data-label])::before{content:none}
  .stack td:not([data-label]):empty{display:none}
  .stack td.r{text-align:right}
}
/* accreditation badge: the Events line may be long, so it wraps and the card keeps its shape */
.badge .nm{-webkit-line-clamp:3;line-clamp:3}
.badge .meta{flex-wrap:wrap;gap:1cqw 4cqw;align-items:end}
.badge .meta b{white-space:normal;overflow-wrap:anywhere;font-size:3.2cqw}
.badge .top span:first-child{min-width:0;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}
/* three stat boxes: no empty fourth cell */
.stats.three{grid-template-columns:repeat(auto-fit,minmax(104px,1fr))}
.stats.three .stat b{font-size:1.35rem}

/* ---- motion (licences/motion-ui.js) ---- */
/* Page sections wait hidden until the script animates them in. If the script never runs,
   this fallback shows them after 1.5 s, so a page can never stay blank. */
.motion-pending main>*{opacity:0;animation:motion-fallback 0s linear 1.5s forwards}
@keyframes motion-fallback{to{opacity:1}}
.cards{perspective:1200px}
#pay-total{display:inline-block}
@media print{main>*,main tr,.lic,.pill,.msgs li{opacity:1 !important;transform:none !important;animation:none !important}}

/* ---- design review (UI UX Pro Max checklist) ---- */
/* Form fields: 16px text so iPhone Safari does not zoom the page on tap, and a 44px tap height. */
input[type=text],input[type=date],input[type=tel],input[type=email],input[type=number],input[type=password],input[type=url],input[type=search],select,textarea{font-size:16px;min-height:44px}
input[type=file]{font-size:.9rem}
input[type=file]::file-selector-button{font:600 .9rem var(--body);padding:10px 14px;margin-right:12px;border:1px solid #B9BCCF;border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer}
input[type=file]::file-selector-button:hover{border-color:var(--ink)}
.check{min-height:44px;align-items:center}
.check input{margin-top:0}
details summary{padding:10px 0}
.count{font-size:.75rem}
/* Remove is a destructive action: danger colour, kept apart from Edit. */
.link.remove{color:var(--bad);margin-left:18px}
/* A form that is sending: the tapped button shows it is working. */
.is-sending{opacity:.6;cursor:progress}
button,a,label,summary,input,select{touch-action:manipulation}
@media (max-width:640px){
  /* Bigger tap targets in the header and in table rows on phones. */
  .userbox .link{display:inline-flex;align-items:center;min-height:44px;padding:0 6px}
  .userbox .btn{min-height:44px}
  .nav a{padding:10px 0}
  td .link,td a.link{display:inline-flex;align-items:center;min-height:44px}
  input[type=checkbox],input[type=radio]{width:24px;height:24px}
  .btn.small{min-height:40px;padding:8px 14px}
}

/* ---- outbox, results, officials ---- */
pre.mail{white-space:pre-wrap;overflow-wrap:anywhere;font:400 .9rem/1.5 var(--body);background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:12px 14px;margin:.5rem 0 1rem}
form.inline .f select{min-width:12rem}
details.sheet > summary{cursor:pointer}

/* ---- footer, privacy notice, check-in ---- */
.foot{max-width:1120px;margin:0 auto;padding:20px clamp(16px,4vw,40px) 40px;border-top:1px solid var(--line);display:flex;flex-wrap:wrap;gap:8px 24px;justify-content:space-between;color:var(--muted);font-size:.875rem}
.prose h2{margin-top:8px}
.prose ul{padding-left:20px;display:grid;gap:6px}
.prose p,.prose li{max-width:70ch}
.plain-list{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.search label{display:block;font-weight:600;margin-bottom:6px}
.search .row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.search input{flex:1 1 220px}
.checkin{display:grid;grid-template-columns:minmax(120px,200px) 1fr;gap:24px;align-items:start}
.checkin .facts{margin:16px 0}
.who-big{aspect-ratio:3/4;border-radius:10px;overflow:hidden;background:var(--paper);display:grid;place-items:center;font:700 3rem var(--display);color:var(--muted)}
.who-big img{width:100%;height:100%;object-fit:cover}
.pill.big{font-size:1rem;padding:6px 14px;margin:6px 0}
.btn.big{font-size:1.1rem;padding:16px 32px;min-height:56px}
@media (max-width:560px){.checkin{grid-template-columns:1fr}.who-big{width:min(60%,200px)}.btn.big{width:100%}}
@media print{.foot{display:none}}
