/* Takes (docs/ARCHITECTURE.md §21): a take's upright preview in lists; the Takes page, one
   take at a time (full screen on a phone, a column beside its buttons on a computer); polls
   between takes, their results and their split; the panels for replies. */

/* ─── A take in a list ───────────────────────────────────────────────────── */

/* Upright, a little shorter than the video (4:5), at most a column's width: it opens Takes. */
.media-take {
  position: relative;
  display: block;
  width: min(100%, 22rem);
  aspect-ratio: 4 / 5;
  max-height: min(34rem, 75vh);
  border: 0;
  background: #000;
  cursor: pointer;
}
.post-detail .media-take { width: min(100%, 26rem); }
.media-take .take-poster,
.take-preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.take-preview-video { opacity: 0; transition: opacity 0.3s; }
.media-take.is-playing .take-preview-video { opacity: 1; }
.media-take::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.45), transparent 32%), linear-gradient(to bottom, rgb(0 0 0 / 0.3), transparent 22%);
  pointer-events: none;
}
.take-badge, .take-time {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}
.take-badge { top: 0.625rem; left: 0.75rem; }
.take-badge .icon { filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5)); }
.take-time { right: 0.75rem; bottom: 0.625rem; }
.media-take:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ─── The page ───────────────────────────────────────────────────────────── */

/* A phone gives Takes the whole screen above the bottom bar: no top bar, no footer. */
body:has(.takes) .site-footer { display: none; }
.main:has(> .takes) { padding-bottom: 0; }
@media (max-width: 39.99rem) {
  body:has(.takes) .topbar { display: none; }
}

.takes {
  --takes-ink: #fff;
  position: relative;
  height: var(--takes-h, calc(100dvh - 4rem));
  overflow: hidden;
  background: #000;
  color: var(--takes-ink);
}
.takes-stage {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
}
.takes-stage::-webkit-scrollbar { display: none; }

.take {
  position: relative;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Over the takes: what this is, and the sound. */
.takes-top {
  pointer-events: none;
  position: absolute;
  top: 0;
  inset-inline: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.5rem 1rem;
}
.takes-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.45);
}
.takes-top-end { display: flex; align-items: center; gap: 0.5rem; }
/* Through a post's retakes: whose they are, and the way back to the post. */
.takes-title.is-scoped { pointer-events: auto; gap: 0.5rem; font-family: var(--font-sans); font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.takes-title.is-scoped strong { font-weight: 700; }
.takes-title.is-scoped:hover strong { text-decoration: underline; }
/* Over a poll (on the page's own colours), the title is ink. */
.takes:has(.take.is-current.is-poll, .take-tail:only-child) .takes-title { color: var(--ink); text-shadow: none; }
.takes-sound {
  pointer-events: auto;
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  place-items: center;
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.35);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.takes-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.takes-sound-hint {
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.5);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  animation: bt-fade-in 0.3s both;
}
.takes-sound-hint[hidden] { display: none; }

/* On a computer: arrows to the previous and next take. */
.takes-nav { display: none; }

/* ─── A take ─────────────────────────────────────────────────────────────── */

/* What's drawn over the picture is white in either theme (a poll's frame is on the page's colours). */
.take-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--take-color, #000);
  color: #fff;
}
.take-backdrop {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(28px) brightness(0.55);
  opacity: 0;
}
.take-frame[data-fit='contain'] .take-backdrop { opacity: 1; }
.take-poster,
.take-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.take-frame[data-fit='contain'] .take-poster,
.take-frame[data-fit='contain'] .take-video { object-fit: contain; }
.take-slot { position: absolute; inset: 0; }
/* Shade where the words and buttons are, so they read over any picture. */
.take-shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(0 0 0 / 0.6) 0%, rgb(0 0 0 / 0.22) 26%, transparent 46%),
    linear-gradient(to bottom, rgb(0 0 0 / 0.28), transparent 18%);
}
.take-tap {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.take-tap:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
/* A moment's play or pause in the middle, and a take that stopped says so. */
.take-flash {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  height: 5rem;
  width: 5rem;
  place-items: center;
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.35);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}
.take-flash.is-on { animation: take-flash 0.7s ease-out both; }
.take.is-paused .take-flash:not(.is-on) { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
@keyframes take-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}
/* Loading after the poster: a quiet ring in the middle. */
.take.is-waiting.is-current .take-slot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  height: 2.5rem;
  width: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border-radius: 9999px;
  border: 3px solid rgb(255 255 255 / 0.25);
  border-top-color: #fff;
  animation: bt-spin 0.8s linear infinite;
}
/* Two taps: a thumb rising where they landed. */
.take-burst {
  pointer-events: none;
  position: absolute;
  z-index: 4;
  color: #fff;
  filter: drop-shadow(0 4px 12px rgb(0 0 0 / 0.35));
  transform: translate(-50%, -50%);
  animation: take-burst 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes take-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-12deg); }
  25% { opacity: 1; transform: translate(-50%, -60%) scale(1.1) rotate(0deg); }
  70% { opacity: 1; transform: translate(-50%, -85%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(0.9); }
}

