/* LinkedIn code scan. Paper, leather, and one ribbon action.
   Motion is transform and opacity only. */

.qr-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--ds-book-line, #ead8c8);
  background: var(--ds-book-card, #fffdfa);
  color: var(--ds-book-ink, #1d1a17);
  font: 600 15px/1.2 var(--ds-font-sans, "Inter Tight", sans-serif);
  cursor: pointer;
  transition: transform .12s cubic-bezier(.16, 1, .3, 1);
}
.qr-pill:active { transform: scale(.97); }
.qr-pill.is-primary {
  background: var(--ds-book-ribbon, #9b3d2a);
  border-color: var(--ds-book-ribbon, #9b3d2a);
  color: #fff;
}
.qr-pill[disabled] { opacity: .6; }
.qr-pill svg,
.qr-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.qr-meet {
  background: var(--ds-book-card, #fffdfa);
  border: 1px solid var(--ds-book-line, #ead8c8);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(60, 30, 20, .08), 0 4px 12px rgba(60, 30, 20, .08);
  padding: 16px;
  margin: 0 0 14px;
}
.qr-meet h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--ds-book-ink, #1d1a17);
}
.qr-meet p {
  margin: 4px 0 0;
  color: var(--ds-book-muted, #5c5148);
  font-size: 14px;
  line-height: 1.4;
}
.qr-meet-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.qr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ds-book-ribbon-soft, #f6e1d6);
  color: var(--ds-book-ribbon-hover, #7d3122);
}
.qr-count {
  color: var(--ds-book-muted, #5c5148);
  font-size: 14px;
}

.qr-root {
  position: fixed;
  inset: 0;
  /* Above the tour tip (1001) and the phone tab bar the tour lifts (1002).
     Under the opening book (1100). The tour also pauses while this is open,
     so the tip never sits on the paste control. */
  z-index: 1040;
  display: none;
}
.qr-root.is-on { display: block; }
.qr-cam {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--ds-book-on-leather, #f3ece2);
  background: radial-gradient(120% 80% at 50% 40%, #4a3d33 0%, #2a221d 55%, var(--ds-book-leather, #141210) 100%);
  padding-top: env(safe-area-inset-top);
}
.qr-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 4px;
  min-height: 52px;
}
.qr-top strong {
  font-weight: 600;
  font-size: 16px;
}
.qr-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(243, 236, 226, .14);
  color: var(--ds-book-on-leather, #f3ece2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .12s cubic-bezier(.16, 1, .3, 1);
}
.qr-round:active { transform: scale(.97); }
.qr-round.is-spacer { visibility: hidden; }

.qr-frame {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 70px auto 0;
}
.qr-cam.is-sheet .qr-frame { visibility: hidden; }
.qr-frame i {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ds-book-on-leather, #f3ece2);
}
.qr-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.qr-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.qr-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.qr-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.qr-video,
.qr-placeholder {
  position: absolute;
  inset: 38px;
  width: auto;
  height: auto;
  border-radius: 10px;
  opacity: .9;
}
.qr-placeholder {
  background: #f3ece2;
  padding: 14px;
  box-sizing: border-box;
}
.qr-video {
  object-fit: cover;
  background: transparent;
  opacity: 0;
}
.qr-cam.has-video .qr-video { opacity: 1; }
.qr-cam.has-video .qr-placeholder { opacity: 0; }
.qr-scanline {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 20px;
  height: 2px;
  background: var(--ds-book-ribbon-soft, #f6e1d6);
  opacity: .8;
  animation: qr-sweep 1.8s cubic-bezier(.16, 1, .3, 1) infinite alternate;
  will-change: transform;
}
@keyframes qr-sweep { to { transform: translateY(206px); } }
.qr-hint {
  text-align: center;
  margin: 28px 32px 0;
  font-size: 16px;
  line-height: 1.4;
}
.qr-hint small {
  display: block;
  color: #cbbfb2;
  font-size: 14px;
  margin-top: 6px;
  font-weight: 400;
}
.qr-foot {
  margin-top: auto;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}
.qr-tagging {
  color: #cbbfb2;
  font-size: 14px;
  margin-bottom: 10px;
}
.qr-tagging b { color: var(--ds-book-on-leather, #f3ece2); }
.qr-foot .qr-pill {
  background: rgba(243, 236, 226, .14);
  border-color: transparent;
  color: var(--ds-book-on-leather, #f3ece2);
}

.qr-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ds-book-paper, #fdf8f2);
  color: var(--ds-book-ink, #1d1a17);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(40, 24, 12, .25);
  transform: translateY(24px);
  opacity: 0;
  animation: qr-up .38s cubic-bezier(.16, 1, .3, 1) forwards;
}
.qr-sheet[hidden] { display: none; }
@keyframes qr-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.qr-grab {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--ds-book-line, #ead8c8);
  margin: 0 auto 14px;
}
.qr-person {
  display: flex;
  gap: 12px;
  align-items: center;
}
.qr-av {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ds-book-ribbon-soft, #f6e1d6);
  color: var(--ds-book-ribbon-hover, #7d3122);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  flex: none;
}
.qr-av.is-ok {
  background: var(--ds-bg-positive-tint, #f0fdf4);
  color: var(--ds-text-positive, #15803d);
}
.qr-name {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.15;
}
.qr-sub {
  font-size: 14px;
  color: var(--ds-book-muted, #5c5148);
  line-height: 1.35;
}
.qr-sub.is-url { font-size: 13px; }
.qr-field { margin-top: 14px; }
.qr-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.qr-optional { font-weight: 400; color: var(--ds-book-muted, #5c5148); }
.qr-input,
.qr-select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9c6b4;
  border-radius: 12px;
  background: var(--ds-book-card, #fffdfa);
  padding: 11px 14px;
  font: 16px/1.3 var(--ds-font-sans, "Inter Tight", sans-serif);
  color: var(--ds-book-ink, #1d1a17);
}
.qr-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ds-book-ink, #1d1a17) 50%),
    linear-gradient(135deg, var(--ds-book-ink, #1d1a17) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.qr-note {
  font-size: 13px;
  color: var(--ds-book-muted, #5c5148);
  margin: 12px 0 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.qr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 8px;
}
.qr-link {
  background: none;
  border: 0;
  font: 500 15px/1.2 var(--ds-font-sans, "Inter Tight", sans-serif);
  color: var(--ds-book-muted, #5c5148);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
  padding: 0 8px;
  cursor: pointer;
}
.qr-actions .qr-pill { flex: 1; max-width: 230px; }
.qr-warn {
  background: var(--ds-book-draft, #fbf1e8);
  border: 1px solid var(--ds-book-line, #ead8c8);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  margin-top: 12px;
  line-height: 1.4;
}
.qr-waiting {
  margin-top: 16px;
  background: var(--ds-book-draft, #fbf1e8);
  border: 1px solid var(--ds-book-line, #ead8c8);
  border-radius: 16px;
  padding: 14px 16px;
}
.qr-lab {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ds-book-muted, #5c5148);
  text-transform: uppercase;
}
.qr-waiting .qr-card-title { margin-top: 6px; font-size: 15px; }
.qr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.qr-root :focus-visible,
.qr-pill:focus-visible,
.qr-link:focus-visible {
  outline: 2px solid var(--ds-book-ribbon, #9b3d2a);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .td-top:has(#qr-scan-open) { position: relative; }
  #qr-scan-open {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
  }
  .td-top:has(#qr-scan-open) .td-date { padding-right: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .qr-scanline { animation: none; opacity: .5; }
  .qr-sheet { animation: none; transform: none; opacity: 1; }
  .qr-pill, .qr-round { transition: none; }
}
