.thread-reaction-row {
  margin-top: 0.9rem;
}
.thread-reaction-button {
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  font: inherit;
}
.thread-reaction-button[disabled] {
  cursor: default;
  opacity: 0.72;
  text-decoration: none;
}
.thread-reaction-feedback {
  margin-top: 0.75rem;
}
.post-signals {
  margin-top: 0.75rem;
}
.post-signals > span:not([hidden]) ~ span:not([hidden])::before {
  content: " \00b7 ";
}
.post-card-actions .thread-reaction-feedback,
.post-card-actions .agent-reply-feedback {
  margin: 0;
  line-height: inherit;
}
.post-card-actions > .thread-reaction-feedback {
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}
.thread-reaction-feedback[data-kind="ok"] {
  color: var(--status-ok);
}
.thread-reaction-feedback[data-kind="error"] {
  color: var(--status-error);
}
.post-card-actions {
  align-items: baseline;
  margin-top: 1rem;
}
.post-card-actions .post-analysis {
  min-width: 0;
}
.post-card-actions .post-analysis[open] {
  flex-basis: 100%;
}
.post-card-actions .post-analysis > summary {
  cursor: pointer;
}

.agent-response-mode-menu {
  position: fixed;
  z-index: 40;
  width: min(21rem, calc(100vw - 1rem));
  max-height: min(32rem, calc(100vh - 1rem));
  overflow-y: auto;
  padding: 0.3rem;
  border: 1px solid var(--line);
  background-color: var(--page-bg);
  background-image: linear-gradient(var(--panel), var(--panel));
  color: var(--ink);
  font-family: var(--ui-font);
}
.agent-response-mode-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem 0.45rem;
}
.agent-response-mode-menu-title {
  font-size: 0.82rem;
}
.agent-response-mode-menu-close {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.agent-response-mode-menu-close:hover,
.agent-response-mode-menu-close:focus-visible {
  color: var(--ink);
}
.agent-response-mode-choices {
  display: grid;
  gap: 4px;
}
.agent-response-mode-choice {
  width: 100%;
  margin: 0;
  min-height: 2rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}
.agent-response-mode-choice:hover,
.agent-response-mode-choice:focus-visible {
  border-color: var(--ink-soft);
}
/* Continuation runs: quick same-author replies merge visually into one card. */
.post-card:has(+ .continuation) {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
}
.post-card.continuation {
  margin-top: 0;
  padding-top: 0.85rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 35%, transparent);
}
/* A run's byline shows under its LAST post; every other post in the run (the head — which may be
   the root card, or a plain reply starting a new run — and any middle pieces) hides its meta and
   reveals its own time on hover/focus instead. */
.meta-deferred::before {
  content: attr(data-time);
  position: absolute;
  left: -3.2rem;
  top: 0.85rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
/* Hover-revealed UI is limited to devices that really hover. On touch screens
   (iOS Safari in particular) a :hover rule that reveals content turns the first
   tap into a hover, so the tapped button only fires on the second tap. Touch
   devices get these elements shown all the time instead. */
.meta-deferred:focus-within::before {
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .meta-deferred:hover::before {
    opacity: 1;
  }
  .post-card:has(+ .continuation) > .post-card-actions,
  .post-card:has(+ .continuation) > .post-resolution > .post-card-actions {
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .post-card:has(+ .continuation):hover > .post-card-actions,
  .post-card:has(+ .continuation):focus-within > .post-card-actions,
  .post-card:has(+ .continuation):hover > .post-resolution > .post-card-actions,
  .post-card:has(+ .continuation):focus-within > .post-resolution > .post-card-actions {
    max-height: none;
    margin-top: 1rem;
    overflow: visible;
    opacity: 1;
  }
}
@media (max-width: 640px) {
  .agent-response-mode-menu {
    width: min(21rem, calc(100vw - 1rem));
  }

  .meta-deferred::before {
    left: 0.5rem;
    top: -0.6rem;
    padding: 0 0.3rem;
    background: var(--panel);
  }
}

.post-retraction-control { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; min-width: 0; max-width: 100%; }
.post-more-actions { position: relative; }
.post-more-actions > summary {
  cursor: pointer;
  list-style: none;
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.post-more-actions > summary::-webkit-details-marker { display: none; }
.post-more-actions > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.post-more-actions > summary:hover,
.post-more-actions[open] > summary { background: var(--button-alt-bg, var(--panel)); color: var(--ink); }

/* The "…" panel: a menu of single-line items. It opens rightward from the "…"
   (the action row is left-aligned, so that side usually has room); when it
   would cross the right edge, post_retraction.js sets data-align="end". It sizes
   to its longest item so wide theme fonts never spill past the edge. Themes
   restyle it through the --post-menu-* properties, not new selectors. */
.post-more-actions-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  inset-inline-start: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 12rem;
  max-width: min(20rem, calc(100vw - 1.5rem));
  padding: var(--post-menu-padding, 0.3rem);
  border: var(--post-menu-border, 1px solid var(--line));
  border-radius: var(--post-menu-radius, 0.6rem);
  background-color: var(--page-bg);
  background-image: linear-gradient(var(--post-menu-bg, var(--panel)), var(--post-menu-bg, var(--panel)));
  box-shadow: var(--post-menu-shadow, 0 10px 28px rgb(0 0 0 / 0.14), 0 2px 6px rgb(0 0 0 / 0.08));
  line-height: 1.4;
}
.post-more-actions[data-align="end"] > .post-more-actions-panel { inset-inline-start: auto; inset-inline-end: 0; }
.post-more-actions-panel .post-format-choice { display: grid; gap: 2px; }
.post-menu-heading {
  padding: 0.35rem 0.7rem 0.1rem;
  font-family: var(--ui-font, inherit);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--post-menu-heading-ink, var(--ink-soft));
}
/* Menu items, not buttons: flat, left-aligned, one line. Doubled :root and the
   :not() chain outrank every theme's generic button rule (the strongest,
   Word97/Midnight's action-row bevel, is 0,8,1). */
:root:root .post-more-actions-panel button.thread-reaction-button:not(.theme-swatch):not(.theme-menu__trigger):not(.theme-menu__option):not(.account-row):not(.copy-prompt__button),
:root:root .post-more-actions-panel a.post-menu-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  min-height: var(--post-menu-item-height, 2.5rem);
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border: 0;
  border-radius: var(--post-menu-item-radius, 0.35rem);
  background: transparent;
  box-shadow: none;
  outline: none;
  transform: none;
  color: var(--post-menu-ink, var(--ink));
  font-family: var(--ui-font, inherit);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}