/* Who posted it and what it says, at the bottom left. */
.take-info {
  position: absolute;
  left: 0;
  right: 4.5rem;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 1rem 0.5rem 1.375rem 1rem;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.55);
}
.take-info.is-open { max-height: 70%; overflow-y: auto; background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.35)); border-top-right-radius: 1rem; }
.take-spread { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; opacity: 0.9; }
.take-author { display: inline-flex; max-width: 100%; align-items: center; gap: 0.5rem; font-weight: 700; }
.take-author .avatar { box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.85); }
.take-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-handle { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; opacity: 0.8; }
.take-author:hover .take-name { text-decoration: underline; }
.take-text {
  display: -webkit-box;
  max-width: 34rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.9375rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: inherit;
}
.take-text a { font-weight: 600; }
.take-text a.tag, .take-text a.mention { color: inherit; }
.take-info.is-open .take-text { display: block; -webkit-line-clamp: unset; }
.take-more { font-size: 0.875rem; font-weight: 700; opacity: 0.9; }
/* What a retake retakes, above who posted it: small, on frosted glass, a link to it. */
.take-quote {
  display: flex;
  max-width: min(100%, 21rem);
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
  border-radius: 0.875rem;
  padding: 0.375rem 0.875rem 0.375rem 0.375rem;
  background: rgb(0 0 0 / 0.36);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
  text-shadow: none;
  transition: background-color 0.15s;
}
.take-quote:hover { background: rgb(0 0 0 / 0.5); }
.take-quote:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.take-quote-thumb { position: relative; display: grid; flex-shrink: 0; place-items: center; width: 2.75rem; height: 2.75rem; overflow: hidden; border-radius: 0.5rem; background: rgb(255 255 255 / 0.14); }
.take-quote-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.take-quote-thumb.is-face { background: none; }
.take-quote-thumb.is-covered { background-image: linear-gradient(rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.35)); }
.take-quote-play { position: absolute; right: 0.1875rem; bottom: 0.1875rem; display: grid; place-items: center; width: 1.125rem; height: 1.125rem; border-radius: 9999px; background: rgb(0 0 0 / 0.6); }
.take-quote-main { display: flex; min-width: 0; flex-direction: column; gap: 0.0625rem; }
.take-quote-kicker { display: flex; min-width: 0; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 500; opacity: 0.88; }
.take-quote-kicker .icon { flex-shrink: 0; }
.take-quote-kicker > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-quote-kicker strong { font-weight: 700; }
.take-quote-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 500; }
.take-quote.is-gone { display: inline-flex; gap: 0.375rem; padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-style: italic; }
.take-more[hidden] { display: none; }

