:root {
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.4);
  --gold-faint: rgba(212, 175, 55, 0.08);
  --bg-dark: #0a0f1a;
  --ink: #e8e6e3;
  --muted: #bbb;
  --panel: rgba(255, 255, 255, 0.02);
  --line: #222;
  --line-strong: #333;
  --warn: #d4af37;
  --ok: #8fbf8f;
  --err: #d98989;
  --font: Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

img {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at top, var(--bg-dark), #000);
  line-height: 1.6;
}

.wrap {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.nav-action {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid rgba(212, 175, 55, 0.6);
  background: transparent;
  color: var(--gold);
  padding: 1rem 1.75rem;
  min-width: 9.5rem;
  height: 3.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-action:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.nav-action[aria-selected="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
  color: var(--gold);
}

.nav-action--verify {
  color: #22c55e;
}

#nav-verify {
  color: #22c55e;
}

.seal {
  flex-shrink: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal img {
  display: block;
  width: 160px;
  height: 160px;
  max-width: 160px;
  background: var(--bg-dark);
  border-radius: 50%;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--gold);
  letter-spacing: 1px;
  font-weight: normal;
}

.tagline {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  color: var(--muted);
  text-align: center;
}

.chain {
  height: 1px;
  width: 60%;
  margin: 0 auto 1.5rem;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.gdpr {
  margin: 2rem 0 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--gold-faint);
  border: 1px solid var(--gold-soft);
  border-radius: 4px;
  text-align: left;
}

.gdpr h2 {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.gdpr p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.gdpr ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.gdpr li {
  margin: 0.45rem 0;
}

.gdpr li strong {
  color: var(--gold);
  font-weight: normal;
}

.gdpr-note {
  margin: 0 !important;
  padding-top: 0.65rem;
  border-top: 1px solid var(--gold-soft);
  color: var(--muted) !important;
  font-size: 0.9rem !important;
}

.try-break {
  height: 1px;
  width: 60%;
  margin: 2rem auto 1.25rem;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.55;
}

.try-lead {
  margin: 0 auto 1.25rem;
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.share-proof {
  margin: 0 0 0.5rem;
  text-align: center;
}

.share-proof h2 {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  font-weight: normal;
  letter-spacing: 1px;
  text-align: center;
  text-transform: none;
}

.share-proof > p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
}

.share-proof > p strong {
  color: var(--gold);
  font-weight: normal;
  font-family: var(--mono);
  font-size: 0.9em;
}

.share-figure {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  margin: 0 auto 1.15rem;
  padding: 0;
}

.share-photo {
  display: block;
  width: auto;
  max-width: min(420px, 100%);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--gold-soft);
  object-fit: contain;
}

.share-figure figcaption {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.share-figure figcaption strong {
  color: var(--gold);
  font-weight: normal;
  font-family: var(--mono);
  font-size: 0.9em;
}

.share-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.share-steps li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
}

.share-steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.share-step-n {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.share-step-t strong {
  color: var(--gold);
  font-weight: normal;
  font-family: var(--mono);
  font-size: 0.9em;
}

.howto {
  margin: 0 0 1.15rem;
  padding: 0.85rem 0.85rem 0.85rem 2rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.howto li {
  margin: 0.35rem 0;
}

.howto strong {
  color: var(--gold);
  font-weight: normal;
}

.howto code {
  font-family: var(--mono);
  color: var(--ink);
  font-size: 0.9em;
}

.meta dd.plain {
  font-family: var(--font);
  color: var(--muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.tab {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 1.15rem;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.tab:hover {
  border-color: var(--gold-soft);
  color: var(--gold);
}

.tab[aria-selected="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--gold-soft);
  border-radius: 0 0 4px 4px;
  padding: 1.35rem;
}

.panel.active { display: block; }

.panel.active + .panel,
.panel + .gdpr {
  margin-top: 2rem;
}

.dropzone {
  margin-bottom: 1.15rem;
  border: 1px dashed var(--gold-soft);
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.03);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone.dragover {
  border-color: var(--gold);
  background: var(--gold-faint);
}

.dropzone p { margin: 0.35rem 0; color: var(--ink); }
.dropzone .hint { color: var(--muted); font-size: 0.9rem; }
.dropzone strong {
  color: #39ff14;
  font-weight: bold;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.45);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.meta { margin-top: 1.1rem; display: none; }
.meta.visible { display: block; }

.meta dl {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.4rem 0.75rem;
  margin: 0;
}

.meta dt {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.meta dd {
  margin: 0;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.hash {
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.7rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  word-break: break-all;
  color: var(--gold);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

button.primary,
button.secondary {
  appearance: none;
  border-radius: 4px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

button.primary {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #000;
}

button.primary:hover:not(:disabled) {
  background: #e0c04a;
  border-color: #e0c04a;
}

button.primary:disabled,
button.secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line-strong);
}

button.secondary:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-faint);
}

.status {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 4px;
  display: none;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.status.visible { display: block; }

.status.info {
  background: var(--gold-faint);
  border: 1px solid var(--gold-soft);
  color: var(--gold);
}

.status.warn {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-soft);
  color: var(--warn);
}

.status.ok {
  background: rgba(143, 191, 143, 0.08);
  border: 1px solid rgba(143, 191, 143, 0.35);
  color: var(--ok);
}

.status.err {
  background: rgba(217, 137, 137, 0.08);
  border: 1px solid rgba(217, 137, 137, 0.35);
  color: var(--err);
}

.verify-grid { display: grid; gap: 1rem; }

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.field input[type="file"] {
  width: 100%;
  color: var(--muted);
  font: inherit;
}

.certificate {
  display: none;
  margin-top: 1.35rem;
  padding: 0;
  border: none;
  background: transparent;
}

.certificate.visible { display: block; }

.cert-frame {
  border: 3px solid var(--gold);
  background: rgba(0, 0, 0, 0.45);
}

.cert-banner {
  background: var(--gold);
  color: #0a0f1a;
  text-align: center;
  padding: 0.85rem 1rem 0.75rem;
}

.cert-banner-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.cert-banner-site {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cert-body {
  padding: 1.1rem 1.2rem 1.15rem;
}

.certificate .row { margin: 0 0 0.75rem; }
.certificate .label {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.certificate .value {
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--ink);
}
.certificate .value.cert-plain {
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}
.cert-statement {
  margin: 0.9rem 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
}
.cert-howto {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gold-soft);
}
.cert-howto-title {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.cert-howto ol {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.cert-howto li { margin: 0 0 0.3rem; }
.cert-url {
  font-family: var(--mono);
  color: var(--ink);
  word-break: break-all;
}

footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #111;
  color: #555;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 1px;
}

footer a {
  color: #666;
  text-decoration: none;
}

footer a:hover {
  color: var(--gold);
}

.missing-page {
  text-align: center;
  margin: 0;
}

.missing-page a {
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 1px;
}

.missing-page a:hover {
  text-decoration: underline;
}

.admin-intro {
  color: var(--muted);
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
}

.login-form {
  display: grid;
  gap: 0.65rem;
  max-width: 360px;
}

.login-form label {
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form textarea,
.field-inline input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: inherit;
}

.login-form input:focus,
.login-form textarea:focus,
.field-inline input:focus {
  outline: 1px solid var(--gold-soft);
  border-color: var(--gold);
}

.back-link {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

.back-link a {
  color: var(--gold);
  text-decoration: none;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.admin-badge {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--gold-soft);
  background: var(--gold-faint);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 4px;
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.admin-card {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 1.1rem;
}

.admin-card h2 {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.admin-card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.admin-list li {
  margin: 0.4rem 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}

.field-inline {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.field-inline span {
  color: var(--muted);
  font-size: 0.85rem;
}

a.button-link {
  display: inline-block;
  border-radius: 4px;
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  letter-spacing: 0.5px;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  background: transparent;
}

a.button-link:hover {
  border-color: var(--gold);
  background: var(--gold-faint);
}

@media (max-width: 480px) {
  html,
  body {
    overflow-x: hidden;
  }

  .wrap {
    width: calc(100% - 1.5rem);
    max-width: 100%;
    padding: 1.5rem 0 3rem;
  }

  header.brand .brand-nav {
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
  }

  header.brand .brand-nav .nav-action {
    min-width: 0;
    flex: 1 1 0;
    height: 2.85rem;
    padding: 0.45rem 0.35rem;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  header.brand .brand-nav .seal img {
    width: 100px;
    height: 100px;
    max-width: 100px;
  }

  .share-photo {
    max-width: 100%;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  html, body {
    background: #fff !important;
    color: #111 !important;
  }

  body * { visibility: hidden; }

  #certificate,
  #certificate * {
    visibility: visible;
  }

  #certificate {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cert-frame {
    border: 4px solid #d4af37;
    background: #fff;
  }

  .cert-banner {
    background: #d4af37;
    color: #0a0f1a;
  }

  .certificate .label {
    color: #8a7018;
  }

  .certificate .value,
  .certificate .value.cert-plain,
  .cert-statement {
    color: #111;
  }

  .cert-howto {
    border-top-color: #d4af37;
  }

  .cert-howto-title {
    color: #8a7018;
  }

  .cert-howto ol {
    color: #333;
    font-size: 0.72rem;
  }

  .cert-url {
    color: #111;
  }
}

.limit-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.limit-modal[hidden] {
  display: none;
}

.limit-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

.limit-modal__box {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  border: 1px solid var(--gold-soft);
  border-radius: 4px;
  padding: 1.6rem 1.35rem;
  background: var(--bg-dark);
  text-align: center;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.15);
  box-sizing: border-box;
}

.limit-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font: 400 1.5rem/1 var(--font);
  cursor: pointer;
}

.limit-modal__close:hover {
  background: rgba(212, 175, 55, 0.15);
}

.limit-modal__box h1 {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
  color: var(--gold);
  font-weight: normal;
  letter-spacing: 1px;
}

.limit-modal__box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

body.limit-blocked #stamp-panel {
  opacity: 0.5;
}

.demo-login-modal {
  z-index: 10000;
}

.demo-login-modal .limit-modal__box {
  text-align: left;
}

.demo-login-modal .limit-modal__box h1,
.demo-login-modal .limit-modal__box > p {
  text-align: center;
}

.demo-login-modal .limit-modal__box > p {
  margin-bottom: 1rem;
}

.demo-login-form {
  max-width: none;
  margin-top: 0.25rem;
}

.demo-login-form textarea {
  resize: vertical;
  min-height: 5.5rem;
  font: inherit;
}

.demo-login-error {
  margin: 0.15rem 0 0;
  color: #ff3b3b;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow:
    0 0 6px #ff1a1a,
    0 0 14px rgba(255, 40, 40, 0.9),
    0 0 28px rgba(255, 60, 60, 0.55);
}

.demo-register-ok {
  color: #5ee0a0;
  text-shadow:
    0 0 6px #3dcc88,
    0 0 14px rgba(94, 224, 160, 0.7);
}

#demo-register-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

#demo-register-submit .btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

#demo-register-submit.is-sending .btn-spinner {
  display: inline-block;
}

#demo-register-close:disabled {
  opacity: 0.35;
  cursor: default;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.demo-access-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.demo-access-bar button {
  -webkit-appearance: none;
  appearance: none;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(212, 175, 55, 0.7);
  border-radius: 6px;
  background: transparent;
  color: #d4af37;
  font: 400 0.82rem/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.demo-access-bar button:hover {
  background: rgba(212, 175, 55, 0.12);
}

.demo-access-bar button[hidden] {
  display: none;
}

body.login-blocked #tool-section {
  opacity: 0.45;
  user-select: none;
}
