/* ── share-card ──
 * The rest of the share panel — head, QR, link, capacity meter, footer. Continues
 * share-overlay.css; see the note there for why install.css sits between them.
 * Linked from index.html in cascade order — the order is load-bearing. */

@keyframes share-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.share-head {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.share-head .t { font-size: 13px; color: color-mix(in srgb, var(--fg) 92%, white); font-weight: 500; }
.share-head .esc {
  margin-left: auto;
  font-size: 10px;
  color: var(--fg-faint);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
}

.share-body { display: flex; gap: 20px; padding: 18px; }
#share-qr {
  width: 148px;
  height: 148px;
  flex-shrink: 0;
  background: #eef2ee;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  place-items: center;
}
#share-qr img, #share-qr canvas { max-width: 100%; max-height: 100%; }
#share-qr .qr-too-big {
  font-size: 10px;
  color: #333;
  text-align: center;
  line-height: 1.5;
  padding: 6px;
}

.share-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#share-link {
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--bg-page);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 9px 11px;
  word-break: break-all;
  line-height: 1.5;
  max-height: 66px;
  overflow: hidden;
  position: relative;
}
#share-link .hl { color: var(--accent); }
#share-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18px;
  background: linear-gradient(transparent, var(--bg-page));
}

.share-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn {
  font-size: 12px;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s var(--ease), opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; opacity: 0.85; }
.btn.primary { background: var(--accent); color: var(--bg-page); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--fg-dim); border-color: var(--border); }

/* Expiry selector — a ghost button that's a <select>, with a custom caret. */
#share-ttl {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236f7478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
#share-ttl:hover { transform: none; color: var(--fg); }
#share-ttl:disabled { opacity: 0.4; cursor: not-allowed; }
#share-ttl option { background: var(--bg-raised); color: var(--fg); }

/* Full-screen state shown while opening / after an expired-or-missing tiny link. */
#tiny-state {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--bg-page);
  color: var(--fg-dim);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}
#tiny-state .ts-inner { display: grid; gap: 10px; }
#tiny-state a { color: var(--accent); text-decoration: none; font-size: 12px; }
#tiny-state a:hover { text-decoration: underline; }

.capacity { margin-top: auto; padding-top: 14px; }
.capacity .cap-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--fg-faint);
  margin-bottom: 5px;
}
.capacity .cap-row b { color: var(--fg-dim); font-weight: 400; }
.capacity .cap-bar {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  overflow: hidden;
  position: relative;
}
.capacity .cap-bar i {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
#share-card.amber .cap-bar i { background: var(--warn); }
#share-card.red .cap-bar i   { background: var(--danger); }

.share-foot {
  padding: 10px 18px 13px;
  border-top: 1px solid var(--border-soft);
  font-size: 10.5px;
  color: var(--fg-faint);
  display: flex;
  align-items: center;
}
.share-foot .ico { color: var(--accent); }
.share-foot i { color: var(--fg-dim); font-style: normal; }
