:root {
  color-scheme:light;
  --ink:#20282e;
  --muted:#52626e;
  --line:#d5dde0;
  --accent:#434f83;
  --bg:#f4f6f5;
  --soft:#eceff6;
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
* {
  box-sizing:border-box;
}
[hidden] {
  display:none!important;
}
body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
}
button,input,textarea,select {
  font:inherit;
}
button {
  cursor:pointer;
}
button:disabled {
  opacity:.55;
  cursor:default;
}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible {
  outline:3px solid #8277c5;
  outline-offset:3px;
}
header {
  min-height:72px;
  padding:12px clamp(18px,5vw,85px);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#fff;
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:-.03em;
}
.brand-small,.slash {
  font-weight:500;
  color:var(--muted);
}
.mark {
  display:grid;
  place-items:center;
  flex:none;
  background:linear-gradient(135deg,#5c6496,#a3a7cb);
  color:#fff;
  width:34px;
  height:34px;
  border-radius:10px;
  box-shadow:0 6px 16px rgba(92,100,150,.18);
}
.mark svg { display:block; }
.slash {
  color:#a7b0b4;
}
main {
  max-width:1180px;
  padding:clamp(28px,5vw,64px) 25px;
  margin:auto;
}
h1,h2,p {
  margin:0;
}
h1 {
  font-size:clamp(34px,4.2vw,52px);
  font-weight:600;
  line-height:1.12;
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
}
h2 {
  font-size:22px;
  line-height:1.2;
  letter-spacing:-.035em;
  font-weight:600;
}
.eyebrow {
  font-size:13px;
  font-weight:650;
  color:var(--accent);
  margin-bottom:10px;
}
.login {
  display:grid;
  place-items:center;
  min-height:min(65vh,680px);
}
.login-card,.upload,.list {
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
}
.login-card {
  width:min(100%,460px);
  padding:clamp(24px,4vw,40px);
  box-shadow:0 10px 40px #273c4d09;
}
.upload>p,.empty,#chosen,#list-status,#load-status {
  color:var(--muted);
}
.primary,.secondary,.quiet {
  border-radius:8px;
  min-height:42px;
  padding:8px 14px;
  line-height:1.35;
  font-weight:600;
}
.primary {
  background:var(--accent);
  border:1px solid var(--accent);
  color:#fff;
}
.primary span {
  margin-left:8px;
}
.secondary {
  background:white;
  border:1px solid #aeb8c5;
  color:var(--ink);
}
.quiet {
  color:var(--accent);
  background:transparent;
  border:0;
}
.quiet:hover,.secondary:hover {
  background:var(--soft);
}
.primary:not(:disabled):hover {
  background:#34406f;
}
label {
  display:block;
  font-size:14px;
  font-weight:650;
  margin:12px 0 5px;
}
input:not([type=file]),textarea,select {
  min-width:0;
  width:100%;
  padding:10px 12px;
  border:1px solid #aeb8c5;
  border-radius:8px;
  background:#fff;
  color:var(--ink);
}
textarea { display:block; resize:vertical; }
.case-group { padding:14px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.case-description { color:var(--muted); white-space:pre-wrap; margin:4px 0 12px; }
#rows { list-style:none; margin:0; padding:0; max-height:min(65vh,44rem); overflow-y:auto; }
#rows:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
#grants { max-height:min(50vh,24rem); overflow-y:auto; }
.optional {
  font-size:12px;
  font-weight:400;
  color:var(--muted);
  margin-left:5px;
}
.login .primary {
  width:100%;
  margin-top:15px;
}
.error {
  color:#943c3a;
}
.error:not(:empty) {
  margin-top:10px;
}
.case-heading {
  margin-bottom:27px;
}
.columns {
  display:grid;
  grid-template-columns:1.5fr 1fr;
  gap:22px;
  align-items:start;
}
.list,.upload {
  padding:clamp(18px,3vw,30px);
}
.list-head,.row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.list-head {
  padding-bottom:12px;
}
.row,.empty {
  border-top:1px solid var(--line);
  padding:16px 0;
}
.row strong {
  display:block;
  overflow-wrap:anywhere;
}
.meta,.empty,.upload>p,.drop p,#chosen,#list-status,#upload-status,#load-status {
  font-size:14px;
}
.meta {
  color:var(--muted);
  margin-top:4px;
}
.row .secondary {
  white-space:nowrap;
}
.upload>p {
  margin-top:6px;
}
.drop {
  padding:20px 10px;
  background:#f7f8fb;
  border:1px dashed #9ba8be;
  border-radius:10px;
  text-align:center;
  margin:15px 0;
}
.drop.over {
  background:#e8edf8;
  border-color:var(--accent);
}
.picks {
  display:flex;
  justify-content:center;
  gap:4px;
  margin-top:12px;
}
.drop p {
  margin:3px 0;
  color:var(--muted);
}
#chosen:not(:empty),#list-status:not(:empty),#upload-status:not(:empty) {
  margin:10px 0;
}
.upload .primary {
  width:100%;
}
progress {
  width:100%;
  accent-color:var(--accent);
  margin-top:12px;
}
#viewer {
  position:fixed;
  inset:0;
  background:#0b0d10;
  z-index:5;
}
#loading h2 {
  margin:20px 0 8px;
}
#boot {
  color:var(--muted);
}
@media(max-width:780px) {
  .columns {
    grid-template-columns:1fr;
  }
  .brand {
    gap:6px;
  }
  .brand {flex-wrap:wrap;font-size:14px}
  header {
    min-height:58px;
  }
  .row {
    align-items:flex-start;
  }
}
@media(max-width:420px) {
  main {
    padding:22px 14px;
  }
  .list,.upload {
    padding:16px;
  }
  .row {
    flex-wrap:wrap;
  }
}
.link-button {width:100%;margin-top:8px}
fieldset {border:1px solid var(--line);border-radius:8px;margin:16px 0;padding:8px 15px}
legend {font-size:14px;font-weight:650;padding:0 6px}
label.check {display:flex;gap:8px;align-items:center;font-weight:400;margin:8px 0}
.check input[type=checkbox] {width:18px;height:18px;flex:none}
#admin .case-heading {margin-top:16px}
#case-form button {margin-top:14px}
#code-box {padding:12px 16px;margin-top:12px;background:var(--soft);border-radius:8px}
#issued-code {font-family:monospace;font-size:23px;letter-spacing:.1em;user-select:all}
#access-result:not(:empty), #case-result:not(:empty) {margin-top:12px}
#data-admin h1 {margin:14px 0 22px}
#data-admin .list {max-width:850px}
.data-actions {display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.data-actions [aria-pressed=true] {background:var(--soft);box-shadow:inset 0 -2px var(--accent)}
#data-rows {list-style:none;padding:0;margin:12px 0;max-height:58vh;overflow-y:auto}
#data-rows .row {overflow-wrap:anywhere}
.danger {color:#963638}
#data-status:not(:empty) {margin-top:12px}