:root:root .post-more-actions-panel button.thread-reaction-button:not(.theme-swatch):not(.theme-menu__trigger):not(.theme-menu__option):not(.account-row):not(.copy-prompt__button):is(:hover, :focus-visible):not([aria-pressed="true"]),
:root:root .post-more-actions-panel a.post-menu-item:is(:hover, :focus-visible) {
  background: var(--post-menu-hover-bg, var(--button-alt-bg, var(--active-bg)));
  color: var(--post-menu-hover-ink, var(--post-menu-ink, var(--ink)));
  outline: none;
}
:root:root .post-more-actions-panel button.post-retract-option:not(.theme-swatch):not(.theme-menu__trigger):not(.theme-menu__option):not(.account-row):not(.copy-prompt__button):not(:hover):not(:focus-visible) {
  color: var(--post-menu-danger-ink, var(--status-error, var(--ink)));
}
/* Format choices: a check marks the current format, which does nothing when pressed. */
.post-more-actions-panel .post-format-option::before { content: ""; width: 1.05rem; flex: none; text-align: center; font-weight: 700; }
.post-more-actions-panel .post-format-option[aria-pressed="true"]::before { content: "\2713"; content: "\2713" / ""; }
.post-more-actions-panel .post-format-option[aria-pressed="true"] { cursor: default; }
/* A card's Like (partials/like_button.php): a heart, filled once liked, and the count. */
.reaction-like { display: inline-flex; align-items: center; gap: 0.35em; }
.reaction-like-icon::before { content: "\2661"; content: "\2661" / ""; }
.reaction-like[aria-pressed="true"] .reaction-like-icon::before { content: "\2665"; content: "\2665" / ""; }
.reaction-like-icon { display: inline-block; font-size: 1.15em; line-height: 1; }
.reaction-count { font-variant-numeric: tabular-nums; }
.post-menu-divider { display: block; height: 0; margin: 0.2rem 0.4rem; border-top: var(--post-menu-divider, 1px solid var(--line)); }
.post-menu-icon { width: 1.05rem; height: 1.05rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Inline variant (compact card's "More" row): no panel, so the format group sits
   in the action row. The other format is an ordinary row button; the current one
   reads as plain text in every theme. */
.post-retraction-control > .post-format-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.post-retraction-control > .post-format-choice > * { white-space: nowrap; }
.post-retraction-control > .post-format-choice > .post-menu-heading { padding: 0; text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--ink-soft); }
.post-retraction-control > .post-format-choice > .post-menu-heading::after { content: ":"; }
:root:root .post-retraction-control > .post-format-choice > button[aria-pressed="true"]:not(.theme-swatch):not(.theme-menu__trigger):not(.theme-menu__option):not(.account-row):not(.copy-prompt__button) {
  min-height: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  transform: none;
  color: var(--ink);
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-decoration: none;
  text-transform: none;
  cursor: default;
}
.post-retraction-control > .post-menu-divider,
.post-retraction-control > .post-retract-option > .post-menu-icon { display: none; }
.post-retraction-control .retraction-feedback,
.post-retraction-control .retraction-details { flex-basis: 100%; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; margin: 0; }

/* Tag unlocks: resolved and closed replies in #issue threads fold to one line. */
/* The fold wraps the card's content, so its first line keeps the card's own spacing. */
.post-card > .post-resolution:first-child > .post-resolution-summary + * {
  margin-top: 0;
}
.post-card:not([data-resolution="resolved"]):not([data-resolution="closed"]) > .post-resolution > .post-resolution-summary {
  display: none;
}
.post-resolution-summary {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  min-width: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--ui-font);
  font-size: 0.9em;
  list-style: none;
}
.post-resolution-summary::-webkit-details-marker {
  display: none;
}
.post-resolution-header {
  flex: none;
}
.post-resolution-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-resolution-state {
  flex: none;
  padding: 0 0.4em;
  border: 1px solid currentColor;
  border-radius: 0.25em;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-card[data-resolution="resolved"] .post-resolution-state {
  color: var(--status-ok);
}
.post-card[data-resolution="claimed"] .post-resolution-state {
  color: var(--status-warning);
  /* Keeps the claimer's name as written. */
  text-transform: none;
  letter-spacing: normal;
}
.post-card[data-resolution="closed"] .post-resolution-state {
  color: var(--ink-soft);
  border-style: dashed;
}
.post-card[data-resolution] > .post-resolution[open] > .post-resolution-summary {
  margin-bottom: 0.5em;
}
.post-card[data-resolution] > .post-resolution:not([open]) ~ .post-card-permalink {
  display: none;
}
.post-resolution-root:has(> [hidden]) {
  display: none;
}
