/* Device Link — modal + toolbar button styling (Child C of #14, v0.9.0).
 *
 * Modal pattern mirrors styles-share.css's .modal-overlay / .modal-box
 * — same dark backdrop + centered card. The QR area is a fixed-square
 * white tile so qrcodejs's table-of-divs renders cleanly without
 * inheriting the dark surface colors.
 */

/* Modal — only displayed when .open is set (device-link.js toggles it).
   Inherits .modal-overlay / .modal-box base from styles-share.css for
   the dark backdrop + centered card. */
#device-link-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}
#device-link-overlay.open { display: flex; }

#device-link-overlay .modal-box {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: calc(100% - 32px);
  margin: 16px;
  font-size: var(--fs-base);
  line-height: 1.5;
}

#device-link-overlay h3 {
  margin: 0 0 8px;
  font-size: var(--fs-lg);
}

#device-link-overlay .device-link-help {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* QR — fixed white square so qrcodejs's <table> output renders with
   high contrast regardless of the user's color scheme. */
#device-link-qr {
  width: 224px;
  height: 224px;
  background: #fff;
  border-radius: var(--radius-sm);
  margin: 0 auto 16px;
  padding: 8px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* URL row — input + copy button on one line. */
#device-link-overlay .device-link-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
#device-link-overlay #device-link-url {
  flex: 1;
  padding: 6px 8px;
  background: var(--surface-hi);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-sm);
  min-width: 0;          /* allow flex shrink inside flex parent */
}

#device-link-copied {
  display: none;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--green, #4caf50);
  margin-bottom: 12px;
}
#device-link-copied.visible { display: block; }
