.reader-footer.reader-selection-ready {
  display: grid;
  padding-inline: max(12px, env(safe-area-inset-left, 0px), calc((100vw - 760px) / 2))
                  max(12px, env(safe-area-inset-right, 0px), calc((100vw - 760px) / 2));
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.reader-default-actions,
.reader-selection-actions {
  grid-area: 1 / 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  transition: opacity 220ms ease, transform 220ms ease;
}
.reader-selection-actions {
  opacity: 0;
  transform: translateY(4px);
}
.reader-footer.has-reader-selection .reader-selection-actions {
  opacity: 1;
  transform: translateY(0);
}
.reader-footer.has-reader-selection .reader-default-actions {
  opacity: 0;
  transform: translateY(-4px);
}
.reader-footer [inert] { pointer-events: none; }
.reader-footer .reader-selection-actions button {
  justify-content: center;
  min-height: 44px;
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  user-select: none;
}
.reader-footer .reader-selection-actions button[aria-pressed="true"] { font-weight: 700; }
.reader-footer .reader-selection-actions .icon { width: 17px; height: 17px; }
.reader-question-form { display: grid; gap: 8px; margin-bottom: 12px; }
.reader-question-form textarea { width: 100%; resize: vertical; }
.reader-question-form button { justify-self: end; min-height: 36px; padding: 0 16px; border-radius: 18px; background: var(--ink); color: white; }
.reader-selection-quote,
.reader-selection-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.reader-selection-quote { color: var(--muted); margin-bottom: 12px; max-height: 24vh; overflow: auto; }
.reader-selection-result { max-height: 38vh; overflow: auto; }
.excerpt-share-overlay{position:fixed;inset:0;z-index:150;background:#0005;isolation:isolate;color:#000;overscroll-behavior:none}
.excerpt-share-scroll{position:absolute;inset:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:1}
.excerpt-share-center{min-height:100%;padding:64px 20px 220px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.excerpt-share-card{display:block;width:100%;max-width:460px;height:auto;flex-shrink:0;background:#fff;box-shadow:0 12px 45px #0001}
.excerpt-share-close{position:absolute;top:max(14px,env(safe-area-inset-top));left:16px;z-index:3;width:36px;height:36px;border-radius:50%;background:#ffffffda;display:grid;place-items:center;backdrop-filter:blur(12px)}
.excerpt-share-close .icon{width:20px;height:20px}
.excerpt-share-tools{position:absolute;bottom:0;left:0;right:0;z-index:2;background:#eee;border-radius:20px 20px 0 0;padding:12px 18px max(28px,env(safe-area-inset-bottom));min-height:180px;box-shadow:0 -2px 20px #00000005}
.excerpt-share-handle{display:block;margin:0 auto 24px;width:34px;height:4px;background:#d6d6d6;border-radius:4px}
.excerpt-share-tools>div{display:flex;gap:22px;max-width:460px;margin:auto;justify-content:flex-start}
.excerpt-share-tools button{display:flex;flex-direction:column;align-items:center;gap:10px;font-size:12px;color:#777;white-space:nowrap}
.excerpt-share-tools button:disabled{cursor:default;opacity:1}
.excerpt-share-tools button>i{width:58px;height:58px;background:#fff;border-radius:50%;display:grid;place-items:center;color:#000}
.excerpt-share-tools .icon{width:25px;height:25px;stroke-width:1.5}
.paragraph-citation{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:18px;height:18px;margin-left:2px;border-radius:50%;background:#eee;color:#888;user-select:none}
.paragraph-citation .icon{width:11px;height:11px}
.citation-all{display:flex;gap:7px;align-items:center;color:#777;font-size:13px}
.citation-all .icon{width:17px;height:17px}
.citation-overlay{position:fixed;inset:0;z-index:160;background:#0003;display:flex;align-items:flex-end;justify-content:center;overscroll-behavior:none}
.citation-sheet{background:white;border-radius:22px 22px 0 0;width:100%;max-width:840px;max-height:80dvh;min-height:220px;display:flex;flex-direction:column;padding:10px 24px max(20px,env(safe-area-inset-bottom));overflow:hidden;color:#000}
.citation-handle{width:38px;height:4px;border-radius:8px;background:#d8d8d8;align-self:center;flex-shrink:0;margin-bottom:4px}
.citation-sheet>header{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:15px;padding:8px 0 10px;flex-shrink:0}
.citation-sheet>header button{display:grid;place-items:center;width:32px;height:32px;color:#888}
.citation-sheet>header>span{display:inline-flex;align-items:center;gap:5px}
.citation-sheet>header .icon{width:16px;height:16px;flex-shrink:0}
.citation-list{overflow-y:auto;overscroll-behavior:contain;min-height:0}
.citation-source{text-decoration:none;display:block;width:100%;padding:14px 0;text-align:left;border-bottom:1px solid #ddd;color:#000}
.citation-source:last-child{border-bottom:0}
.citation-source-meta{display:flex;gap:5px;align-items:center;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.citation-source-meta i{width:18px;height:18px;background:#ccc;border-radius:4px;flex-shrink:0;display:grid;place-items:center;font-size:10px;font-style:normal;color:white}
.citation-source-meta time{color:#777;font-size:11px;margin-left:auto}
.citation-source strong{display:block;font-size:16px;line-height:1.5;font-weight:700;margin-top:4px;overflow-wrap:anywhere}
.citation-source p{font-size:14px;line-height:1.55;margin-top:6px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
@media (prefers-reduced-motion: reduce) {
  .reader-default-actions, .reader-selection-actions { transition: none; }
}

/* Dismiss native text selection before sharing; prevent iOS callouts on the card. */
.excerpt-share-overlay,.excerpt-share-overlay *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

.citation-source-meta .citation-site-icon.has-favicon{background:transparent}.citation-source-meta .citation-site-icon img{display:block;width:18px;height:18px;object-fit:contain;border-radius:3px}

.citation-source-meta .citation-site-icon{background:transparent;color:#888}.citation-source-meta .citation-site-icon>.lucide-globe{width:18px;height:18px}
