.thread-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 16px max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  background: rgb(0 0 0 / .62);
}

.thread-action-sheet[hidden] { display: none; }

.thread-action-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
  box-shadow: 0 24px 70px rgb(0 0 0 / .34);
}

.thread-action-panel header,
.thread-confirm-panel p {
  padding: 16px 18px;
  background: var(--surface-raised);
}

.thread-action-panel header { display: grid; gap: 4px; }
.thread-action-panel header small { color: var(--muted); }
.thread-action-panel > button small { margin-left: .5em; color: var(--muted); }
.thread-action-panel { max-height: calc(var(--app-height, 100dvh) - 32px - var(--safe-bottom)); overflow-y: auto; }
.thread-confirm-panel p { overflow-wrap: anywhere; }

.thread-action-panel > button,
.thread-confirm-actions button {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  color: var(--text);
  background: var(--surface-raised);
  font: inherit;
  text-align: left;
}

.thread-action-panel > button:hover,
.thread-action-panel > button:focus-visible,
.thread-confirm-actions button:hover,
.thread-confirm-actions button:focus-visible { background: var(--surface-hover); }

.thread-action-panel > .is-danger,
.thread-confirm-actions button[data-tone="danger"] { color: var(--red); }

.thread-action-cancel { margin-top: 7px; text-align: center !important; }

.thread-confirm-panel { gap: 0; background: var(--surface-raised); }
.thread-confirm-panel p { margin: 0; color: var(--muted); }
#thread-exchange-seats { padding: 0 18px 16px; display: grid; gap: 12px; }
#thread-exchange-seats[hidden] { display: none; }
.thread-confirm-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.thread-confirm-actions button { text-align: center; padding: 0 8px; }
.thread-confirm-actions button + button { border-left: 1px solid var(--line); }

@media (min-width: 821px) {
  .thread-action-sheet { place-items: center; }
}

.thread-rotation-status { margin: 0; padding: 16px 18px; background: var(--surface-raised); color: var(--muted); overflow-wrap: anywhere; }

html.native-content-geometry .thread-action-sheet {
  padding-inline: calc(16px + var(--content-left)) calc(16px + var(--content-right));
}
