:root {
  --pn-primary: #179b9a;
  --pn-primary-strong: #11445c;
  --pn-card: #ffffff;
  --pn-border: #d8dee2;
  --pn-muted: #56656d;
  --pn-error: #b31b1b;
}

.pn-public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Editor-only placeholder shown when a dynamic block has nothing to
   display given its current configuration (see PN_Blocks::is_editor_preview()).
   Never rendered on the public site. */
.pn-block-editor-hint {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--pn-border);
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.02);
  color: var(--pn-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.pn-public-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(246, 243, 238, 0.92);
  border-bottom: 1px solid rgba(216, 222, 226, 0.9);
}

.pn-public-nav-inner {
  width: min(1120px, 100% - 2rem);
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.pn-public-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #22303a;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(216, 222, 226, 0.8);
}

.pn-public-brand-mark {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #179b9a, #df7f2d);
}

.pn-public-back {
  text-decoration: none;
  color: #2d4a58;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  transition: all 0.2s ease;
}

.pn-public-back:hover {
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(35, 64, 80, 0.08);
}

.pn-public-nav a,
.pn-public-nav a:visited,
.pn-public-nav a:hover,
.pn-public-nav a:focus {
  text-decoration: none;
}

.pn-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 34px 16px 48px;
  display: grid;
  gap: 18px;
  width: 100%;
  flex: 1;
}

.pn-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.3vw, 2.3rem);
  color: var(--pn-primary-strong);
}

.pn-header p {
  margin: 6px 0 0;
  color: var(--pn-muted);
}

.pn-card {
  background: var(--pn-card);
  border: 1px solid var(--pn-border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(21, 50, 62, 0.08);
}

.pn-public-footer {
  border-top: 1px solid rgba(216, 222, 226, 0.86);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(6px);
}

.pn-public-footer-inner {
  width: min(1120px, 100% - 2rem);
  margin: 0 auto;
  padding: 14px 0 18px;
  color: var(--pn-muted);
  font-size: 0.86rem;
}

.pn-public-footer-inner p {
  margin: 0;
}

.pn-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.pn-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.pn-form input {
  border: 1px solid #bccddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.pn-form button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(120deg, #1caaa8, #168a89);
  color: #fff;
  cursor: pointer;
}

.pn-error {
  color: var(--pn-error);
  margin: 0 0 10px;
}

.pn-warning {
  color: #8a5a00;
  background: #fff4db;
  border: 1px solid #f0d498;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
}

.pn-qr-gate {
  background: var(--pn-card);
  border: 1px solid var(--pn-border);
  border-radius: 18px;
  padding: 40px 24px;
  box-shadow: 0 8px 24px rgba(21, 50, 62, 0.08);
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.pn-qr-gate-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.pn-qr-gate h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--pn-primary-strong);
}

.pn-qr-gate p {
  margin: 0;
  color: var(--pn-muted);
  font-size: 1rem;
}

.pn-qr-gate p.pn-error {
  color: var(--pn-error);
  font-size: 0.95rem;
}

.pn-qr-gate p.pn-warning {
  color: #8a5a00;
  background: #fff4db;
  border: 1px solid #f0d498;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.pn-qr-gate-form {
  display: grid;
  gap: 20px;
  justify-items: center;
  margin-top: 10px;
  width: 100%;
}

.pn-qr-gate-boxes {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.pn-qr-gate-box {
  width: 64px;
  height: 76px;
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  color: var(--pn-primary-strong);
  border: 2px solid var(--pn-border);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pn-qr-gate-box:focus {
  outline: none;
  border-color: var(--pn-primary);
  box-shadow: 0 0 0 4px rgba(23, 155, 154, 0.15);
}

.pn-qr-gate-submit {
  border: 0;
  border-radius: 10px;
  padding: 11px 28px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(120deg, #1caaa8, #168a89);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 480px) {
  .pn-qr-gate {
    padding: 32px 16px;
  }

  .pn-qr-gate-box {
    width: 52px;
    height: 64px;
    font-size: 1.8rem;
  }

  .pn-qr-gate-boxes {
    gap: 10px;
  }
}

.pn-meta {
  color: var(--pn-muted);
  margin-top: -6px;
}

.pn-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 8px;
}

.pn-kpi {
  border: 1px solid var(--pn-border);
  border-radius: 10px;
  padding: 10px 11px;
  display: grid;
  gap: 4px;
}

.pn-kpi span {
  color: var(--pn-muted);
  font-size: 12px;
}

.pn-kpi strong {
  font-size: 20px;
  line-height: 1.1;
  color: #204355;
}

.pn-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.pn-table th,
.pn-table td {
  border-bottom: 1px solid var(--pn-border);
  text-align: left;
  padding: 9px 8px;
}

.pn-table th {
  color: var(--pn-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pn-history {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.pn-history li {
  border-left: 3px solid #179b9a;
  padding-left: 9px;
  display: grid;
}

.pn-history span {
  color: var(--pn-muted);
  font-size: 12px;
}

.pn-qr-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  place-items: center;
}

.pn-qr-visual {
  display: flex;
  /* justify-content: center;
  align-items: center; */
}

.pn-qr-image {
  width: 200px;
  height: 200px;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--pn-border);
  box-shadow: 0 8px 24px rgba(21, 50, 62, 0.08);
}

.pn-qr-content {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 10px;
}

.pn-qr-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--pn-primary-strong);
}

.pn-qr-help {
  margin: 0;
  color: var(--pn-muted);
  line-height: 1.45;
}

.pn-qr-token {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pn-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pn-qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  background: linear-gradient(120deg, #1caaa8, #168a89);
  color: #fff;
}

.pn-qr-btn-secondary {
  background: #eff5fb;
  color: var(--pn-primary-strong);
  border: 1px solid var(--pn-border);
}

.pn-qr-url {
  font-size: 12px;
  color: var(--pn-muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 780px) {
  .pn-public-nav-inner {
    width: min(100%, calc(100% - 1rem));
    min-height: auto;
    padding: 0.5rem 0;
    align-items: center;
  }

  .pn-public-brand {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.95rem;
    padding: 0.3rem 0.6rem;
    gap: 0.5rem;
  }

  .pn-public-brand span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pn-public-back {
    font-size: 0.9rem;
    padding: 0.35rem 0.55rem;
    white-space: nowrap;
  }

  .pn-shell {
    padding: 20px 12px 28px;
  }

  .pn-card {
    padding: 14px;
    border-radius: 12px;
  }

  .pn-public-footer-inner {
    width: min(100%, calc(100% - 1rem));
    padding: 12px 0 14px;
    text-align: center;
  }

  .pn-qr-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pn-qr-visual, .pn-qr-content {
    justify-content: flex-start;
  }

  .pn-qr-image {
    width: min(220px, 100%);
    height: auto;
  }

  .pn-qr-help {
    font-size: 0.98rem;
  }

  .pn-qr-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .pn-qr-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1.02rem;
  }

  .pn-qr-url {
    margin-top: 2px;
    font-size: 0.84rem;
  }
}

@media (max-width: 560px) {
  .pn-public-nav-inner {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .pn-public-brand {
    order: 1;
    flex: 1 1 100%;
  }

  .pn-public-back {
    order: 2;
    margin-left: auto;
    font-size: 0.84rem;
  }

  .pn-qr-title {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .pn-qr-help {
    font-size: 0.95rem;
  }
}
