/* Certificate design, shared by certificate.html and the public /verify/<id> page. */
  main { padding-block: 36px 96px; display: grid; gap: 24px; justify-items: center; }
  .bar-top { width: min(1000px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .bar-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .crumb { color: var(--muted); font-size: 14px; }
  .crumb:hover { color: var(--ink); }

  /* The certificate always prints on paper, so it keeps its own light palette in both themes */
  .cert {
    --paper: #F3F1EA; --cink: #17150F; --cmuted: #6A665C; --cline: rgba(23, 21, 15, .22); --cacc: #2E5B45;
    width: min(1000px, 100%); aspect-ratio: 1.414; container-type: inline-size;
    background: var(--paper); color: var(--cink); position: relative; border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
    padding: 4.4cqw; display: grid;
  }
  .frame { position: relative; border: 1px solid var(--cline); outline: 1px solid var(--cline); outline-offset: -.9cqw; padding: 4.2cqw 5cqw 3.4cqw; display: grid; grid-template-rows: auto 1fr auto; }
  .frame::before, .frame::after { content: ""; position: absolute; width: 2.4cqw; height: 2.4cqw; border: 1.5px solid var(--cink); }
  .frame::before { left: -.5cqw; top: -.5cqw; border-right: 0; border-bottom: 0; }
  .frame::after { right: -.5cqw; bottom: -.5cqw; border-left: 0; border-top: 0; }
  .c-head { display: flex; justify-content: space-between; align-items: center; }
  .c-brand { display: flex; align-items: center; gap: 1cqw; font: 500 1.9cqw var(--font-ui); }
  .c-brand canvas { width: 2.6cqw; height: 2.6cqw; }
  .c-mono { font: 500 1.05cqw var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cmuted); }
  .c-body { display: grid; align-content: center; gap: 1.4cqw; }
  .c-title { font: 400 1.7cqw var(--font-display); letter-spacing: .02em; color: var(--cmuted); }
  .c-name { font: italic 400 6.6cqw/1 var(--font-display); letter-spacing: -.03em; color: var(--cink); overflow-wrap: anywhere; }
  .c-line { width: 46%; height: 1px; background: var(--cline); }
  .c-course { font: 400 3cqw/1.1 var(--font-display); letter-spacing: -.015em; }
  .c-course em { color: var(--cacc); font-style: normal; }
  .c-desc { font: 350 1.55cqw/1.45 var(--font-display); color: var(--cmuted); max-width: 62%; }
  .c-foot { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 4cqw; align-items: end; }
  .c-foot div { display: grid; gap: .5cqw; }
  .c-foot b { font: 400 1.7cqw var(--font-display); }
  .seal { justify-self: end; width: 10cqw; height: 10cqw; position: relative; }
  .seal canvas { width: 100%; height: 100%; }
  .empty { width: min(640px, 100%); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 32px; display: grid; gap: 14px; }
  .empty h1 { font-size: 36px; }

  @media print {
    @page { size: A4 landscape; margin: 0; }
    .topbar, .bar-top { display: none !important; }
    body { background: #fff; }
    main { padding: 0; }
    .cert { width: 100%; box-shadow: none; border-radius: 0; }
  }
