/* The pull request pages as the theme's templates render them: templates/repo/issue/view.tmpl, pulls/files.tmpl and
   pulls/commits.tmpl mark the page github-pull-review. These rules were part of the theme stylesheets; they load right
   after the theme, before the component and page stylesheets, so pull-request.css still overrides them. */

.full.height:has(> .page-content.github-pull-review.files) {
  padding-bottom: 0;
}
.page-content.repository.view.issue.github-pull-review {
  & > .ui.container {
    width: calc(100% - 64px) !important;
    max-width: 1216px !important;
    margin: 24px auto !important;
    padding: 0;
  }
  &.files > .ui.container {
    width: 100% !important;
    max-width: none !important;
    /* GitHub's divider between the file tree and the files runs down to the footer. */
    margin-bottom: 0 !important;
  }
  /* GitHub's files tab is full width: title, tabs and diff share a 24px side margin. */
  &.files > .ui.container > .issue-title-header,
  &.files > .ui.container > .pull.tabs,
  &.files #diff-container {
    width: auto;
    max-width: none;
    margin-left: 24px;
    margin-right: 24px;
  }
  &.files #diff-container > .diff-content-controls {
    padding-inline: 0;
  }
  &.files #diff-container .diff-file-tree-scroll {
    padding-left: 0;
    padding-right: 16px;
  }
  &.files #diff-container > #diff-content-container {
    padding-right: 0;
  }
  &.files #diff-container.diff-file-tree-hidden > #diff-content-container {
    padding-left: 0;
  }
  /* The same header box on every tab, so switching tabs does not move the page. */
  & .issue-title-header {
    margin-bottom: 16px;
    padding: 0;
  }
  & .issue-title {
    align-items: flex-start;
    gap: 16px;
  }
  & .issue-title h1 {
    font-size: 32px;
    line-height: 40px;
    font-weight: 400;
  }
  & .issue-title .index {
    font-weight: 300;
    color: var(--color-text-light-1);
  }
  & .issue-title-meta {
    min-height: 32px;
    margin-top: 8px;
  }
  & .issue-title-meta .issue-state-label {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
  }
  /* A closed pull request is red on GitHub (purple is for merged, and for closed issues). */
  & .issue-title-meta .ui.label.issue-state-label.red {
    background-color: var(--github-bgColor-danger-emphasis) !important;
    border-color: var(--github-bgColor-danger-emphasis) !important;
    box-shadow: none;
  }
  /* The "closed this pull request" entry in the timeline is red too. */
  & .timeline-item.event .badge.tw-bg-red {
    background-color: var(--github-bgColor-danger-emphasis) !important;
  }
  /* A draft is a solid grey label. */
  & .issue-title-meta .ui.label.issue-state-label.grey {
    color: var(--github-fgColor-onEmphasis) !important;
    background-color: var(--github-bgColor-neutral-emphasis) !important;
    border-color: var(--github-bgColor-neutral-emphasis) !important;
  }
  & .pull-desc {
    font-size: 14px;
    line-height: 24px;
    color: var(--color-text-light-1);
  }
  & .ui.pull.tabs.container {
    overflow: visible;
    width: 100%;
    margin-bottom: 16px;
  }
  & .ui.pull.tabular.menu {
    scrollbar-width: none;
    align-items: flex-start;
    height: 40px;
    border: 0;
    box-shadow: inset 0 -1px 0 var(--color-light-border) !important;
    min-height: 40px;
    margin: 0;
    gap: 0;
    background: transparent;

    & > .item {
      box-sizing: border-box;
      height: 40px;
      line-height: 21px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      margin: 0;
      border: 1px solid transparent;
      min-height: 40px;
      position: relative;
      color: var(--color-text);
      font-size: 14px;
      font-weight: 400;
    }
    & > .item.active {
      background: var(--color-body);
      font-weight: 400;
      border-color: var(--color-light-border);
      border-bottom-color: var(--color-body);
      border-radius: var(--border-radius) var(--border-radius) 0 0;
      margin-bottom: -1px;
      z-index: 1;
    }
    & > .item:not(.active):hover {
      background: var(--github-control-transparent-bgColor-hover);
      border-radius: var(--border-radius);
    }
  }

  & .pull.tabs > .ui.tabs.divider {
    display: none;
  }
  & .pull-review-change-summary {
    margin-left: auto;
    display: flex;
    align-items: center;
    align-self: center;
    padding-left: 16px;
  }
  &.files .pull.tabs.container {
    margin-bottom: 0;
  }
  &.github-conversation .issue-content {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
  }
  &.github-conversation .issue-content-left > .ui.timeline {
    margin-left: 40px;
    padding-left: 16px;
  }
  &.github-conversation .timeline-item.comment > .timeline-avatar {
    display: block;
    left: -56px;
  }
  &.github-conversation .comment-header .inline-timeline-avatar {
    display: none !important;
  }
  &.commits .commit-list .message {
    min-width: 0;
  }
  &.github-conversation .comment .comment-header {
    min-height: 38px;
    padding: 4px 16px;
  }
  & .comment-header-left a:has(relative-time) {
    text-decoration: underline !important;
  }
  & .issue-title-meta .pull-desc a:not(code a) {
    color: var(--color-text-light-1);
    font-weight: 600;
  }
  & .comment.first .comment-container::before,
  & .comment.first .comment-container::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--conversation-border, var(--color-light-border));
  }
  & .comment.first .comment-container::after {
    left: -7px;
    border-right-color: var(--color-box-header);
  }
  &.own-conversation .comment.first .comment-container::after {
    border-right-color: color-mix(in srgb, var(--color-body), var(--github-bgColor-accent-emphasis) 10%);
  }
  /*
   * The pull request overview (repo/issue/view_content/pull.tmpl): GitHub's box at the top of the conversation. A
   * header row with the state, the next step and the merge button; the Checks, Comments and Approvals segments; and
   * Forgejo's merge box rows folded away under them.
   */
  & .github-pull-overview {
    /* One row's measurements, shared by the header and the folded rows. */
    --merge-section-height: 64px;
    --merge-section-padding: 16px;
    --merge-section-icon: 32px;
    --merge-section-divider: color-mix(in srgb, var(--color-light-border) 70%, transparent);
    position: relative;
    z-index: 3;
    margin: 0 0 16px 56px;
    border: 1px solid var(--color-light-border);
    border-radius: var(--border-radius);
    background: var(--color-box-body);
  }
  /*
   * The header: the round state icon, the title over its reason, then the controls: the next step and the merge
   * button. One wrapping row: the text takes what the controls leave and wraps, but never below 200px; with less
   * room the controls move, together, to a row of their own under it, so text never runs under a control.
   */
  & .github-pull-overview-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 8px;
    min-height: calc(var(--merge-section-icon) + 2 * var(--merge-section-padding));
    padding: var(--merge-section-padding);
    padding-left: calc(2 * var(--merge-section-padding) + var(--merge-section-icon));
  }
  /* The controls, kept together at their own width: the next step, Forgejo's own control, and the merge button. */
  & .github-pull-overview-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
  }
  /*
   * Forgejo's merge form's wrappers are display: contents, so its parts are controls like the next step. While it
   * shows its notice of a scheduled merge or its opened form, the group opens up too: the notice becomes the reason's
   * line under the title and the form a row of its own. Neither splits the controls: a scheduled merge comes without
   * a next step, and the opened form takes the merge button's place.
   */
  & :is(.github-pull-overview-merge, .github-pull-overview-merge > div),
  & .github-pull-overview-actions:has(.ui.info.message, form.ui.form) {
    display: contents;
  }
  & .github-pull-overview-icon {
    --state-colour: var(--github-bgColor-danger-emphasis);
    position: absolute;
    top: var(--merge-section-padding);
    left: var(--merge-section-padding);
    display: grid;
    place-items: center;
    width: var(--merge-section-icon);
    height: var(--merge-section-icon);
    border-radius: 50%;
    background: var(--state-colour);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--state-colour) 25%, transparent);
    color: var(--github-fgColor-onEmphasis);
    &.green {
      --state-colour: var(--github-bgColor-success-emphasis);
    }
    &.yellow {
      --state-colour: var(--github-bgColor-attention-emphasis);
    }
    &.purple {
      --state-colour: var(--github-bgColor-done-emphasis);
    }
    &.grey {
      --state-colour: var(--github-bgColor-neutral-emphasis);
    }
  }
  /* The text's track: it grows into the room the controls leave and shrinks to 200px before they wrap. */
  & .github-pull-overview-summary {
    flex: 1 1 200px;
    min-width: 0;
    margin-right: 8px;
    overflow-wrap: anywhere;
  }
  & .github-pull-overview-summary > h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
  }
  /* The reason under the title: the theme's sentence, or Forgejo's notice of a scheduled merge in its place. */
  & .github-pull-overview-reason,
  & .github-pull-overview-merge .ui.info.message {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--color-text-light-1);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    & code {
      padding: 2px 6px;
      border: 0;
      border-radius: 6px;
      background: var(--github-bgColor-accent-muted);
      color: var(--github-fgColor-accent);
      font-size: 12px;
      line-height: 18px;
    }
  }
  & .github-pull-overview-merge .ui.info.message {
    order: 1;
    flex: 0 0 100%;
    margin-top: -8px;
  }
  & .github-pull-overview-reason:empty {
    display: none;
  }
  & .github-pull-overview-merge .tw-flex {
    flex: none;
    flex-wrap: wrap;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    & > form {
      margin: 0 !important;
    }
  }
  /* A label stays on one line while the box has room for it, and wraps rather than leave a box narrower than it. */
  & .github-pull-overview-actions :is(.tw-inline-block, .ui.buttons, .ui.button) {
    max-width: 100%;
  }
  & .github-pull-overview-header .ui.buttons > .ui.button:not(.dropdown) {
    flex: 0 1 auto;
    min-width: 0;
  }
  & .github-pull-overview-header .ui.button {
    min-height: 32px;
    height: auto;
    margin: 0;
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
  }
  & .github-pull-overview-header .ui.buttons .ui.dropdown.icon.button {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  /* GitHub's merge button is only its label, a default button until the state is green. */
  & .github-pull-overview-header .merge-button > .ui.button:not(.dropdown, .icon) > svg {
    display: none;
  }
  &
    .github-pull-overview-header:not(:has(> .github-pull-overview-icon.green))
    .github-pull-overview-actions:not(.merge-scheduled)
    .ui.primary.buttons
    .ui.button {
    background-color: var(--color-button);
    color: var(--color-text-light);
    border: 1px solid var(--color-light-border);
    box-shadow: none;
    &:hover {
      background-color: var(--color-hover);
      color: var(--color-text);
      border-color: var(--color-light-border);
    }
    &:active {
      background-color: var(--github-button-default-bgColor-active);
      color: var(--color-text);
      border-color: var(--color-light-border);
    }
    & svg {
      color: inherit;
    }
    /* The style's full border would double the seam with the arrow; its border is the line. */
    &:not(:last-child) {
      border-inline-end-width: 0;
    }
  }
  /* Merging past unmet requirements: GitHub's danger button, not a filled red bar. */
  & .github-pull-overview-header .ui.red.buttons .ui.button {
    color: var(--github-button-danger-fgColor-rest);
    background-color: var(--github-button-danger-bgColor-rest);
    border-color: var(--color-light-border);
    &:hover {
      color: var(--github-button-danger-fgColor-hover);
      background-color: var(--github-button-danger-bgColor-hover);
      border-color: var(--github-button-danger-borderColor-hover);
    }
  }
  /* Scheduling a merge for when checks pass is not an override: Forgejo marks the group
     red, but its own confirm button is primary, so the group is shown primary too. */
  & .github-pull-overview-actions.merge-scheduled .ui.red.buttons .ui.button {
    color: var(--github-button-primary-fgColor-rest);
    background-color: var(--github-button-primary-bgColor-rest);
    border-color: var(--github-button-primary-borderColor-rest);
    box-shadow: var(--github-shadow-resting-small);
    &:hover {
      color: var(--github-button-primary-fgColor-rest);
      background-color: var(--github-button-primary-bgColor-hover);
      border-color: var(--github-button-primary-borderColor-hover);
    }
    & svg {
      color: inherit;
    }
  }
  /* The opened merge form (not the "Cancel auto merge" one): title, message, buttons, in a row below the header. */
  & .github-pull-overview-merge form.ui.form {
    order: 2;
    flex: 0 0 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 8px;
    & > .field {
      flex: 0 0 100%;
      margin: 0;
    }
    & > .field > :is(input, textarea) {
      font-family: var(--fonts-monospace);
      line-height: 20px;
    }
    & > .field > input {
      height: 32px;
      padding: 5px 12px;
    }
    & > .field > textarea {
      display: block;
      min-height: 100px;
      padding: 12px;
      resize: vertical;
    }
    & > .ui.checkbox {
      margin-left: 8px !important;
    }
  }
  /*
   * The segments: Checks, Comments and Approvals, each a label, a summary and a bar. As on GitHub, they share one row
   * in equal parts or all stack, never a row and a half with an empty cell: they stack below 768px, as GitHub's do, and
   * also once the box is narrower than three of GitHub's narrowest segments, 160px each, which Forgejo's wider sidebar
   * reaches sooner. A column is at least a third of the box while the box is 482px or wider and the whole box below
   * that; auto-fit drops the column a missing segment leaves. The 1px gaps over the divider colour draw the lines.
   */
  & .github-pull-overview-segments {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(100% / 3 - 1px, (482px - 100%) * 999, 100%), 1fr));
    gap: 1px;
    border-top: 1px solid var(--merge-section-divider);
    background: var(--merge-section-divider);
  }
  @media (max-width: 767.98px) {
    & .github-pull-overview-segments {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  & .github-pull-overview-segment {
    --segment-success: 100%;
    --segment-pending: 100%;
    --segment-rest: var(--github-bgColor-danger-emphasis);
    min-width: 0;
    background: var(--color-box-body);
    color: var(--color-text);
  }
  & .github-pull-overview-segment > summary,
  & a.github-pull-overview-segment {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 12px 16px;
    list-style: none;
    cursor: pointer;
    &::-webkit-details-marker {
      display: none;
    }
    &:hover {
      background: var(--color-hover);
    }
    &:focus-visible {
      outline: 2px solid var(--github-borderColor-accent-emphasis);
      outline-offset: -2px;
    }
  }
  & .github-pull-overview-segment[open] > summary {
    background: var(--color-box-header);
  }
  & .github-pull-overview-segment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    line-height: 18px;
    /* The label keeps its width and the summary beside it gives way; only a label wider than its segment is cut. */
    & > strong {
      flex: none;
      max-width: calc(100% - 24px);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 14px;
      font-weight: 600;
      line-height: 20px;
    }
  }
  & .github-pull-overview-segment-text {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-light-1);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* GitHub's sentence of counts where the theme has it in the reader's language, else the icons with numbers. */
  & .github-pull-overview-segment-text:empty,
  & .github-pull-overview-segment-text:not(:empty) + .github-pull-overview-segment-icons {
    display: none;
  }
  & .github-pull-overview-segment-icons {
    display: flex;
    gap: 8px;
    & > span {
      display: inline-flex;
      align-items: center;
      gap: 2px;
    }
  }
  & .github-pull-overview-segment-chevron {
    flex: none;
    margin-left: auto;
    color: var(--color-text-light-1);
    transition: transform 0.15s ease;
  }
  & .github-pull-overview-segment[open] .github-pull-overview-segment-chevron {
    transform: rotate(180deg);
  }
  /* The bar: successful, then pending, then the rest (failing checks); approvals still missing are neutral. */
  & .github-pull-overview-bar {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(
      to right,
      var(--github-bgColor-success-emphasis) 0 var(--segment-success),
      var(--github-bgColor-attention-emphasis) var(--segment-success) var(--segment-pending),
      var(--segment-rest) var(--segment-pending)
    );
  }
  & .github-pull-overview-approvals {
    --segment-rest: var(--color-secondary);
  }
  /* Nothing to track, such as no approvals required or no conversations: GitHub's unavailable bar, 2px stripes of
     the page colour over the muted neutral fill. */
  & .github-pull-overview-segment-unavailable .github-pull-overview-bar {
    border: 1px solid var(--color-light-border);
    background: repeating-linear-gradient(135deg, transparent 0 2px, var(--color-body) 2px 4px)
      var(--github-bgColor-neutral-muted);
  }
  /* An open segment's list lies over the conversation below, across the whole box, like a menu. */
  & .github-pull-overview-panel {
    position: absolute;
    z-index: 10;
    inset: 100% -1px auto;
    max-height: 360px;
    overflow: hidden auto;
    padding: 8px 0;
    border: 1px solid var(--color-light-border);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    background: var(--color-box-body);
    box-shadow: var(--github-shadow-floating-small);
  }
  & .github-pull-overview-panel-note {
    margin: 0;
    padding: 4px 16px 8px;
    color: var(--color-text-light-1);
    font-size: 12px;
    line-height: 18px;
  }
  & .github-pull-overview-reviewers {
    margin: 0;
    padding: 0 8px;
    list-style: none;
    & > li {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 37px;
      padding: 2px 6px;
      & + li {
        border-top: 1px solid var(--color-light-border);
      }
      & > :first-child {
        display: inline-flex;
        flex: 1;
        align-items: center;
        gap: 8px;
        min-width: 0;
      }
    }
    & > li.github-pull-overview-panel-note {
      padding: 4px 8px;
    }
  }
  /* A group of checks in one state, folded by its heading, as GitHub's "1 failing check". */
  & .pull-merge-check-group > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin-left: 8px;
    padding: 0 8px;
    border-radius: var(--border-radius);
    color: var(--color-text-light-1);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    list-style: none;
    cursor: pointer;
    &::-webkit-details-marker {
      display: none;
    }
    &:hover {
      background: var(--github-control-transparent-bgColor-hover);
    }
    & > svg {
      transition: transform 0.15s ease;
    }
  }
  & .pull-merge-check-group:not([open]) > summary > svg {
    transform: rotate(-90deg);
  }
  & .commit-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: 37px;
    margin: 0 8px;
    padding: 2px 6px;
    border: 0;
    border-radius: var(--border-radius);
    /* GitHub rules off the checks within one group. */
    & + .commit-status-item {
      border-top: 1px solid var(--color-light-border);
      border-radius: 0;
    }
    &:hover {
      background: var(--github-control-transparent-bgColor-hover);
    }
    & > .commit-status.icon {
      flex: none;
      width: 16px;
      min-width: 16px;
      height: 16px;
      margin: 0;
    }
    & .status-context {
      flex: 1;
      min-width: 0;
    }
    & .status-context > span {
      margin-left: 4px;
      font-size: 12px;
    }
    /* GitHub sets a status's description off with a dash. */
    & .status-context > span:not(:empty)::before {
      content: "— ";
    }
    & .status-details a {
      color: var(--color-text-light-1);
      font-size: 12px;
    }
  }
  /* Forgejo's panel for workflows that wait for approval. */
  & .github-pull-overview > .pull-request-trust-panel {
    border-top: 1px solid var(--merge-section-divider);
    & > .divider {
      display: none;
    }
    & > .item {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin: 0;
      padding: var(--merge-section-padding);
    }
  }
  /* Forgejo's merge box rows, folded away under the segments. */
  & .github-pull-overview-details {
    border-top: 1px solid var(--merge-section-divider);
    & > summary {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 8px 16px;
      color: var(--color-text-light-1);
      font-size: 12px;
      line-height: 18px;
      list-style: none;
      cursor: pointer;
      &::-webkit-details-marker {
        display: none;
      }
      &:hover {
        color: var(--github-fgColor-accent);
      }
      & > svg {
        transition: transform 0.15s ease;
      }
    }
    &[open] > summary > svg {
      transform: rotate(180deg);
    }
  }
  & .github-pull-overview .merge-section {
    padding: 0;
    border: 0;
    border-top: 1px solid var(--merge-section-divider);
    & > .divider {
      display: none;
    }
    & > :is(.item, details, .ui.form):not(:first-child) {
      border-top: 1px solid var(--merge-section-divider);
    }
    & > .item {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: var(--merge-section-height);
      margin: 0;
      padding: var(--merge-section-padding);
      border-right: 0;
      border-bottom: 0;
      border-left: 0;
    }
    & > .ui.form {
      padding: var(--merge-section-padding);
    }
    /* A row's title: Forgejo writes it either beside the icon or inside .flex-text-inline. It may hold a path, such
       as the signing key's, that has no place to break on a phone. */
    & > .item:has(> svg:first-child),
    & > .item > .flex-text-inline {
      gap: 8px;
      font-size: 16px;
      font-weight: 600;
      line-height: 24px;
      overflow-wrap: anywhere;
    }
    /* The icon is its own round badge. An svg clips its drawing to its content box, rounded by the border radius
       less the padding: a 16px circle that cut the corners off icons such as the alert triangle. The drawing stays
       inside its 16px box, so nothing needs clipping. */
    & > .item > svg:first-child,
    & > .item > .flex-text-inline > svg {
      flex: 0 0 var(--merge-section-icon);
      width: var(--merge-section-icon);
      height: var(--merge-section-icon);
      padding: 8px;
      border-radius: 50%;
      overflow: visible;
      color: var(--github-fgColor-onEmphasis);
      background: var(--github-bgColor-neutral-emphasis);
    }
    & > .item > svg.octicon-x:first-child {
      background: var(--github-bgColor-danger-emphasis);
    }
    /* A row's control sits at its right edge, or below the title when the row is too narrow.
       Rows of an icon and loose text keep one line, so their text wraps beside the icon. */
    & > .item:has(> :is(div, .ui.button, .ui.buttons):last-child:not(:first-child)) {
      flex-wrap: wrap;
    }
    & > .item > .flex-text-inline,
    & > .item.item-section > div:first-child {
      flex: 1 1 200px;
      min-width: 0;
    }
    & > .item:not(.pull-merge-row) > :is(div, .ui.button, .ui.buttons):last-child:not(:first-child) {
      flex: none;
      margin-left: auto;
    }
    & > .item .ui.button {
      min-height: 32px;
      height: 32px;
      margin: 0;
      padding: 5px 12px;
      font-size: 14px;
      font-weight: 500;
      line-height: 20px;
    }
    & > .item .ui.dropdown.icon.button {
      width: 32px;
      padding: 0;
      justify-content: center;
    }
    & > details {
      padding: 16px;
      background: var(--color-box-header);
      border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
    & > details > summary {
      padding: 0 !important;
      list-style: none;
      color: var(--github-fgColor-accent);
      font-size: 12px;
      line-height: 18px;
      text-decoration: underline;
      cursor: pointer;
      &::before,
      &::-webkit-details-marker {
        display: none;
      }
    }
    /* GitHub's "You can also merge this with the command line." before the link, muted and not underlined. */
    & > details > summary > .pull-merge-cli-hint {
      display: inline-block;
      margin-right: 4px;
      color: var(--color-text-light-1);
      text-decoration: none;
      &:empty {
        display: none;
      }
    }
    /* GitHub's row: a title with a muted sentence beneath it. */
    /* :has() matches the title rule above, which would otherwise win on specificity. */
    & > .item.pull-merge-row:has(> svg:first-child) {
      align-items: flex-start;
      font-size: 14px;
      font-weight: 400;
      line-height: 21px;
      & > div {
        flex: 1 1 200px;
        min-width: 0;
      }
      & h3 {
        margin: 0;
        font-size: 16px;
        line-height: 24px;
        font-weight: 600;
      }
      & p {
        margin: 0;
        color: var(--color-text-light-1);
        font-size: 14px;
        font-weight: 400;
        line-height: 21px;
      }
    }
    & > .item p:empty {
      display: none;
    }
    & > .item.pull-merge-status > svg {
      background: var(--github-bgColor-success-emphasis);
    }
    /* GitHub's list of files under a row's title: a Primer ActionList right under the text above it. Each item is
       33px tall, 8px in from the list with 6px 8px of padding, so its muted file icon lines up with the title's text
       and the path follows 8px after it, in 12px/20px monospace. */
    & .pull-merge-files {
      margin: 0 0 0 calc(-2 * 8px);
      padding: 0;
      list-style: none;
      & li {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 33px;
        margin: 0 8px;
        padding: 6px 8px;
        border-radius: var(--border-radius);
        color: var(--color-text-light-1);
      }
      & li > svg {
        flex: none;
      }
      & code {
        padding: 0;
        border: 0;
        background: none;
        color: var(--color-text);
        font-family: var(--fonts-monospace);
        font-size: 12px;
        font-weight: 400;
        line-height: 20px;
        overflow-wrap: anywhere;
      }
    }
  }
  @media (max-width: 767.98px) {
    & .github-pull-overview {
      margin-left: 0;
    }

    & .comment.first .comment-container::before,
    & .comment.first .comment-container::after {
      display: none;
    }
    &.github-conversation .issue-content {
      grid-template-columns: minmax(0, 1fr);
    }
    &.github-conversation .issue-content-left > .ui.timeline {
      margin-left: 0;
      padding-left: 0;
    }
    &.github-conversation .timeline-item.comment > .timeline-avatar {
      display: none;
    }
    &.github-conversation .comment-header .inline-timeline-avatar {
      display: inline-flex !important;
    }

    & > .ui.container {
      width: calc(100% - 32px) !important;
      margin: 16px auto !important;
    }
    &.files > .ui.container {
      width: 100% !important;
    }
    &.files > .ui.container > .issue-title-header,
    &.files > .ui.container > .pull.tabs {
      margin-left: 16px;
      margin-right: 16px;
    }
    &.files #diff-container {
      margin-left: 0;
      margin-right: 0;
    }
    &.files #diff-container > .diff-content-controls {
      padding-inline: 16px;
    }
    &.files #diff-container > #diff-content-container {
      padding: 16px;
    }
    & .issue-title h1 {
      font-size: 24px;
      line-height: 32px;
    }
    & .pull.tabs.container {
      overflow-x: auto;
    }
    & .pull.tabular.menu {
      width: max-content;
      min-width: 100%;
      flex-wrap: nowrap;
    }
    & .pull.tabular.menu > .item {
      padding: 8px;
      white-space: nowrap;
    }
    & .pull-review-change-summary {
      display: none;
    }
    &.files .diff-content-controls-right {
      flex-wrap: wrap;
    }
  }
}
