/*
 * PayLink (/paylink.html create, /pay.html pay) — uses base.css's tokens only
 * (ink/line/red/fg/mono/etc), same convention as explorer.css: no new
 * palette, no new font, black/red only (base.css's own house rule — "no
 * gold"). Standalone pages, so nothing here assumes rooms.css is loaded.
 */

/* The native `hidden` attribute only wins the cascade against the UA
   stylesheet's low-specificity `[hidden]{display:none}` rule if nothing
   else sets `display` on the same element. Several classes here do
   (`.pl-row` is flex, `.btn` is inline-flex) which would otherwise make a
   toggled `hidden` element show up despite the attribute — pl.mjs/pay.mjs
   rely on `el.hidden = true/false` throughout, so this has to hold. */
[hidden] { display: none !important; }

.pl-page { padding-block: clamp(28px, 6vw, 56px); }
.pl-wrap { max-width: 560px; margin: 0 auto; padding-inline: var(--pad); }

.pl-card {
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(25, 17, 19, 0.92), rgba(11, 7, 8, 0.82));
  padding: 20px;
  margin-top: 16px;
}

.pl-card h2 {
  font: 500 11px/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 16px;
}

.pl-field {
  margin-bottom: 16px;
}

.pl-label {
  display: block;
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 8px;
}

.pl-input,
.pl-page select,
.pl-page textarea {
  width: 100%;
  min-height: 44px;
  font: 400 14px/1.4 var(--mono);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 12px 14px;
  outline-offset: 2px;
}

.pl-input::placeholder,
.pl-page textarea::placeholder {
  color: var(--fg-3);
}

.pl-input:focus-visible,
.pl-page select:focus-visible,
.pl-page textarea:focus-visible {
  border-color: var(--red-hi);
}

.pl-help {
  color: var(--fg-3);
  font-size: 12px;
  margin: 6px 0 0;
  line-height: 1.5;
}

.pl-error {
  color: #ff8a8a;
  background: rgba(196, 30, 58, 0.12);
  border: 1px solid rgba(196, 30, 58, 0.35);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
}

.pl-success {
  color: var(--ok);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
}

.pl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.pl-row:last-child {
  border-bottom: none;
}

.pl-row .k {
  color: var(--fg-3);
  font-size: 13px;
}

.pl-row .v {
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  text-align: right;
}

.pl-radio-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pl-radio-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}

.pl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pl-actions .btn {
  flex: 1 1 140px;
  justify-content: center;
}

.pl-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}

.pl-qr-plate {
  background: #ffffff;
  padding: 14px;
  border-radius: 11px;
  display: inline-flex;
  line-height: 0;
}

.pl-qr-plate canvas {
  display: block;
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.pl-qr-unavailable {
  color: var(--fg-3);
  font-size: 13px;
  text-align: center;
  padding: 24px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 11px;
}

.pl-link-box {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-link-box .pl-input {
  flex: 1 1 220px;
}

.pl-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--fg-3);
  margin-bottom: 14px;
}

.pl-status-pill.is-expired {
  color: #ff8a8a;
  border-color: rgba(196, 30, 58, 0.4);
}

.pl-status-pill.is-ok {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.3);
}

.pl-amount {
  font: 600 clamp(1.6rem, 6vw, 2.1rem)/1.1 var(--display);
  text-align: center;
  margin: 4px 0 2px;
}

.pl-memo-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-height: 44px;
}

@media (max-width: 480px) {
  .pl-qr-plate canvas {
    width: 190px;
    height: 190px;
  }
}
