:root {
  /* The logos are black and grey, so the site is too; green and red are
     kept for "valid" and "withdrawn" only. */
  --ink: #1d1d1f;
  --muted: #666a73;
  --line: #e4e5e9;
  --line-strong: #c6c9d0;
  --paper: #ffffff;
  --page: #f6f6f7;
  --focus: #2563eb;
  --good: #17713f;
  --good-bg: #e7f5ec;
  --bad: #a3261c;
  --bad-bg: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 28px rgba(20, 20, 30, 0.06);
}
* { box-sizing: border-box; }
/* Room for the scroll bar is kept even when the page is too short to need
   one, so the page does not shift sideways when a list gets shorter. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Header: three logos spaced evenly, then a slim bar naming this site */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.logos {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 28px;
}
.logos a { display: block; position: relative; border-radius: 6px; }
.logos img { display: block; height: 54px; width: auto; }
/* The colour version lies exactly on top of the grey one and fades in while
   the pointer, or the keyboard focus, is on the logo. */
.logos img.colour { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.2s ease; }
.logos a:hover img.colour, .logos a:focus-visible img.colour { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .logos img.colour { transition: none; } }
.site-bar { border-top: 1px solid var(--line); }
.site-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.brand { text-decoration: none; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.bar-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.bar-link:hover, .brand:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

main { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.certificate, .verify, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.certificate, .verify { padding: 44px 40px; }
.certificate { text-align: center; }
h1 { font-size: 2.3rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 6px 0 12px; overflow-wrap: anywhere; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 6px 0; }
.lead strong { color: var(--ink); font-weight: 600; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}
.status::before {
  content: "\2713";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  -webkit-text-fill-color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.status.good { color: var(--good); background: var(--good-bg); }
.status.bad { color: var(--bad); background: var(--bad-bg); }
.status.bad::before { content: "\2715"; font-size: 10px; }
/* A valid certificate's tick is a small drawing: the disc grows, then the
   tick is drawn across it, once, when the page opens. */
.status.good:has(.tick)::before { content: none; }
.status .tick { width: 18px; height: 18px; flex: none; }
.status .tick circle { fill: currentColor; transform-origin: center; animation: tick-disc 0.25s ease-out both; }
.status .tick path {
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: tick-draw 0.35s ease-out 0.25s forwards;
}
@keyframes tick-disc { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce), print {
  .status .tick circle { animation: none; }
  .status .tick path { animation: none; stroke-dashoffset: 0; }
}
.note { color: var(--muted); margin: 14px 0 0; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 24px;
  margin: 32px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.facts div { min-width: 0; }
/* The long ID gets a row to itself so it is not broken across lines. */
.facts div:has(.mono) { grid-column: 1 / -1; }
.facts dt { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; font-weight: 500; }

/* Forms and buttons */
label { display: block; font-weight: 600; font-size: 0.95rem; margin: 22px 0 6px; }
.search-row { display: flex; gap: 10px; }
input[type="search"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]:hover { border-color: #9aa0ab; }
button, .button {
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, box-shadow 0.15s;
}
button:hover, .button:hover { background: #3a3a3f; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.results { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 8px; }
.results a {
  display: grid;
  gap: 1px;
  padding: 14px 16px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.results a:hover { border-color: var(--ink); background: var(--page); }
.muted { color: var(--muted); font-size: 0.9rem; }
.site-footer { max-width: 760px; margin: 0 auto 48px; padding: 0 16px; color: var(--muted); font-size: 0.88rem; text-align: center; }
.site-footer p { margin: 4px 0; }
.site-footer a { margin: 0 8px; text-underline-offset: 3px; white-space: nowrap; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .logos { padding: 14px 16px; gap: 10px 18px; }
  .logos img { height: clamp(26px, 6.4vw, 54px); }
  .site-bar-inner { padding: 9px 16px; }
}
@media (max-width: 560px) {
  /* Too narrow for three in a row: the first logo takes a line of its own. */
  .logos { flex-wrap: wrap; justify-content: space-around; }
  .logos a:first-child { flex-basis: 100%; display: flex; justify-content: center; }
  .logos a:first-child img.colour { left: 50%; transform: translateX(-50%); }
  .logos img { height: 34px; }
  main { margin: 24px auto; }
  .certificate, .verify { padding: 28px 20px; }
  h1 { font-size: 1.7rem; }
  .search-row { flex-direction: column; }
  .actions .button, .actions button { flex: 1 1 100%; text-align: center; }
}

/* Certificate image and the buttons under it */
.certificate-image {
  display: block;
  width: 100%;
  height: auto;
  /* Its space is kept from the start (the page gives its width and height),
     shown as a pale sheet until the picture has arrived and fades in. */
  background: var(--page);
  transition: opacity 0.35s ease;
  margin: 28px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 0; }
.button.linkedin { background: #0a66c2; }
.button.linkedin:hover { background: #084f96; }
.button.quiet { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button.quiet:hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A button that has been pressed and is waiting for the next page. */
button[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.button.quiet.done, .button.quiet.done:hover { color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.copied { color: var(--good); font-weight: 600; margin: 12px 0 0; overflow-wrap: anywhere; }
.certificate-image.loading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .certificate-image { transition: none; } }
main:has(.certificate-image) { max-width: 940px; }

@page { size: landscape; margin: 10mm; }
@media print {
  .site-header, .site-footer { display: none; }
  body { background: #fff; }
  .certificate { border: 0; box-shadow: none; }
  /* Print the certificate itself and nothing else. */
  main:has(.certificate-image) { max-width: none; margin: 0; padding: 0; }
  .certificate:has(.certificate-image) > *:not(.certificate-image) { display: none; }
  .certificate:has(.certificate-image) { padding: 0; }
  .certificate-image { margin: 0; border: 0; border-radius: 0; box-shadow: none; max-height: 185mm; width: auto; max-width: 100%; margin-inline: auto; }
}

/* Admin area */
.admin main { max-width: 760px; }
.admin main:has(.wide) { max-width: 1100px; }
.panel { padding: 32px; }
.panel.narrow { max-width: 420px; margin: 0 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel h1 { font-size: 1.8rem; }
.panel h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 32px 0 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin input[type="text"], .admin input[type="email"], .admin input[type="password"],
.admin input[type="date"], .admin select {
  width: 100%; font: inherit; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
}
.admin label.check { font-weight: 400; display: flex; gap: 8px; align-items: baseline; margin-top: 14px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; font-size: 0.9rem; border-radius: 4px; }
button.link:hover { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
button.danger { background: var(--bad); }
button.danger:hover { background: #7f1d16; }
.signout { margin: 0; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #ececef; color: var(--muted); white-space: nowrap; }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.good { background: var(--good-bg); color: var(--good); margin-left: 0; }
.badge.warn { background: #fdf0d5; color: #8a5a00; }
.errors { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; margin: 14px 0; }
.errors ul { margin: 0; padding-left: 18px; }
.notice { background: var(--good-bg); color: var(--good); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.table-wrap { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
tbody tr:hover { background: var(--page); }
.nowrap { white-space: nowrap; }
.history { padding-left: 18px; font-size: 0.92rem; }
.history li { margin: 4px 0; overflow-wrap: anywhere; }
.email-preview { white-space: pre-wrap; font: inherit; background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-wrap: anywhere; }

/* "About this award", "Also held by" and the report link on a certificate page */
.about { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--line); text-align: left; }
.about h2, .roll h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 8px; }
.about p { margin: 0 0 10px; }
.about a, .report-link a, .verify p > a:not(.button) { text-underline-offset: 3px; }
.about .results { margin-top: 12px; }
.report-link { margin: 28px 0 0; font-size: 0.9rem; color: var(--muted); }
.report-link a:hover { color: var(--ink); }

/* Text boxes outside the admin area (the report form) and long text anywhere */
.report input[type="text"], .report input[type="email"], textarea {
  display: block; width: 100%; font: inherit; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
}
textarea { resize: vertical; line-height: 1.45; }
textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* A box no person sees; automatic form-fillers fill it in and give themselves away. */
.extra { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
input[type="file"] { font: inherit; font-size: 0.95rem; max-width: 100%; }

/* Front page: the list of KPI Black Belts */
.roll { margin-top: 24px; }
.found { font-size: 1rem; margin: 28px 0 0; }
/* The answer area keeps its children's margins inside it, so its height can
   be measured and moved smoothly; while it moves, nothing spills out, and
   what has just arrived fades in. */
.lookup { display: flow-root; }
.resizing { overflow: hidden; }
.lookup > * { animation: arrive 0.25s ease both; }
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lookup > * { animation: none; } }
.roll h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.roll h3 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.names { list-style: none; margin: 0; padding: 0; columns: 3 190px; column-gap: 24px; }
.names li { break-inside: avoid; padding: 3px 0; }
.names a { text-decoration: none; font-weight: 500; }
.names a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Every page made of plain cards (front page, Check a certificate, the
   "Something wrong?" form) is the same width. */
main:has(> .verify) { max-width: 860px; }
@media print { .about, .report-link { display: none; } }