/* The bar along the bottom: how far it has played; drag it to move through. */
.take-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 3;
  height: 0.875rem;
  cursor: pointer;
  touch-action: none;
}
.take-progress::before, .take-progress-fill {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: rgb(255 255 255 / 0.25);
  transition: height 0.15s;
}
.take-progress-fill { display: block; background: #fff; transform: scaleX(0); transform-origin: left center; }
.take-progress:hover::before, .take-progress:hover .take-progress-fill,
.take-progress.is-seeking::before, .take-progress.is-seeking .take-progress-fill { height: 5px; }

/* ─── The buttons down the side ──────────────────────────────────────────── */

.take-rail {
  position: absolute;
  right: 0.375rem;
  bottom: 4.5rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}
.take-rail form { display: contents; }
.take-btn {
  position: relative;
  display: flex;
  min-width: 3.5rem;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  border-radius: 1rem;
  padding: 0.25rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.55);
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.take-btn::-webkit-details-marker { display: none; }
.take-btn .icon, .take-btn .helix { filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.45)); transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.take-btn:active .icon, .take-btn:active .helix { transform: scale(0.88); }
/* A like or dislike has its own move (`components/thumb.js`). */
.take-btn.is-active .icon:not(.thumb) { animation: take-pop 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.take-btn:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
.take-btn-count { min-height: 1rem; line-height: 1rem; }
@keyframes take-pop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
/* The split's helix, larger: it twists while hovered, faint until the split is in. */
.take-split .helix { width: 36px; height: 30px; }
.take-split:hover .helix-flow, .take-split:focus-visible .helix-flow, .take-split.is-open .helix-flow { animation: helix-flow 1.6s linear infinite; }
.take-split.is-crunching .helix-flow { animation: helix-flow 3.2s linear infinite; }
.take-split.is-notable::after {
  content: '';
  position: absolute;
  top: 0.4rem;
  right: 0.85rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgb(0 0 0 / 0.3);
}
.take-btn-more { min-width: 2.5rem; padding-block: 0; }
/* The menus open to the left of the buttons. */
.take-spread-menu, .take-share, .take-menu { position: relative; }
.take-popup { top: auto; right: calc(100% + 0.5rem); bottom: 0; color: var(--ink); text-shadow: none; }

/* ─── A poll ─────────────────────────────────────────────────────────────── */

/* Over a video: its options under its words. */
.take-options { display: flex; width: 100%; max-width: 26rem; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.take-option {
  display: flex;
  min-height: 3rem;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.875rem;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  text-shadow: none;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.take-option:hover { box-shadow: inset 0 0 0 2px var(--ink-2); }
.take-option:active { transform: scale(0.98); }
.take-option:disabled { opacity: 0.7; }
.take-option-dot { height: 0.75rem; width: 0.75rem; flex-shrink: 0; border-radius: 9999px; }
.take-option-image { height: 2.5rem; width: 2.5rem; flex-shrink: 0; border-radius: 0.5rem; object-fit: cover; }
.take-option-label { overflow-wrap: anywhere; }
.take-options.is-over .take-option {
  background: rgb(0 0 0 / 0.35);
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.take-options.is-over .take-option:hover { box-shadow: inset 0 0 0 2px #fff; }

/* The results: each option's share, its bar growing in when they've just come. */
.take-results { display: flex; width: 100%; max-width: 26rem; flex-direction: column; gap: 0.5rem; margin: 0.25rem 0 0; padding: 0; list-style: none; }
.take-result {
  position: relative;
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: hidden;
  border-radius: 0.875rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink);
  text-shadow: none;
}
.take-result-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: color-mix(in oklab, var(--c) 28%, transparent);
  box-shadow: inset 3px 0 0 var(--c);
  transform-origin: left center;
}
.take-result.is-mine .take-result-bar { background: color-mix(in oklab, var(--c) 40%, transparent); }
.take-result-label, .take-result-share { position: relative; }
.take-result-label { display: inline-flex; align-items: center; gap: 0.375rem; overflow-wrap: anywhere; }
.take-result-you { display: inline-flex; }
.take-result-share { font-variant-numeric: tabular-nums; }
.take-results.is-growing .take-result-bar { animation: bt-grow-x 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms); }
.take-results.is-growing .take-result-share { animation: bt-fade-up 0.5s both; animation-delay: calc(300ms + var(--i) * 70ms); }
.take-results.is-over .take-result {
  background: rgb(0 0 0 / 0.38);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Between takes: a poll on its own colours, scrolling within when its split is in. */
.take-poll-frame {
  background:
    radial-gradient(120% 70% at 0% 0%, color-mix(in oklab, var(--s1) 22%, transparent), transparent 60%),
    radial-gradient(120% 70% at 100% 100%, color-mix(in oklab, var(--s2) 22%, transparent), transparent 60%),
    var(--page);
  color: var(--ink);
}
.take-poll-scroll { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.take-poll {
  display: flex;
  min-height: 100%;
  max-width: 36rem;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 4.5rem 5rem 2rem 1.25rem;
}
.take-poll-kicker { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.take-poll .take-author { color: var(--ink); font-weight: 600; }
.take-poll .take-author .avatar { box-shadow: none; }
.take-poll-question {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5.5vw, 2.125rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.take-poll-picture { width: 100%; max-height: 30vh; border-radius: 1rem; object-fit: cover; }
.take-poll .take-options, .take-poll .take-results { max-width: none; }
.take-poll-note { font-size: 0.8125rem; color: var(--muted); }
.take-peek { align-self: flex-start; }
.take-poll-split:empty { display: none; }
.take-poll-split.is-in { animation: take-rise 0.6s cubic-bezier(0.2, 0.85, 0.25, 1) both; }
.take-split-loading { display: grid; place-items: center; padding: 2rem 0; color: var(--muted); }
@keyframes take-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
/* On a poll the buttons are on its colours, not a picture. */
.take.is-poll .take-btn { color: var(--ink); text-shadow: none; }
.take.is-poll .take-btn .icon, .take.is-poll .take-btn .helix { filter: none; }
.take.is-poll .take-split.is-notable::after { background: var(--ink); box-shadow: 0 0 0 2px var(--page); }

/* ─── The end ────────────────────────────────────────────────────────────── */

.take-tail { display: grid; place-items: center; background: var(--page); color: var(--ink); }
.take-tail[hidden] { display: none; }
.take-tail-loading { color: #fff; }
.takes .take-tail-loading { color: var(--muted); }
.take-end { display: flex; max-width: 22rem; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 1.5rem; text-align: center; }
.take-end-title { margin-top: 0.5rem; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.take-end-text { color: var(--muted); }
.take-end .button-row { margin-top: 1rem; justify-content: center; }

/* ─── On a computer: the take as a column, its buttons beside it ─────────── */

@media (min-width: 40rem) {
  .takes { height: var(--takes-h, calc(100dvh - 3.5rem)); background: var(--page); color: var(--ink); }
  .takes-top { justify-content: flex-end; padding: 1rem 1.25rem; }
  .takes-title { display: none; }
  .takes-top:has(.takes-title.is-scoped) { justify-content: space-between; }
  .takes-title.is-scoped { display: inline-flex; color: var(--ink); text-shadow: none; }
  .takes-sound { background: var(--surface-2); color: var(--ink); }
  .takes-sound:focus-visible { outline-color: var(--focus); }
  .takes-sound-hint { background: var(--ink); color: var(--surface); }
  .takes-nav { position: absolute; right: 1.25rem; top: 50%; z-index: 6; display: flex; flex-direction: column; gap: 0.75rem; transform: translateY(-50%); }
  .takes-nav-btn { height: 2.75rem; width: 2.75rem; background: var(--surface-2); }
  .takes-nav-btn:disabled { opacity: 0.35; }
  .take { display: flex; align-items: flex-end; justify-content: center; gap: 0.75rem; padding: 1rem 0; }
  .take-frame { position: relative; inset: auto; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 12rem); border-radius: 1rem; box-shadow: var(--shadow-xl); }
  .take-poll-frame { aspect-ratio: auto; width: min(36rem, calc(100vw - 12rem)); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
  .take-poll { padding: 2.5rem 1.75rem 2rem; }
  .take-rail { position: static; padding-bottom: 0.5rem; }
  .take.is-video .take-btn { color: var(--ink); text-shadow: none; }
  .take.is-video .take-btn .icon, .take.is-video .take-btn .helix { filter: none; }
  .take-btn .icon { padding: 0.5rem; box-sizing: content-box; border-radius: 9999px; background: var(--surface-2); transition: background-color 0.15s, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .take-btn:hover .icon { background: var(--surface-3); }
  .take-split .helix { padding: 0.375rem 0.25rem; border-radius: 9999px; background: var(--surface-2); }
  .take-btn-more .icon { padding: 0.375rem; }
  .take.is-video .take-split.is-notable::after, .take.is-poll .take-split.is-notable::after { background: var(--ink); box-shadow: 0 0 0 2px var(--page); }
  .take-info { right: 0; }
}

/* ─── Replies over a take ────────────────────────────────────────────────── */

.takes-layer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
}
.takes-layer::backdrop { background: rgb(0 0 0 / 0.38); animation: bt-fade-in 0.25s both; }
.takes-layer.is-thread::backdrop { background: rgb(0 0 0 / 0.5); }
.takes-layer-box {
  display: flex;
  height: 100%;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-2xl);
}
/* A sheet rising from the bottom, three quarters of the screen. */
.takes-layer.is-sheet .takes-layer-box {
  position: absolute;
  inset: auto 0 0;
  height: min(78dvh, 48rem);
  border-radius: 1.375rem 1.375rem 0 0;
}
.takes-layer-head {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding: 0.875rem 0.75rem 0.625rem;
  touch-action: none;
}
.takes-layer.is-thread .takes-layer-head { padding-left: 0.5rem; padding-top: max(0.625rem, env(safe-area-inset-top)); }
.takes-layer-grip { position: absolute; top: 0.375rem; left: 50%; height: 0.25rem; width: 2.5rem; margin-left: -1.25rem; border-radius: 9999px; background: var(--line-strong); }
/* Its two tabs: Replies and Retakes, each with its count. */
.takes-layer-tabs { display: flex; min-width: 0; flex: 1; gap: 0.25rem; }
.takes-layer-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.takes-layer-tab:hover { color: var(--ink); }
.takes-layer-tab.is-selected { background: var(--surface-2); color: var(--ink); }
.takes-layer-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.takes-layer-tab-count { font-weight: 500; color: var(--muted); }
.takes-layer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.takes-layer-loading { display: grid; place-items: center; gap: 0.75rem; padding: 3rem 1rem; text-align: center; color: var(--muted); }
.replies-pane { display: flex; min-height: 100%; flex-direction: column; }
.replies-pane-head { padding: 0.75rem 1rem 0; }
.replies-pane-count { display: none; }
.takes-layer.is-thread .replies-pane-count { display: block; padding: 0.75rem 1rem 0.25rem; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.replies-pane .replies-list { flex: 1; border-top: 0; padding: 0 1rem; }
/* A reply in the panel: compact, its buttons on one row, the split at the end of it. */
.post-compact { padding: 0.75rem 0; }
.post-compact .post-body { margin-top: 0.375rem; font-size: 1rem; line-height: 1.45; }
.post-compact .post-actions { margin-top: 0.375rem; flex-wrap: nowrap; gap: 0.125rem; }
.post-compact .pill { height: 2rem; padding: 0 0.5rem; }
.post-compact .split-pill { padding: 0 0.5rem 0 0.375rem; }
/* The reply opened over everything reads a little larger. */
.replies-pane-head .post-compact { border-bottom: 0; padding-top: 0.25rem; }
.replies-pane-head .post-compact .post-body { font-size: 1.1875rem; }
.replies-pane:has(> .replies-empty) .replies-list { flex: 0; }
.replies-pane .replies-empty { display: grid; flex: 1; place-items: center; padding: 1.5rem 1rem; text-align: center; }
/* The box to reply stays at the bottom while the replies scroll. */
.replies-pane-compose {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0.625rem 0.75rem max(0.625rem, env(safe-area-inset-bottom));
}
/* Its corners concentric with the button tucked into them: the button's radius plus the padding. */
.replies-pane-compose .composer { margin: 0; box-shadow: none; padding: 0.5rem 0.5rem 0.5rem 0.75rem; background: none; border-radius: 1.5rem; }
/* Docked (with the script): one line to write in across the width; the tools, the count and the
   button rise into place under it while writing. */
.composer.is-dock:not(.is-writing) .composer-bar { display: none; }
.composer.is-dock .composer-submit { transition: opacity 0.12s; }
.composer.is-dock .composer-submit.is-idle { opacity: 0.4; }
.composer.is-dock.is-writing .composer-bar { animation: composer-bar-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes composer-bar-in { from { opacity: 0; transform: translateY(0.625rem); } }
.replies-pane-compose .reply-signin { padding: 0.25rem 0.5rem; }
/* A post's retakes in the panel, and the button to post one at the bottom. */
.retakes-pane .retakes-list { flex: 1; padding: 0.75rem 1rem; }
.retakes-pane:has(> .replies-empty) .retakes-list { flex: 0; padding: 0; }
.retakes-pane-foot { display: flex; justify-content: center; }
.retakes-post { width: 100%; gap: 0.5rem; }

@media (min-width: 40rem) {
  /* A column at the side on a computer, the take still in view beside it. */
  .takes-layer.is-sheet .takes-layer-box { inset: 0 0 0 auto; height: 100%; width: min(28rem, 100vw); border-radius: 0; }
  .takes-layer.is-sheet .takes-layer-grip { display: none; }
  .takes-layer.is-sheet::backdrop { background: rgb(0 0 0 / 0.18); }
  .takes-layer.is-thread .takes-layer-box { margin: 0 auto; max-width: 42rem; }
}

@media (prefers-reduced-motion: reduce) {
  .take-flash.is-on, .take-burst, .take-poll-split.is-in, .take-btn.is-active .icon:not(.thumb) { animation: none; }
  .composer.is-dock.is-writing .composer-bar { animation: none; }
  .take-results.is-growing .take-result-bar, .take-results.is-growing .take-result-share { animation: none; }
  .take-preview-video, .take-progress::before, .take-progress-fill { transition: none; }
}
