/* The share sheet uses the phone theme, and the read-only page uses the same palette. */
#phoneSurface #overlay .share-layer { align-items: flex-end; padding: 18px 12px 12px; }
#phoneSurface #overlay .share-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  padding: 14px 14px 12px;
  overflow: hidden;
}
#phoneSurface #overlay .share-sheet:focus { outline: none; }

.share-sheet [hidden] { display: none !important; }
.share-heading {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 38px;
}
#phoneSurface #overlay .share-heading h2 { grid-column: 2; margin: 0; text-align: center; font-size: 17px; }
.share-sheet .share-close {
  grid-column: 3;
  border-radius: 12px;
  color: var(--brand-ink);
}
.share-close:hover { background: var(--lavender); }
.share-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.share-choices { display: grid; gap: 10px; padding: 8px 3px 12px; }
.share-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  cursor: pointer;
}
.share-choice input {
  width: 18px;
  height: 18px;
  margin: 15px 0 0 1px;
  accent-color: var(--brand-purple);
  cursor: pointer;
}
.share-choice input:focus-visible { outline-offset: 2px; }
.share-chip {
  display: block;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--lavender-line);
  border-radius: 13px 13px 13px 3px;
  background: var(--lilac-paper);
}
.share-choice[data-role="user"] .share-chip {
  border-radius: 13px 13px 3px 13px;
  background: var(--lavender);
}
.share-choice input:checked + .share-chip { border-color: #c5b2e5; }
.share-speaker {
  display: block;
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 600;
}
.share-snippet {
  display: block;
  max-height: 8.5em;
  margin-top: 4px;
  overflow: auto;
  color: #49444d;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.share-image-preview { display: block; width: 100%; height: auto; border-radius: 12px; }
.share-sheet-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid var(--lavender-line);
}
#phoneSurface #overlay .share-sheet-footer p { margin: 0; font-size: 11px; line-height: 1.5; }
.share-sheet-footer [data-share-count] { font-weight: 600; }
.share-sheet-footer .share-note { color: #6a6173; }
.share-sheet-footer .share-status:empty { display: none; }
.share-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#phoneSurface #overlay .share-buttons .button {
  min-height: 42px;
  margin: 0;
  padding: 7px 8px;
}
.share-buttons .button:disabled { opacity: .48; cursor: default; }
.share-sheet [data-share-url] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--lavender-line);
  border-radius: 8px;
  color: #49444d;
}

.shared-conversation {
  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(155deg, #eee8fb, #fbf8ff 60%, #fdf2ed) fixed;
  color: #49444d;
  font: 15px/1.6 system-ui, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.shared-conversation *, .shared-conversation *::before, .shared-conversation *::after { box-sizing: inherit; }
.share-reader { width: min(100%, 540px); margin-inline: auto; padding: 28px 20px 36px; }
.share-reader-header { margin-bottom: 22px; }
.share-reader-header .share-brand { color: #60439a; font-size: 15px; font-weight: 700; }
.share-reader-header h1 { margin: 3px 0 4px; color: #3d314c; font-size: 25px; }
.share-reader-header p { margin: 0; color: #665b73; font-size: 13px; }
.share-reader-messages { display: grid; gap: 18px; }
.share-reader-entry { display: grid; min-width: 0; justify-items: start; }
.share-reader-entry[data-role="user"] { justify-items: end; }
.share-reader-entry h2 { margin: 0 3px 5px; color: #665b73; font-size: 12px; }
.share-reader-entry .share-bubble {
  max-width: 94%;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid #fff;
  border-radius: 15px 15px 15px 3px;
  background: #fffdfd;
  overflow-wrap: anywhere;
}
.share-reader-entry[data-role="user"] .share-bubble {
  border-color: transparent;
  border-radius: 15px 15px 3px 15px;
  background: #7552b5;
  color: #fff;
  white-space: pre-wrap;
}
.share-body > * { margin: 0; }
.share-body > * + * { margin-top: 8px; }
.share-body h3 { color: #40334b; font-size: 15px; }
.share-body a { color: #594675; }
.share-body :is(ul,ol) { padding-inline-start: 1.4em; }
.share-body pre { overflow-x: auto; padding: 6px 9px; background: #fbf8ff; }
.share-detail { color: #665b73; font-size: 13px; white-space: pre-wrap; }
.share-body + .share-detail { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e8dff2; }
