.success-preview #flips .section-head { opacity: 1; transform: none; }
.success-preview #flips { padding: 34px 0; }
.success-channel { position: relative; min-height: 0; }
.history-more { color: var(--text); background: var(--surface-3); border: 1px solid var(--border-br); border-radius: 7px; padding: 6px 9px; font: inherit; }
.history-status { color: var(--muted); font-size: 12px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.history-status:empty { display: none; }
.history-scroll { contain: size; min-height: 320px; flex: 1 1 0px; overflow-y: auto; scrollbar-gutter: stable; scrollbar-color: var(--border-br) var(--surface); }
.history-post { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.history-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); color: var(--ice); }
.history-avatar img { width: 100%; height: 100%; object-fit: cover; }
.history-byline { display: flex; align-items: baseline; gap: 3px 7px; flex-wrap: wrap; overflow-wrap: anywhere; }
.history-byline strong { font-size: 15px; }
.history-byline small, .history-byline time, .history-source { font-size: 11px; color: var(--muted); }
.history-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.history-attachments { margin-top: 7px; display: grid; gap: 5px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.history-attachments > :only-child { grid-column: 1/-1; }
.history-attachments img, .history-attachments video { display: block; width: auto; max-width: 100%; height: clamp(135px, 35vw, 210px); object-fit: contain; object-position: left center; border-radius: 6px; }
.history-attachments a { color: var(--ice); overflow-wrap: anywhere; font-size: 13px; }
.history-source { display: inline-block; margin-top: 5px; }
.history-more { display: block; margin: 12px auto; cursor: pointer; }
.history-more[hidden] { display: none; }
.win-notice { position: fixed; right: 16px; bottom: 16px; z-index: 10; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border-br); border-radius: 12px; box-shadow: 0 6px 22px #0006; padding: 5px; }
.win-notice[hidden] { display: none; }
.win-notice button { background: none; border: 0; padding: 7px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.win-notice button:first-child { overflow-wrap: anywhere; }
@media (max-width:680px) { .history-scroll { height: 430px; flex: none; } }

.history-cue {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  padding: 28px 10px 10px;
  background: linear-gradient(transparent, var(--surface) 95%);
  pointer-events: none;
}
.history-cue[hidden] { display: none; }
.history-cue button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border-br);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font: 600 13px/1.2 var(--font-body);
  box-shadow: 0 3px 12px #0005;
  cursor: pointer;
  pointer-events: auto;
}
.history-cue button::after {
  content: '';
  width: 7px;
  height: 7px;
  border: solid var(--ice);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.history-cue.is-playing button::after {
  width: 8px;
  height: 10px;
  border-width: 0 2px;
  transform: none;
}
.history-cue button:hover, .win-viewer-close:hover { border-color: var(--ice); }
.history-cue button:focus-visible, .win-viewer-close:focus-visible,
.history-attachments a[data-success-image]:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.history-attachments a[data-success-image] { width: fit-content; max-width: 100%; cursor: zoom-in; }

.win-viewer {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  color: #f5f7ff;
  padding: 64px 16px;
}
.win-viewer[open] { display: grid; place-items: center; }
.win-viewer::backdrop { background: rgb(3 5 10 / 92%); }
html:has(.win-viewer[open]) { overflow: hidden; }
.win-viewer figure { margin: 0; max-width: 100%; }
.win-viewer img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 165px);
  max-height: calc(100dvh - 165px);
  margin: auto;
  border-radius: 6px;
  box-shadow: 0 12px 50px #0008;
}
.win-viewer img[hidden] { display: none; }
.win-viewer figcaption { margin-top: 8px; text-align: center; color: #c1c9da; font-size: 14px; overflow-wrap: anywhere; }
.win-viewer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 1px solid #465067;
  border-radius: 50%;
  background: #161c29;
  color: white;
  font: 28px/1 var(--font-body);
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .win-viewer[open] figure { animation: viewer-in .16s ease-out; }
  @keyframes viewer-in {
    from { opacity: 0; transform: scale(.98); }
    to { opacity: 1; transform: scale(1); }
  }
}
