/* LabLife — sharing: the Share button in the top bar, the share sheet with its QR code,
 * and the "Open a shared calculation" sheet (camera scanner, paste box). */
.topbar-actions { display: flex; gap: 8px; }
@media (max-width: 400px) {
  #share-open span { display: none; }     /* icon only on phones, so the back button keeps its name */
  #share-open { padding: 0 13px; }
}

/* sheets: centred on wide screens, docked at the bottom on phones */
.sheet {
  width: min(460px, calc(100% - 24px)); max-height: calc(100% - 24px); margin: auto;
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--raised); color: var(--ink); box-shadow: var(--shadow), 0 0 40px rgb(142 69 220 / 18%);
  outline: 1px solid rgb(176 105 247 / 30%); outline-offset: -1px;
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: var(--backdrop); }
.sheet.no-modal { position: fixed; inset: auto 12px 12px; z-index: 70; }
@media (max-width: 560px) {
  .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0;
           padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.sheet-head h2 { font-size: 18px; font-weight: 600; }
.sheet-body { display: grid; gap: 14px; padding: 4px 16px 18px; }
.sheet-summary { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-actions .btn { flex: 1 1 auto; justify-content: center; }
.sheet label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* the QR code: always dark on white (scanners need it) */
.qr {
  width: min(260px, 100%); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center;
  background: #fff; border-radius: var(--radius-sm); padding: 4px;
}
.qr svg { width: 100%; height: 100%; display: block; }
.qr-wait { font-size: 13px; color: #535c6c; text-align: center; padding: 12px; }

.share-link, .paste-row input {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--well); color: var(--ink);
  font: inherit; font-size: 14px;
}
.share-link { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; text-overflow: ellipsis; }
.paste-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
@media (max-width: 380px) { .paste-row { grid-template-columns: 1fr 1fr; } .paste-row input { grid-column: 1 / -1; } }

/* camera preview while scanning */
.scan { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan::after {                     /* a frame to aim with */
  content: ""; position: absolute; inset: 18% 22%; border: 3px solid rgb(255 255 255 / 85%);
  border-radius: 12px; box-shadow: 0 0 0 999px rgb(0 0 0 / 25%);
}
.scan-msg { font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.scan-msg:empty { display: none; }
