/* Log popup only. Toolbar replaced by sidebar (see sidebar.css). Everything else comes from tailwind.css. */
.btn-theme { display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; line-height: 1; padding: 0 .45rem; }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; }
.theme-icon svg { display: block; }
.theme-icon--dark { display: none; }
html.dark .theme-icon--light { display: none; }
html.dark .theme-icon--dark { display: inline-block; }

/* alpha -> AlphaXiv link on arxiv cards: styled like the cluster/tag badges (no border) */
.btn-alpha {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; line-height: 1;
  padding: .18rem .4rem; border-radius: .125rem;
  border: 0; background: #fef3c7; color: #92400e;
  text-decoration: none; cursor: pointer;
}
.btn-alpha:hover { background: #fde68a; color: #78350f; }
html.dark .btn-alpha { background: rgba(245, 158, 11, .2); color: #fcd34d; }
html.dark .btn-alpha:hover { background: rgba(245, 158, 11, .32); color: #fde68a; }
#log-popup { position:fixed; right:1rem; bottom:1rem; z-index:9999; width:min(48rem,90vw); max-height:55vh;
  overflow:auto; white-space:pre-wrap; font-size:.75rem; padding:.75rem; border-radius:8px;
  background:#fff; color:#111; border:1px solid #a8a29e; box-shadow:0 4px 24px #0005; margin:0; }
html.dark #log-popup { background:#0f172a; color:#e2e8f0; border-color:#475569; }
#log-popup[hidden] { display:none; }

/* ---- story card flip: front = the story, back = ranker snapshot (append to server/public/app.css) ----
   Custom CSS on purpose: tailwind.css is prebuilt, so new utility classes in templates would not exist. */
.story-card { perspective: 1200px; }
.story-flip { display: grid; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.story-card.is-flipped .story-flip { transform: rotateY(180deg); }
/* both faces share one grid cell, so the card is as tall as the taller face */
.story-face { grid-area: 1 / 1; min-width: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.story-back { transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; gap: .5rem; font-size: .8125rem; }
.btn-flip { background: none; border: 0; padding: 0 .35rem; font: inherit; font-size: 1rem; line-height: 1;
  cursor: pointer; color: #78716c; opacity: .7; }
.btn-flip:hover, .btn-flip:focus-visible { opacity: 1; }
.btn-flip-back { align-self: flex-start; padding: .2rem 0; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; }
.back-grid { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.back-grid dt { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: #78716c; }
.back-grid dd { margin: 0; font-variant-numeric: tabular-nums; }
.back-medoid { font-style: italic; overflow-wrap: anywhere; }
.back-note { margin: 0; font-size: .75rem; font-style: italic; color: #78716c; }
.back-note:empty { display: none; }
html.dark .btn-flip, html.dark .back-grid dt, html.dark .back-note { color: #94a3b8; }
@media (prefers-reduced-motion: reduce) { .story-flip { transition: none; } }
