/* Handoff keeps actionable work separate from the chronological activity feed. */
[data-screen="handoff"] .heading {
  gap: .45rem;
  margin-bottom: 1.35rem;
}
.handoff-grid .handoff-panel {
  gap: .95rem;
  padding: clamp(1rem, 1.65vw, 1.55rem);
  border-radius: 14px;
}
.handoff-panel > h2 {
  color: var(--ink);
  font-size: 1.14rem;
  letter-spacing: -.025em;
}
.handoff-group {
  gap: .45rem;
}
.handoff-group h3 {
  margin-bottom: .12rem;
  color: var(--muted);
  font-size: .81rem;
  font-weight: 650;
}
.handoff-panel .handoff-card {
  gap: .2rem;
  padding: .72rem .85rem;
  border-radius: 9px;
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink);
}
.handoff-card .handoff-card-header strong {
  font-size: .96rem;
  line-height: 1.35;
  letter-spacing: -.015em;
}
.handoff-card small.muted,
.handoff-card .ticket-label {
  font-size: .75rem;
}
.handoff-card .history-note {
  margin-top: .16rem;
  line-height: 1.45;
}
.handoff-panel .handoff-card[data-priority="attention"] {
  border-inline-start-color: var(--warning-line);
  background: color-mix(in srgb, var(--warning-panel) 28%, var(--bg));
}
.handoff-panel .handoff-card[data-priority="ready"] {
  border-inline-start-color: var(--done);
}
.handoff-panel .handoff-group[data-waiting] {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  padding: .8rem 0 0;
}
.handoff-clear {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.1rem 0 .65rem;
}
.clear-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  background: color-mix(in srgb, var(--done) 12%, var(--bg));
  color: var(--done);
  border: 1px solid color-mix(in srgb, var(--done) 35%, var(--line));
  border-radius: 50%;
}
.clear-check::after {
  content: "";
  width: .93rem;
  height: .48rem;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateY(-2px) rotate(-45deg);
}
.handoff-clear h3,
.draft-start h2,
.ticket-start h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -.025em;
  margin-bottom: .22rem;
}
.handoff-clear p,
.activity-empty,
.draft-start p {
  max-width: 44ch;
}
.handoff-feed .activity-date {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .76rem;
  font-weight: 600;
  color: var(--muted);
}
.activity-date::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.handoff-feed .handoff-activity {
  display: grid;
  gap: .85rem;
}
.handoff-feed .handoff-activity li {
  position: relative;
  gap: .7rem;
  padding: 0;
  border: 0;
  align-items: start;
  line-height: 1.4;
}
.handoff-activity li:has(.avatar):not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: .84rem;
  inset-block: calc(1.7rem + 3px) -.65rem;
  border-inline-start: 1px solid var(--line);
}
.handoff-feed .handoff-activity li > div {
  flex: 1;
  gap: .13rem;
}
.activity-byline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .1rem .65rem;
}
.activity-byline time {
  font-size: .74rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.activity-empty {
  margin-top: -.24rem;
}
.handoff-grid .handoff-start {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  color: white;
  background: var(--desk-shadow-navy);
  border-color: var(--desk-deep-blue);
}
.handoff-start::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 43%;
  background: var(--desk-deep-blue) url("./studio-map.webp") center 66% / cover no-repeat;
  background-blend-mode: luminosity;
  mask-image: linear-gradient(to right, transparent, #000 42%);
}
.handoff-start > h2,
.handoff-start .handoff-clear h3 { color: inherit; }
.handoff-start .handoff-clear {
  align-items: flex-start;
  max-width: 62%;
}
.handoff-start .handoff-clear p { color: color-mix(in srgb, var(--desk-sky-reflection) 55%, white); }
.handoff-start .clear-check {
  color: var(--desk-sky-reflection);
  background: var(--desk-deep-blue);
  border-color: color-mix(in srgb, var(--desk-sky-reflection) 55%, var(--desk-deep-blue));
}
.handoff-start .btn.primary {
  color: var(--desk-shadow-navy);
  background: var(--desk-sky-reflection);
  border-color: var(--desk-sky-reflection);
}
.handoff-start .btn.quiet {
  color: white;
  background: var(--desk-shadow-navy);
  border-color: color-mix(in srgb, var(--desk-sky-reflection) 60%, var(--desk-deep-blue));
}
@container (max-width: 27rem) {
  .handoff-clear {
    flex-direction: column;
    gap: .65rem;
  }
  .handoff-start .clear-check {
    width: 2.15rem;
    height: 2.15rem;
  }
}

.handoff-heading .handoff-summary {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}
.empty-ticket-mark::after { content: none; }
.empty-ticket-mark svg, .activity-ticket svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.empty-ticket-mark svg { width: 1.35rem; height: 1.35rem; }
.handoff-feed .activity-ticket {
  justify-self: start;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  width: fit-content;
  max-width: 100%;
  min-height: 1.75rem;
  margin-top: .08rem;
  padding: .12rem .45rem;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: transparent;
  font: inherit;
  font-size: .81rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.activity-ticket span { min-width: 0; overflow-wrap: anywhere; }
.handoff-panel .activity-ticket:focus-visible,
.handoff-panel .handoff-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .handoff-feed .activity-ticket:hover, .handoff-panel .handoff-card:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, var(--bg));
  }
}
@media (pointer: coarse) {
  .handoff-feed .activity-ticket { min-height: 2.75rem; }
}

/* Work boards retain their four lifecycle lanes at desktop widths. */
[data-screen="tickets"] .ticket-toolbar {
  justify-content: space-between;
  gap: .8rem 1.2rem;
}
#queue-scopes .tag-btn {
  border-color: transparent;
  background: transparent;
}
#queue-scopes .tag-btn[aria-pressed="true"] {
  background: var(--selected);
}
#queue-scopes .tag-btn:hover {
  border-color: var(--line-strong);
}
.ticket-search-field {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
}
.ticket-search-field > svg {
  position: absolute;
  inset-inline-start: .66rem;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
}
.ticket-tools .ticket-search-field input { padding-inline-start: 2.18rem; }
#ticket-filters:not([hidden]) + #ticket-active-filters { display: none; }
#ticket-active-filters { gap: .4rem; }
.ticket-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  max-width: 100%;
  padding: .24rem .45rem;
  color: var(--muted);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: .42rem;
  font-size: .79rem;
  text-align: start;
}
.ticket-filter-chip strong {
  color: var(--ink);
  font-weight: 625;
  overflow-wrap: anywhere;
}
.ticket-filter-chip .chip-remove {
  font-size: 1.05rem;
  line-height: 1;
}
.ticket-filter-chip:is(:hover, :focus-visible) {
  color: var(--ink);
  border-color: var(--line-strong);
}
[data-screen="tickets"] .queue-head {
  background: var(--panel);
  padding: .78rem 1rem;
}
[data-screen="tickets"] .queue-head small {
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
[data-screen="tickets"] .board-lane {
  --lane-ink: var(--muted);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel-raised) 35%, var(--bg));
}
[data-screen="tickets"] .board-lane[data-lane="progress"] { --lane-ink: var(--progress); }
[data-screen="tickets"] .board-lane[data-lane="review"] { --lane-ink: var(--sand); }
[data-screen="tickets"] .board-lane[data-lane="done"] { --lane-ink: var(--done); }
[data-screen="tickets"] .board-lane.is-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
  box-shadow: inset 0 0 0 2px var(--accent);
}
.board-lane > .board-lane-heading {
  min-height: 2.55rem;
  box-shadow: inset 0 2px color-mix(in srgb, var(--lane-ink) 65%, transparent);
}
.board-lane-heading h2,
.ticket-identity .ticket-stage {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
}
.board-stage-number .mark,
.board-lane-heading .mark,
.ticket-stage .mark {
  position: relative;
  width: .78rem;
  height: .78rem;
  margin: 0;
  color: inherit;
  border: 1.5px solid currentColor;
  background: transparent;
}
.board-lane-heading h2 { color: var(--lane-ink); }
.board-stage-number .mark.progress,
.board-lane-heading .mark.progress,
.ticket-stage .mark.progress {
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
:is(.board-stage-number, .board-lane-heading, .ticket-stage) .mark.review::after {
  content: '';
  position: absolute;
  left: 43%;
  top: 15%;
  width: 26%;
  height: 39%;
  border-left: 1.4px solid;
  border-bottom: 1.4px solid;
}
:is(.board-stage-number, .board-lane-heading, .ticket-stage) :is(.mark.done, .mark.approved)::after {
  content: '';
  position: absolute;
  left: 22%;
  top: 20%;
  width: 46%;
  height: 27%;
  border-left: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(-45deg);
}
.ticket-stage .mark.changes { border: 0; }
.ticket-stage .mark.changes::before {
  content: "↶";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: .98rem;
  line-height: 1;
}
.board-stage-picker { display: none; }
.board-lane .board-lane-count {
  display: grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: .24rem;
  border-radius: .38rem;
  background: color-mix(in srgb, var(--lane-ink) 9%, var(--bg));
  color: var(--lane-ink);
  font-size: .73rem;
  font-variant-numeric: tabular-nums;
}
.board-lane .board-card {
  padding: .65rem .68rem;
  background: var(--panel);
  border-color: color-mix(in srgb, var(--line-strong) 60%, var(--line));
}
.board-lane .board-card[aria-pressed="true"] {
  background: var(--selected);
  border-color: var(--accent);
}
.board-lane .board-topic {
  font-size: .72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.board-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  margin-top: .4rem;
}
.board-card-meta .board-topic {
  min-width: 0;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.board-card-meta .avatar {
  display: inline-grid;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  font-size: .67rem;
}
.board-card .ticket-labels:not(:has(.ticket-comment-count:not([hidden]))) {
  margin-top: 0;
}
.board-card:not([data-ticket-stage="Changes requested"], [data-ticket-stage="Approved"]) .ticket-labels:not(:has(.ticket-comment-count:not([hidden]))) {
  display: none;
}
[data-screen="tickets"] .ticket-grid[data-empty-workspace] {
  grid-template-columns: minmax(0, 1fr);
}
.ticket-grid[data-empty-workspace] #ticket-detail {
  display: none;
}
[data-screen="tickets"] .ticket-grid[data-empty-workspace] .ticket-board {
  min-height: 0;
}
.ticket-start {
  padding: clamp(1.05rem, 2vw, 1.6rem) 1rem .4rem;
}
.ticket-start:only-child,
.ticket-grid:not(.is-board) .ticket-start {
  padding-bottom: 1.5rem;
}
#ticket-list > .group-head {
  padding-block: .55rem;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
#ticket-list .ticket-group-label {
  gap: .45rem;
  font: inherit;
  color: var(--muted);
}
#ticket-list .ticket-group-label .mark {
  width: .57rem;
  height: .57rem;
}
#ticket-list > .ticket {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 3.5rem;
  padding: .65rem .9rem;
}
#ticket-list > .ticket > .mark { display: none; }
#ticket-list > .ticket .ticket-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .12rem .45rem;
}
#ticket-list > .ticket strong {
  width: 100%;
  line-height: 1.35;
}
#ticket-list > .ticket .ticket-labels {
  align-items: baseline;
  gap: .45rem;
  margin: 0;
}
#ticket-list > .ticket .ticket-label.topic {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
}
#ticket-list > .ticket .ticket-label.status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#ticket-detail .ticket-fields {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.25rem;
}
.ticket-inspector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .65rem;
}
#ticket-detail {
  container: ticket-inspector / inline-size;
  grid-template-columns: minmax(0,1fr);
}
#ticket-detail > *,
#ticket-detail .ticket-fields > div { min-width: 0; }
.ticket-identity {
  flex: 1 1 10ch;
  min-inline-size: min(100%, 10ch);
  gap: .35rem .55rem;
}
.ticket-identity > small {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ticket-identity .ticket-stage {
  border-radius: 100px;
  color: var(--muted);
  background: var(--panel-raised);
  border-color: var(--line);
  padding-inline: .5rem;
  gap: .32rem;
  max-width: 100%;
  white-space: normal;
}
.ticket-stage .mark { width: .65rem; height: .65rem; }
.ticket-identity .ticket-stage:has(.mark.progress) { color: var(--progress); }
.ticket-identity .ticket-stage:is(.review, .ticket-stage-changes) { color: var(--sand); }
.ticket-identity .ticket-stage:has(.mark.approved, .mark.done) { color: var(--done); }
.ticket-inspector-head .update-ticket {
  margin-inline-start: auto;
  padding: .55rem .75rem;
  font-weight: 680;
  white-space: nowrap;
}
#ticket-detail > .read-receipt { margin: 0; }
#ticket-detail .ticket-fields > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .45rem;
  font-size: .85rem;
}
.ticket-person {
  min-height: 1.75rem;
  gap: .45rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
#ticket-detail .review-card {
  border: 0;
  border-inline-start: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}
#ticket-detail .review-card.change {
  border-inline-start: 3px solid var(--warning-line);
}
#ticket-detail :is(.relation, .ticket-discussion, .history) {
  border-color: var(--line);
}
@media (pointer: coarse) {
  #archived-tickets, .ticket-inspector-actions [data-archive-key] { min-height: 44px; }
}
/* Saved documents keep their editor and discussion alongside one another. */
.document-content,
.document-content > .heading {
  grid-template-columns: minmax(0, 1fr);
}
.document-content #document-selection {
  max-width: 100%;
}
.document-content #document-picker {
  max-width: min(100%, 26rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.document-content #doc-review-context .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.doc-link-label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}
@media (min-width: 1090px) {
  .document-content .doc-actions > [data-archive-key] { margin-inline-start: auto; }
}
.document-content .doc-actions {
  border-radius: 10px;
  background: var(--panel);
}
.doc-jump { display: none; }
@media (max-width: 1089px) {
  [data-screen="doc"] .doc-jump {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    width: fit-content;
    min-height: 2.75rem;
    color: var(--accent);
    font-size: .8rem;
    font-weight: 620;
    text-underline-offset: .2em;
  }
  #doc-collaboration:has(.doc-jump) { gap: .2rem .8rem; }
  #doc-chat { scroll-margin-top: .6rem; }
}
.document-content #document-selection label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}
.document-content .surface.paper,
.document-content #shared-files {
  border-radius: 12px;
  background: var(--panel);
}
.document-content .paper textarea {
  padding: .85rem .95rem;
  color: var(--ink);
  line-height: 1.65;
  background: color-mix(in srgb, var(--panel-raised) 25%, var(--bg));
}
.document-content .editor-person {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--desk-sans, system-ui), sans-serif;
}
.work-glyph {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.document-shortcuts { display: none; }
@media (max-width: 1089px) {
  .document-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15rem 1rem;
  }
}
.document-content .surface.paper {
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}
.document-content .paper > .row {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.document-content .paper .editor-person { font-family: var(--desk-sans); }
.document-content .paper .editor-note:empty { display: none; }
.document-content .paper > .label:not(.visually-hidden) { margin-inline: 1rem; }
.document-content .paper textarea {
  border: 0;
  border-radius: 0;
  padding: .75rem clamp(1rem, 2vw, 1.9rem) 1.15rem;
  background: var(--bg);
  font-family: var(--desk-sans);
  line-height: 1.7;
}
.document-content .paper .long-draft {
  padding-inline: max(1rem, (100% - 78ch) / 2);
}
.document-content .paper textarea:focus-visible {
  outline-offset: -3px;
}
#doc-chat { container: document-chat / inline-size; }
#doc-chat .chat-heading:has(svg) {
  display: flex;
  align-items: center;
  gap: .5rem;
}
#doc-chat .chat-heading svg {
  width: 1.22rem;
  height: 1.22rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#doc-chat .chat-messages { align-content: start; }
#doc-chat .doc-thread-back {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 2rem;
  margin: -.25rem 0 .15rem;
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 620 .83rem/1.35 var(--desk-sans);
  cursor: pointer;
}
#doc-chat .doc-thread-back:hover { text-decoration: underline; text-underline-offset: .16em; }
#doc-chat .chat-top > .doc-thread-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
@media (pointer:coarse) {
  #doc-chat .doc-thread-back { min-height: 2.75rem; }
}
@media (min-width:1090px) {
  #doc-chat .doc-thread-actions:not(:has([data-archive-key])) { display: none; }
}
@container document-chat (max-width: 17rem) {
  #doc-chat .chat-top { padding: 12px 12px 7px; }
  #doc-chat .chat-heading { font-size: 1.1rem; line-height: 1.3; }
  #doc-chat .chat-messages { margin-inline: 6px; padding-inline: 4px; }
  #doc-chat .message { column-gap: 8px; }
  #doc-chat .thread-origin { padding: 8px 6px; }
  #doc-chat .composer { padding: 10px; }
}
@media (pointer:coarse) and (max-width:740px) {
  #doc-chat .composer-shortcut { display: none; }
}
.document-content #shared-files { gap: .6rem; }
.library-heading { gap: .45rem .75rem; }
.library-title { display: flex; align-items: center; gap: .5rem; }
.library-count {
  min-width: 1.5em;
  padding: .12rem .35rem;
  border: 1px solid var(--line);
  border-radius: .42rem;
  text-align: center;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.library-upload {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: .35rem;
  min-height: 2.4rem;
  padding: .4rem .75rem;
  overflow: hidden;
  border-color: var(--line-strong);
  font-weight: 630;
  white-space: nowrap;
}
.library-upload > span { font-size: 1.15em; line-height: 1; }
#shared-files .library-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.library-upload:has(:focus-visible, .tour-highlight-control) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.library-upload:has(:disabled) { opacity: .65; }
.library-formats { font-size: .78rem; line-height: 1.5; }
#shared-files .file-search input { width: min(100%, 22rem); }
#shared-files .file-list { gap: 0; }
.library-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  border-block-start: 1px solid var(--line);
  padding-block-start: .65rem;
}
.library-pages small { margin-inline-end: auto; font-variant-numeric: tabular-nums; }
.library-pages button { font-size: .83rem; }
#shared-files .file-item {
  align-items: start;
  gap: .2rem;
  padding: .5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
#shared-files .file-information { gap: 0; }
#shared-files .file-actions { width: 100%; }
#shared-files .file-actions [data-preview-file] {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .15rem .15rem .15rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 630;
  line-height: 1.35;
}
#shared-files .file-actions [data-download] { margin-inline-start: auto; }
.library-file-copy {
  display: grid;
  min-width: 0;
  gap: .23rem;
}
#shared-files .library-file-copy .file-details {
  font-size: .76rem;
  font-weight: 450;
  line-height: 1.4;
}
#shared-files .library-file-copy time { white-space: nowrap; }
#shared-files .file-information > [data-download-status]:not([hidden]),
#shared-files .file-origin {
  margin-inline-start: 3.1rem;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.5;
}
#shared-files .file-origin { margin-block: .25rem; }
#shared-files .channel-file-preview desk-file-thumbnail {
  width: 2.45rem;
  height: 2.45rem;
}
#shared-files .library-archive, #shared-files .file-download {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: .4rem;
  border-color: transparent;
  color: var(--muted);
}
.library-archive .work-glyph { width: 1rem; height: 1rem; }
#shared-files .library-archive { display: inline-flex; gap: .35rem; width: auto; font-size: .8rem; }
.file-stamp {
  --stamp-ink: var(--muted);
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 2.45rem;
  height: 2.65rem;
  padding-top: .34rem;
  clip-path: polygon(0 0, calc(100% - .57rem) 0, 100% .57rem, 100% 100%, 0 100%);
  border-radius: .3rem;
  color: var(--stamp-ink);
  background: color-mix(in srgb, var(--stamp-ink) 14%, var(--panel));
  font: 700 .62rem/1 var(--desk-sans);
  letter-spacing: .02em;
}
.file-stamp::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: .57rem;
  height: .57rem;
  border-end-start-radius: .13rem;
  background: color-mix(in srgb, var(--stamp-ink) 36%, var(--panel));
}
.file-stamp:is([data-format=DOCX], [data-format=DOC], [data-format=MD], [data-format=TXT]) {
  --stamp-ink: color-mix(in srgb, #6184cc 52%, var(--ink));
}
.file-stamp:is([data-format=XLSX], [data-format=XLS], [data-format=CSV]) {
  --stamp-ink: var(--accent);
}
.file-stamp:is([data-format=PDF], [data-format=PPTX], [data-format=PPT]) {
  --stamp-ink: color-mix(in srgb, #c97a55 52%, var(--ink));
}
.file-stamp:is([data-format=PNG], [data-format=JPG], [data-format=JPEG], [data-format=WEBP], [data-format=GIF]) {
  --stamp-ink: color-mix(in srgb, #977cad 60%, var(--ink));
}
.file-preview-heading {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}
.file-preview-heading > div { min-width: 0; }
#file-preview {
  container: file-viewer / inline-size;
  width: min(860px, calc(100% - min(2rem, 6vw)));
  max-height: calc(100dvh - min(2rem, 6vh));
}
#file-preview > .dialog-form { max-height: calc(100dvh - min(2rem, 6vh) - 2px); }
#file-preview .dialog-header {
  min-width: 0;
  padding: clamp(12px, 2vw, 1.15rem);
}
.file-preview-dialog .dialog-title-row { align-items: center; }
.file-preview-heading h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font: 650 clamp(1.05rem, 2.6vw, 1.4rem)/1.25 var(--desk-sans);
}
#file-preview-details { color: var(--muted); line-height: 1.35; }
#file-preview-details:has(small:empty) { display: none; }
#file-preview .dialog-body {
  min-width: 0;
  grid-template-columns: minmax(0,1fr);
  padding: clamp(1rem, 2.2vw, 2rem);
  background: var(--panel-raised);
}
.file-preview-content { width: 100%; grid-template-columns: minmax(0,1fr); }
.file-zoom {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.file-zoom svg { width: 1.05rem; height: 1.05rem; flex: none; }
#file-preview[data-enlarged] .zoom-plus { display: none; }
#file-preview[data-zoomable] .file-preview-content :is(img,canvas) { cursor: zoom-in; }
#file-preview[data-enlarged] .file-preview-content :is(img,canvas) {
  justify-self: start;
  max-width: none;
  cursor: grab;
}
#file-preview[data-panning] .file-preview-content :is(img,canvas) { cursor: grabbing; }
#file-preview-pagination { padding: .5rem clamp(12px, 2vw, 1.15rem); }
#file-preview-pagination .file-preview-pages {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  width: 100%;
  align-items: center;
  text-align: center;
}
.file-preview-pages [role=status] { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.file-preview-pages button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
#file-preview-status, #file-preview-retry { margin: 0; }
#file-preview-status:not([hidden]) + #file-preview-retry:not([hidden]) { margin-top: .75rem; }
.file-preview-content pre {
  justify-self: center;
  width: min(100%, 76ch);
  padding: clamp(1rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--bg);
  color: var(--ink);
}
.file-office-toolbar {
  display: grid;
  justify-self: center;
  width: min(100%, 76ch);
  gap: .4rem;
}
.file-office-toolbar label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-weight: 650;
}
.file-office-toolbar select { min-width: 0; max-width: 100%; }
#file-preview:is([data-format=TXT], [data-format=MD], [data-format=DOCX], [data-format=PPTX]) pre {
  font: 1rem/1.7 var(--desk-sans);
}
#file-preview .file-preview-content canvas { box-shadow: 0 0 0 1px var(--line); }
@media (hover:hover) {
  #shared-files .file-actions [data-preview-file]:hover { color: var(--accent); }
  #shared-files .file-actions [data-preview-file]:hover .library-filename { text-decoration: underline; text-underline-offset: .16em; }
  #shared-files :is(.file-download, .library-archive, .library-upload):hover {
    background: var(--panel-raised);
    border-color: var(--line-strong);
  }
}
@media (pointer:coarse) {
  #shared-files :is(.library-upload,.library-archive,.file-download) { min-width: 44px; min-height: 44px; }
}
@container file-viewer (max-width: 31rem) {
  #file-preview .dialog-title-row { grid-template-columns: minmax(0,1fr); align-items: start; }
  #file-preview-actions { justify-content: flex-end; }
  .file-zoom span, .file-preview-pages .page-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .file-zoom, .file-preview-pages button { min-width: 2.35rem; }
}
@container file-viewer (max-width: 18rem) {
  .file-preview-heading .file-stamp { display: none; }
  #file-preview-details { font-size: .85rem; }
  #file-preview-actions { justify-content: start; }
  #file-preview .dialog-body { padding: 10px; }
  .file-preview-content pre {
    padding: .55rem;
    border: 0;
    background: transparent;
  }
}
/* A landscape phone or open keyboard leaves little height for viewer controls. */
@media (max-height: 430px) {
  #file-preview .dialog-header { padding: 5px 10px; gap: 4px; }
  #file-preview .dialog-title-row {
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
  }
  #file-preview .file-preview-heading .file-stamp { display: none; }
  #file-preview .file-preview-heading h2 { font-size: 1rem; line-height: 1.2; }
  #file-preview-details, #file-preview .file-zoom span, #file-preview .page-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #file-preview-actions { flex-wrap: nowrap; gap: 3px; }
  #file-preview-actions button, #file-preview-pagination button {
    min-width: 44px;
    min-height: 44px;
    padding: 4px 6px;
    font-size: .82rem;
    line-height: 1.15;
  }
  #file-preview .dialog-body { padding: 8px; }
  #file-preview-pagination { padding: 3px 10px; }
}
@media (forced-colors: active) {
  .board-stage-choice:has(:checked) {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
  .file-stamp { border: 1px solid CanvasText; }
}
.draft-start {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.draft-sheet {
  display: grid;
  align-content: center;
  flex: none;
  width: 2.5rem;
  height: 3rem;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 4px;
  color: var(--accent);
  background: var(--bg);
  box-shadow: 3px 3px var(--panel), 4px 4px var(--line);
}
.draft-sheet::before,
.draft-sheet::after {
  content: "";
  width: 1.25rem;
  margin: .15rem 0 .15rem .55rem;
  border-top: 2px solid currentColor;
}
.draft-sheet::after { width: .86rem; }
[data-screen="doc"]:not([data-has-document]) .doc-actions {
  gap: 1rem 2rem;
  justify-content: space-between;
  padding: clamp(1rem, 2vw, 1.7rem);
}
@media (hover: hover) and (pointer: fine) {
  .handoff-panel .handoff-card:hover,
  .board-lane .board-card:hover {
    background: var(--panel-hover);
    border-color: var(--line-strong);
  }
  .board-card-item:has(.card-move) {
    position: relative;
  }
  .board-card-item:has(.card-move):is(:hover, :focus-within) .board-card-meta .avatar {
    opacity: 0;
  }
  .board-card-item .card-move {
    position: absolute;
    inset: auto .56rem .51rem auto;
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    margin: 0;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
    transition: opacity 100ms ease-out;
  }
  .card-move span {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .card-move::after {
    content: "→";
    line-height: 1;
    font-size: 1rem;
  }
  .card-move[data-move-status="Proposed"]::after { content: "←"; }
  .handoff-start .btn.primary:hover { background: color-mix(in srgb, var(--desk-sky-reflection) 76%, white); }
  .handoff-start .btn.quiet:hover { background: var(--desk-deep-blue); }
}
@media (prefers-reduced-motion: reduce) {
  .board-card-item .card-move { transition: none; }
}
@media (max-width: 600px) {
  .queue-scopes {
    display: grid;
    grid-template-columns: minmax(0,.84fr) minmax(0,.84fr) minmax(0,1.62fr);
    gap: .24rem;
    width: min(100%,23rem);
  }
  .queue-scopes .tag-btn {
    padding-inline: .46rem;
    font-size: .84rem;
    line-height: 1.25;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }
  .main:not(.tour-active) .ticket-board {
    grid-template-columns: minmax(0,1fr);
    gap: .65rem;
    padding: .65rem;
    overflow: visible;
    container: compact-board / inline-size;
  }
  .main:not(.tour-active) .board-stage-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,3.4rem),1fr));
    gap: .18rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .board-stage-choice {
    position: relative;
    display: grid;
    align-content: start;
    justify-items: center;
    min-width: 0;
    min-height: 3.1rem;
    padding: .28rem .12rem;
    gap: .15rem;
    border: 1px solid transparent;
    border-radius: .47rem;
    font-size: .76rem;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    color: var(--muted);
  }
  .board-stage-choice input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    opacity: 0;
  }
  .board-stage-choice:has(:checked) {
    background: var(--selected);
    color: var(--ink);
    border-color: var(--line-strong);
  }
  .board-stage-choice:has(:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
  }
  .board-stage-number {
    display: inline-flex;
    gap: .27rem;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-size: .72rem;
  }
  .board-stage-number .mark.progress { color: var(--progress); }
  .board-stage-number .mark.review { color: var(--sand); }
  .board-stage-number .mark.done { color: var(--done); }
  @container compact-board (min-width: 15rem) {
    .main:not(.tour-active) .board-stage-picker {
      grid-template-columns: minmax(0,.84fr) minmax(0,1.2fr) minmax(0,1.05fr) minmax(0,.82fr);
    }
  }
  .main:not(.tour-active) .board-lane:not([data-stage-current]),
  .main:not(.tour-active) .board-lane-heading { display: none; }
  .main:not(.tour-active) .board-lane {
    min-height: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding-top: .65rem;
    background: transparent;
  }
  .main:not(.tour-active) .board-lane > * {
    margin-inline: 0;
    margin-bottom: 0;
  }
  .main:not(.tour-active) .board-lane .board-card {
    padding: .7rem .75rem;
  }
  .main:not(.tour-active) .board-card .ticket-copy strong { font-size: .95rem; }
  .main:not(.tour-active) .board-card-meta .avatar { width: 1.45rem; height: 1.45rem; }
  .main:not(.tour-active) .board-add {
    grid-template-columns: minmax(0,1fr) auto;
    align-items: stretch;
  }
}
@media (max-width: 600px) and (pointer: coarse) {
  .main:not(.tour-active) .board-card-item:has(.card-move) {
    position: relative;
  }
  .main:not(.tour-active) .board-card-item:has(.card-move) .board-card-meta {
    min-height: 44px;
    padding-inline-end: min(40%,6.3rem);
  }
  .main:not(.tour-active) .board-card-item .card-move {
    position: absolute;
    inset: auto .44rem .58rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    max-width: 38%;
    margin: 0;
    padding: .34rem;
    gap: .28rem;
    border: 0;
    box-shadow: none;
    font-size: .76rem;
    font-weight: 620;
    color: var(--accent);
  }
  .main:not(.tour-active) .board-card-item .card-move::after {
    content: "→";
    font-size: 1.07rem;
  }
  .main:not(.tour-active) .board-card-item .card-move[data-move-status="Proposed"]::after { content: "←"; }
  @container compact-board (max-width: 14.5rem) {
    .main:not(.tour-active) .board-card-item:has(.card-move) .board-card-meta {
      min-height: 0;
      padding-inline-end: 0;
    }
    .main:not(.tour-active) .board-card-item .card-move {
      position: static;
      max-width: 100%;
      justify-self: end;
      border: 1px solid var(--line);
    }
  }
}
@media (max-width: 740px) {
  [data-screen="tickets"] .ticket-tools {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    gap: .36rem;
    container: ticket-tools / inline-size;
  }
  .ticket-tools .ticket-search-field { flex: 1 1 8rem; }
  .ticket-tools #ticket-keyword {
    width: 100%;
    min-width: 0;
  }
  [data-screen="tickets"] .ticket-toolbar { gap: .55rem; }
  .handoff-grid .handoff-panel { padding: .95rem; }
  .draft-start { gap: .8rem; }
  .document-content #doc-actions:not(:has(.draft-start[hidden])) { justify-content: start; }
}
@media (min-width: 741px) and (max-width: 925px) {
  .handoff-grid { grid-template-columns: minmax(0, 1fr); }
}
@container ticket-tools (max-width: 21rem) {
  .ticket-tools .ticket-search-field { flex-basis: 100%; }
  .ticket-tools .ticket-layouts { margin-inline-start: auto; }
}
@media (min-width: 1200px) and (min-height: 640px) {
  .app:has(.main:not(.tour-active) > [data-screen="tickets"]:not([hidden])) {
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .app:has(.main:not(.tour-active) > [data-screen="tickets"]:not([hidden])) .side {
    min-height: 0;
    overflow: auto;
  }
  .main:not(.tour-active):has(> [data-screen="tickets"]:not([hidden])) {
    display: flex;
    min-height: 0;
    overflow: auto;
  }
  .main:not(.tour-active) > [data-screen="tickets"]:not([hidden]) {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
  }
  .main:not(.tour-active) .ticket-grid:not([data-no-results], [data-empty-workspace]) {
    flex: 1;
    min-height: 13rem;
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
  }
  .main:not(.tour-active) .ticket-grid:not([data-no-results], [data-empty-workspace]) > :is(#ticket-list, #ticket-detail) {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding: .75rem;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }
  .main:not(.tour-active) .ticket-grid #ticket-detail {
    align-content: start;
    overflow-anchor: none;
  }
  .main:not(.tour-active) .ticket-grid:not([data-empty-workspace]) .ticket-board {
    min-height: calc(100% - 3.15rem);
  }
}
@media (forced-colors: active) {
  #ticket-list [aria-pressed="true"],
  #queue-scopes [aria-pressed="true"],
  #ticket-layouts [aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
  .handoff-start::before { display: none; }
}

/* Private team workspace and account workspace menu */
body:has(.team-workspace:not([hidden])) { background: var(--panel-raised); }
:root[data-theme=dark] body:has(.team-workspace:not([hidden])) { background: var(--bg); }
.team-workspace { max-width: 86rem; margin-inline: auto; padding: clamp(1rem, 3vw, 3rem); container-type: inline-size; }
.team-header { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; border-block-end: 1px solid var(--line); padding-block-end: 1rem; }
.team-header .brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1rem; white-space: normal; }
.team-header .brand-mark { flex: none; color: inherit; width: 1.9rem; height: 1.9rem; }
.team-account { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; margin-inline-start: auto; min-width: 0; }
.team-account span { overflow-wrap: anywhere; font-size: .85rem; }
.team-test-label { margin: 0; padding: .18rem .48rem; border: 1px solid var(--line); border-radius: 999px; }
.team-workspace h1 { margin-block: clamp(1.2rem, 3vw, 2.25rem) .75rem; overflow-wrap: anywhere; }
.team-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.team-grid section, .team-workspace > section { padding: clamp(.85rem, 2vw, 1.35rem); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.team-grid h2 { margin: 0; font-size: 1.15rem; }
.team-grid section > ul, .team-grid section > ol { margin-block: .8rem 1rem; padding-block-end: .35rem; border-block-end: 1px solid var(--line); }
.team-grid section > ul > li:only-child:not(:has(button)),
.team-grid section > ol > li:only-child:not(:has(button)) { color: var(--muted); }
.team-workspace li { overflow-wrap: anywhere; padding-block: .5rem; }
.team-workspace li p { white-space: pre-wrap; margin-block: .25rem; }
.team-grid ul, .team-grid ol { list-style: none; padding: 0; max-height: 45vh; overflow: auto; }
.team-grid li + li { border-block-start: 1px solid var(--line); }
.team-grid li > button + button { margin-inline-start: .4rem; }
.team-entry { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; margin-block: .75rem; }
.team-entry label { display: grid; gap: .35rem; flex: 1 1 10rem; min-width: 0; }
.team-entry label[hidden] { display: none; }
.team-entry input, .team-entry select { min-width: 0; width: 100%; }
.team-workspace :is(input:not([type=checkbox]), textarea, select), .workspace-picker input {
  padding: .5rem .65rem;
  min-height: 2.5rem;
  max-width: 100%;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  color-scheme: light;
}
:root[data-theme=dark] :is(.team-workspace :is(input, textarea, select), .workspace-picker input) { color-scheme: dark; }
.team-status:empty { display: none; }
.team-controls { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; margin-block: .8rem 1.15rem; }
.team-channel-controls:not([hidden]) { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.team-controls label { display: grid; gap: .3rem; }
.team-controls details { flex: 0 1 auto; align-self: end; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; min-width: 0; background: var(--panel); }
.team-controls details[open] { align-self: start; }
.team-controls details > :not(summary) { margin-inline: .65rem; }
.team-controls summary, .workspace-picker summary { cursor: pointer; font-weight: 650; }
.team-controls summary { padding: .55rem .75rem; min-height: 2.5rem; align-content: center; }
.team-controls details ul { margin-block: .5rem 0; max-height: 18rem; overflow: auto; padding-inline-start: 1rem; }
.team-controls button { width: 100%; white-space: normal; text-align: start; }
.team-invite-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-block: clamp(1.2rem, 3vw, 2.25rem) .75rem; }
.team-invite-heading[hidden] { display: none; }
.team-invite-heading h1 { margin: 0; min-width: 0; }
.team-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.team-heading-actions .btn { min-height: 2.75rem; }
.team-my-work-list { margin: 0; padding: 0; list-style: none; }
.team-workspace .team-my-work-list > li { padding: 0; }
.team-my-work-list > li + li { border-top: 1px solid var(--line); }
.team-my-work-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 3.5rem;
  gap: .2rem .75rem;
  padding: .7rem .5rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.team-my-work-row:hover, .team-my-work-row:focus-visible { background: var(--selected); }
.team-my-work-row strong { grid-column: 1; overflow-wrap: anywhere; }
.team-my-work-row > span:first-of-type { grid-column: 1; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.team-my-work-row .team-ticket-stage { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; }
.team-my-work .btn { min-height: 2.75rem; }
.team-invite-heading .team-invite-button { min-height: 2.75rem; }
.team-controls .team-new-ticket { width: auto; min-height: 2.75rem; color: var(--accent); }
.workspace-picker-create .team-invite-button { margin-block-start: .8rem; }
.team-pending-roster:not(:empty) { border-block-start: 1px solid var(--line); padding-block: .65rem; margin-block-start: .6rem; font-size: .85rem; }
.team-roster li button { width: auto; margin-block-start: .35rem; }
.team-desktop-settings { display:grid; gap:.5rem; padding:.65rem 0; border-block-start:1px solid var(--line); }
.team-activity .team-desktop-settings label { display:flex; align-items:center; gap:.45rem; }
.team-reassign-dialog .dialog-body > :is(p,label) { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.team-reassign-dialog select { width: 100%; min-width: 0; max-width: 100%; }
.team-conversation-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-inline-start: auto; }
.team-channel-controls[hidden] + .team-conversation-nav { margin-inline-start: 0; }
.team-controls .team-conversation-nav .btn { width: auto; white-space: nowrap; }
.team-conversation-nav .btn[aria-pressed="true"] { background: var(--selected); }
:is(.team-search,.team-activity)[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100dvh - 2rem); }
.team-activity-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.team-activity-filters label { display: grid; gap: .35rem; }
.team-activity-filters label:has(input) { display: flex; flex-direction: row-reverse; align-items: center; min-height: 2.5rem; }
.team-activity ul { padding: 0; margin: 0; list-style: none; }
.team-activity ul .btn { width: 100%; text-align: start; white-space: normal; }
.team-activity [aria-description="Unread"] { color: var(--accent); font-weight: 700; }
.team-search form { display: flex; flex-wrap: wrap; gap: .5rem; }
.team-search form input { flex: 1 1 14rem; min-width: 0; }
:is(.team-search,.team-activity) .dialog-footer { display: flex; justify-content: end; }
.team-search-results, .team-direct :is(ul,ol) { list-style: none; padding: 0; margin: 0; }
.team-search-results :is(ul,li) { padding: 0; }
.team-search-results .btn { display: grid; text-align: start; width: 100%; margin-block: .25rem; overflow-wrap: anywhere; }
.team-search-results small, .team-direct small, .team-direct time { color: var(--muted); }
.team-search :is([role="status"],ul):empty, .team-direct [role="status"]:empty { display: none; }
.team-direct-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.team-direct-header-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.team-direct .team-direct-choose { display: none; }
.team-direct-header h2, .team-direct-thread h3 { margin: 0; }
.team-direct-content { display: grid; grid-template-columns: minmax(12rem,.5fr) minmax(0,1fr); border: 1px solid var(--line); border-radius: .8rem; }
.team-direct-people { min-width: 0; padding: .75rem; border-inline-end: 1px solid var(--line); background: var(--rail); border-radius: .8rem 0 0 .8rem; }
.team-direct-people input { width: 100%; }
.team-direct-people ul { max-height: 19rem; overflow: auto; margin-top: .55rem; }
.team-direct-people li { padding-block: .12rem; }
.team-direct-people .btn { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .55rem; text-align: start; border-color: transparent; }
.team-direct-people .btn[aria-pressed="true"] { border-color: var(--line-strong); background: var(--selected); }
.team-direct-people .btn :is(strong,small) { display: block; overflow-wrap: anywhere; }
.team-direct-count { min-width: 1.5rem; padding: .1rem .3rem; border-radius: 20rem; color: var(--accent-ink); background: var(--accent); text-align: center; }
.team-direct-thread { display: grid; align-content: start; min-width: 0; min-height: 16rem; gap: .7rem; padding: .85rem; }
.team-direct-thread form { display: grid; justify-items: end; gap: .45rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.team-direct-thread label { display: grid; width: 100%; gap: .25rem; }
.team-direct-thread textarea { width: 100%; resize: vertical; }
.team-direct-messages { max-height: 45vh; overflow: auto; }
.team-direct-messages li + li { border-top: 1px solid var(--line); }
.team-direct-message-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }
.team-direct-message-meta time { font-size: .8rem; }
@media (max-width: 640px) {
  .team-header { gap: .45rem .6rem; }
  .team-header .brand { gap: .35rem; font-size: .92rem; }
  .team-header .brand-mark { width: 1.6rem; height: 1.6rem; }
  .team-test-label { font-size: .74rem; }
  .team-conversation-nav { margin-inline-start: 0; }
  .team-direct-content { grid-template-columns: minmax(0,1fr); }
  .team-direct-people { border: 0; border-radius: .8rem; }
  .team-direct-people ul { max-height: 40dvh; }
  .team-direct[data-view="conversation"] .team-direct-choose { display: inline-flex; }
  .team-direct[data-view="people"] .team-direct-thread,
  .team-direct[data-view="conversation"] .team-direct-people { display: none; }
}
:is(.team-remove-member, .team-review-dialog, .team-invite-dialog)[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100dvh - 2rem); }
.team-remove-member .dialog-footer { display: flex; gap: .5rem; justify-content: end; flex-wrap: wrap; }
.team-remove-member [role="status"]:empty { display: none; }
.team-ticket-heading, .team-ticket-assignment { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.team-ticket-heading strong { font-size: 1.05rem; min-width: 0; }
.team-ticket-stage { padding: .15rem .55rem; border-radius: 1rem; background: var(--selected); color: var(--ink); font-size: .8rem; }
.team-ticket-stage[data-stage="In review"] { color: var(--sand); background: color-mix(in srgb, var(--sand) 10%, var(--panel)); }
.team-ticket-stage[data-stage="Done"] { color: var(--done); background: color-mix(in srgb, var(--done) 10%, var(--panel)); }
.team-ticket-assignment { margin-block: .45rem; }
.team-ticket-assignment > span { color: var(--muted); font-size: .85rem; }
.team-ticket-assignment .btn { color: var(--accent); font-size: .85rem; min-height: 2.75rem; white-space: normal; }
.team-ticket-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .55rem; }
.team-ticket-actions .btn { font-size: .85rem; }
.team-review-dialog .dialog-header p { margin: .3rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.team-review-dialog .dialog-footer { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem; }
.team-review-dialog :is(label, form) { display: grid; gap: .45rem; }
.team-review-dialog textarea { width: 100%; resize: vertical; }
.team-review-dialog [role="status"] { margin: 0; }
.team-review-dialog [role="status"]:empty { display: none; }
.team-review-dialog .dialog-body > .btn { justify-self: start; }
.team-invite-dialog .dialog-header p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.team-invite-dialog .dialog-body > * { min-width: 0; margin: 0; }
.team-invite-dialog .dialog-body > .btn, .team-invite-dialog .dialog-footer .btn { justify-self: end; }
.team-invite-dialog .dialog-body > :empty { display: none; }
.team-invite-dialog h3 { font-size: .95rem; margin-block: .25rem .5rem; }
.team-invite-dialog .workspace-invitation { padding-block: .65rem; margin: 0; border-block-start: 1px solid var(--line); }
.team-invite-dialog .workspace-invitation > div { flex-basis: 100%; }
.team-invite-dialog .workspace-invitation time { display: block; margin-block-start: .15rem; font-size: .84rem; color: var(--muted); }
.team-invite-dialog [role=status] { font-size: .9rem; overflow-wrap: anywhere; }
.team-invite-dialog .btn { min-height: 2.75rem; white-space: normal; }
@media (max-width: 440px) {
  .team-invite-dialog .team-entry { display: grid; }
  .team-invite-dialog .team-entry input { font-size: max(1rem,16px); }
}
@container (max-width: 12rem) {
  .team-workspace > .dialog-framed[open] { display: block; overflow: auto; }
  .team-workspace > .dialog-framed :is(.dialog-header,.dialog-body,.dialog-footer) { padding: .6rem .7rem; }
  .team-review-dialog .dialog-header h2 { font-size: 1.05rem; line-height: 1.2; }
  .team-review-dialog .dialog-header p { font-size: .86rem; line-height: 1.3; }
  .team-review-dialog .dialog-footer .btn { font-size: .8rem; white-space: normal; }
}
@media (max-height: 420px) {
  .team-workspace > .dialog-framed[open] { display: block; overflow: auto; }
}
.team-review-events, .team-grid .team-review-events { list-style: none; padding: 0; margin: 0; max-height: none; overflow: visible; }
.team-review-events > li { padding: .75rem 0; overflow-wrap: anywhere; }
.team-review-events > li + li { border-block-start: 1px solid var(--line); }
.team-review-heading { display: flex; flex-wrap: wrap; gap: .15rem .55rem; align-items: baseline; }
.team-review-heading :is(span, time) { color: var(--muted); font-size: .84em; }
.team-review-events p { white-space: pre-wrap; margin: .25rem 0 0; }
.team-my-work-detail .dialog-header h2 { overflow-wrap: anywhere; }
.team-my-work-detail .dialog-body { align-content: start; }
.team-my-work-detail h3 { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 600; }
.team-my-work-detail .team-review-events { margin-block-start: .5rem; padding-inline-start: .75rem; border-inline-start: 2px solid var(--accent); }
.team-my-work-detail .team-review-events > li { padding-block: 0; }
.team-my-work-description { margin: 0; padding-block-start: .75rem; border-block-start: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.team-my-work-detail .btn { min-height: 2.75rem; white-space: normal; }
.team-grid .team-review-preview { margin-block: .7rem .45rem; padding-inline-start: .65rem; border-inline-start: 2px solid var(--accent); }
.team-review-preview > li { padding-block: .15rem; }
.team-review-preview p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.team-active-ticket { background: var(--selected); }
.team-entry textarea { width: 100%; min-height: 4rem; }
.team-conversation-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .65rem;
  row-gap: .25rem;
}
.team-conversation-name { overflow-wrap: anywhere; font-size: .87rem; }
.team-thread-actions:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-block-start: .6rem;
}
.team-thread-actions .btn { text-align: start; white-space: normal; }
.team-link-feedback { margin-block: .55rem 0; }
.team-messages input[type=url]:not([hidden]) { width: 100%; margin-block-start: .45rem; }
.team-messages .team-message-list > li { padding: .55rem .4rem; }
.team-messages .team-message-list p { line-height: 1.5; }
.team-message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; }
.team-message-meta time { color: var(--muted); font-size: .78rem; }
.team-message-history-tools { margin-block-start: .6rem; }
.team-message-history-tools .team-status { margin-block: .35rem 0; color: var(--muted); font-size: .85rem; }
.team-linked-message {
  border-inline-start: 2px solid var(--accent);
  border-radius: .25rem;
  background: var(--selected);
}
.team-message-composer {
  position: relative;
  display: grid;
  gap: .5rem;
  min-width: 0;
  margin-block: .75rem .5rem;
}
.team-message-composer[hidden] { display: none; }
.team-message-composer textarea { width: 100%; min-height: 4rem; resize: vertical; }
.team-message-composer-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.team-message-composer-footer .btn { margin-inline-start: auto; }
.team-message-composer-footer .team-mention-trigger { min-width: 2.5rem; margin-inline-start: 0; }
.team-message-composer .team-status { margin: 0; }
.team-grid ul.team-mention-suggestions {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: calc(100% + .35rem);
  z-index: 1;
  width: min(20rem,100%);
  max-height: 13rem;
  margin: 0;
  padding: .25rem;
  border: 1px solid var(--line-strong);
  border-radius: .65rem;
  background: var(--panel);
  box-shadow: 0 .4rem 1.2rem var(--shadow);
}
.team-mention-suggestions li {
  display: grid;
  padding: .4rem .65rem;
  border: 0;
  border-radius: .35rem;
  cursor: pointer;
}
.team-mention-suggestions li[aria-selected=true], .team-mention-suggestions li:hover { background: var(--selected); }
.team-mention-suggestions small { color: var(--muted); }
.team-message-mention {
  display: inline;
  padding: .06em .24em;
  border-radius: .25rem;
  color: var(--accent);
  background: var(--selected);
}
@media (pointer: coarse), (max-width: 480px) {
  .team-message-shortcut { display: none; }
}
.team-ticket-editor form:not([hidden]) { gap: .85rem; }
.team-ticket-editor form[hidden], .team-ticket-editor label[hidden] { display: none; }
.team-ticket-editor :is(input, select, textarea) { width: 100%; min-width: 0; font-size: 1rem; }
.team-ticket-editor textarea { min-height: 5rem; }
.team-ticket-editor [role="status"] { overflow-wrap: anywhere; }
.team-announcement {
  position: fixed;
  inset-block-start: max(.75rem,env(safe-area-inset-top));
  inset-inline-end: .75rem;
  z-index: 12;
  max-inline-size: min(24rem,calc(100vw - 1.5rem));
  margin: 0;
  padding: .65rem 1rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: .6rem;
  background: var(--panel);
  box-shadow: 0 .4rem 1.2rem var(--shadow);
  pointer-events: none;
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: no-preference) {
  .team-announcement:not([hidden]) { animation: notice-enter 140ms ease-out; }
}
@media (max-width: 720px) {
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  .team-account { margin-inline-start: 0; }
}

#team-workspace-menu {
  width: min(34rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  box-shadow: 0 12px 36px var(--shadow);
}
#team-workspace-menu[open] { display: flex; flex-direction: column; }
#team-workspace-menu::backdrop { background: rgb(9 16 23 / 48%); }
:root[data-theme=dark] #team-workspace-menu::backdrop { background: rgb(5 9 14 / 66%); }
.workspace-picker-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .5rem .75rem; }
.workspace-picker-header h2 { min-width: 0; overflow-wrap: anywhere; }
.workspace-picker-header form { margin-inline-start: auto; }
.workspace-picker { display: grid; gap: 1rem; }
.workspace-picker h3 { margin: 0 0 .4rem; font-size: .9rem; }
.workspace-picker p { margin: 0; }
.workspace-picker-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .32rem; }
#team-workspace-menu .workspace-picker-list li, .team-workspace .workspace-picker-list li { padding: 0; }
.workspace-picker-link {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}
.workspace-picker-link:hover, .workspace-picker-link[aria-current] {
  color: var(--ink);
  background: var(--selected);
  border-color: var(--line-strong);
}
.workspace-picker-identity { display: grid; gap: .05rem; min-width: 0; overflow-wrap: anywhere; }
.workspace-picker-current { margin-inline-start: auto; }
.workspace-home-link { justify-self: start; text-decoration: none; }
.workspace-directory {
  width: min(66rem, 100%);
  margin-inline: auto;
}
.workspace-directory h1 {
  margin-block: clamp(2rem, 6vw, 4.5rem) 1.5rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.05em;
}
.workspace-directory-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.85rem, 2vw, 1.5rem);
}
.workspace-directory-actions {
  display: grid;
  gap: inherit;
  min-width: 0;
}
.workspace-directory-grid section {
  min-width: 0;
  padding: clamp(.9rem, 2.5vw, 1.45rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.workspace-directory-grid h2 {
  margin: 0 0 .9rem;
  font-size: 1.12rem;
  letter-spacing: -.025em;
}
.workspace-directory-grid .workspace-picker-list { gap: .5rem; }
.workspace-directory-grid .workspace-picker-link {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 4rem;
  gap: .8rem;
  padding: .75rem;
  background: var(--panel-raised);
}
.workspace-directory-grid .workspace-picker-link:hover,
.workspace-directory-grid .workspace-picker-link:focus-visible { background: var(--selected); }
.workspace-directory-grid .workspace-picker-avatar {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 9px;
}
.workspace-directory-arrow { color: var(--muted); font-size: 1.15rem; }
.workspace-directory-empty { display: grid; gap: .4rem; }
.workspace-directory-empty p, .workspace-directory-unavailable { color: var(--muted); }
.workspace-directory-grid .workspace-picker-create {
  padding: clamp(.9rem, 2.5vw, 1.45rem);
  background: var(--panel);
}
.workspace-directory-grid .team-entry { display: grid; }
.workspace-directory-grid .team-entry .btn { justify-self: start; }
.workspace-directory-grid .workspace-picker-status { grid-column: 1 / -1; }
.workspace-directory-grid .workspace-invitation + .workspace-invitation {
  border-block-start: 1px solid var(--line);
  padding-block-start: .6rem;
}
@media (max-width: 690px) {
  .workspace-directory-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
  .workspace-directory-grid .workspace-picker-link {
    grid-template-columns: auto minmax(0, 1fr);
    gap: .55rem;
    padding: .55rem;
  }
  .workspace-directory-grid .workspace-picker-avatar { width: 2rem; height: 2rem; }
  .workspace-directory-arrow { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .workspace-directory-grid { animation: workspace-picker-in .16s ease-out; }
}
.workspace-picker-avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  font-weight: 750;
  background: var(--accent);
  color: var(--accent-ink);
}
.workspace-picker .workspace-picker-create {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .9rem;
  background: var(--panel-raised);
}
.workspace-picker-create[open] summary { margin-block-end: .65rem; }
.workspace-picker-create .team-entry { margin-block-end: 0; }
.workspace-picker label { font-size: .85rem; font-weight: 650; }
.workspace-picker .workspace-usage { display: grid; justify-items: start; gap: .55rem; margin-block-start: 1rem; padding: 1rem 0 0; border: 0; border-block-start: 1px solid var(--line); }
.workspace-usage h3 { margin: 0; }
.workspace-usage h3:not(:first-child) { margin-block-start: .4rem; }
.workspace-usage p { color: var(--muted); }
.workspace-usage p:empty { display: none; }
.workspace-usage-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: .4rem; width: 100%; margin: 0; }
.workspace-usage-counts[hidden] { display: none; }
.workspace-usage-counts div { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 7px; }
.workspace-usage-counts div:last-child { grid-column: 1 / -1; }
.workspace-usage-counts dt { color: var(--muted); font-size: .8rem; }
.workspace-usage-counts dd { margin: .15rem 0 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.workspace-picker-invitations:empty, .workspace-picker-status:empty { display: none; }
.workspace-invitation { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-block: .4rem; }
.workspace-invitation > :first-child { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.workspace-invitation input { flex: 1 0 100%; }
@media (max-width: 440px) {
  .workspace-picker-create .team-entry { display: grid; }
  .workspace-picker-create .btn { justify-self: stretch; }
  .workspace-picker-link { grid-template-columns: auto minmax(0,1fr); }
  .workspace-picker-current { grid-column: 2; margin: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #team-workspace-menu[open] { animation: workspace-picker-in .13s ease-out; }
  .workspace-picker-link { transition: background-color .14s, border-color .14s; }
  @keyframes workspace-picker-in { from { transform: translateY(4px); } }
}

.member-profile-page { display: grid; gap: 1rem; align-content: start; max-width: 46rem; margin-inline: auto; }
.member-profile-back { justify-self: start; }
.member-profile-card { overflow: hidden; padding: 0; }
.member-profile-card[data-profile-accent=ocean] { --profile-tint: var(--progress); }
.member-profile-card[data-profile-accent=plum] { --profile-tint: #9369ad; }
.member-profile-card[data-profile-accent=amber] { --profile-tint: var(--sand); }
.member-profile-card[data-profile-accent=forest] { --profile-tint: light-dark(#226747, #abd5c1); }
.member-profile-card[data-profile-accent] .member-profile-cover {
  background: linear-gradient(115deg,color-mix(in srgb,var(--profile-tint) 20%,var(--panel)),var(--panel-raised));
}
.member-profile-cover {
  min-height: clamp(4.5rem, 10vw, 5.25rem);
  background: linear-gradient(115deg, var(--selected), var(--panel-raised));
  border-bottom: 1px solid var(--line);
}
.member-profile-content { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: end; padding: 0 clamp(1rem, 4vw, 1.6rem) 1.35rem; }
.member-profile-identity { display: grid; position: relative; gap: .75rem; min-width: 0; }
#member-profile-avatar { margin-top: -2.3rem; width: max-content; }
#member-profile-avatar .avatar { width: 4.6rem; height: 4.6rem; border: 3px solid var(--panel); border-radius: 1rem; font-size: 1.55rem; }
#member-profile-name { margin: 0; font-size: clamp(1.55rem, 5vw, 2.3rem); line-height: 1.1; overflow-wrap: anywhere; }
#member-profile-handle { margin: .32rem 0 0; }
.member-profile-actions { flex-wrap: wrap; }
.member-profile-actions:not(:has(.btn:not([hidden]))) { display: none; }
.member-profile-page .btn { min-height: 2.75rem; }
.member-profile-workspace { display: flex; flex-wrap: wrap; gap: .35rem 1rem; justify-content: space-between; padding: .85rem clamp(1rem, 4vw, 1.6rem); border-top: 1px solid var(--line); }
.profile-author-link, .message-profile-avatar { color: inherit; text-decoration: none; border-radius: .35rem; }
.profile-author-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.message-profile-avatar { display: inline-flex; align-self: start; justify-self: start; }
.message-profile-avatar:hover .avatar { outline: 1px solid var(--line-strong); }
.team-profile-entry { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; overflow-wrap: anywhere; }
.team-profile-entry .avatar { flex: none; }
.team-profile-entry .avatar::before { content: attr(data-initial); }
.team-profile .member-profile-identity > .avatar { width: 4.6rem; height: 4.6rem; margin-top: -2.3rem; border: 3px solid var(--panel); border-radius: 1rem; font-size: 1.55rem; }
.team-profile h1 { margin: 0; overflow-wrap: anywhere; }
.team-workspace > .team-profile { margin-block-start: clamp(1rem, 3vw, 2rem); border: 0; padding: 0; background: transparent; }

.ticket-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-activity-heading { flex-wrap: wrap; gap: .35rem .75rem; }
.ticket-activity-heading .btn { font-size: .82rem; }
#details-dialog .dialog-header p { margin: .25rem 0 0; }
#details-conflicts p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (pointer: coarse) {
  .ticket-activity-heading .btn { min-height: 44px; }
}

.ticket-latest-update {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: .73rem;
}
#ticket-list > .ticket .ticket-latest-update { flex-basis: 100%; }
.ticket-history { display: grid; gap: .55rem; }
.ticket-history h3 { margin: 0; font-size: .98rem; }
.ticket-history .event-list { max-block-size: 16rem; overflow-y: auto; padding-inline: .2rem; }
#ticket-history-dialog .ticket-history .event-list { max-block-size: none; overflow: visible; }

.ticket-activity-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  max-inline-size: 17rem;
  gap: .2rem;
}
.ticket-activity-filters .btn {
  min-inline-size: 0;
  min-height: 2rem;
  padding: .28rem .35rem;
  font-size: .78rem;
  white-space: normal;
  border-color: transparent;
  background: transparent;
}
.ticket-activity-filters .btn[aria-pressed=true] { color: var(--ink); background: var(--selected); }
.ticket-history .ticket-event {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: .55rem;
}
.ticket-history .ticket-event .avatar { width: 1.65rem; height: 1.65rem; font-size: .73rem; }
.ticket-event-content { min-width: 0; }
.ticket-event-content time { display: inline-block; font-size: .74rem; }
#details-status-hint { margin-block: -.2rem .15rem; font-size: .8rem; }
@media (pointer: coarse) {
  .ticket-activity-filters .btn { min-height: 44px; }
}

#details-dialog .dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
#details-ticket { overflow-wrap: anywhere; }
.ticket-update-details { border-top: 1px solid var(--line); padding-top: .45rem; }
.ticket-update-details summary { cursor: pointer; font-weight: 620; padding: .4rem 0; }
.ticket-update-details[open] summary { margin-block-end: .65rem; }
#details-dialog label span small { font-size: .8em; }

@media (max-width: 360px), (max-height: 500px) {
  #details-dialog {
    max-width: min(480px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #details-form { max-height: none; grid-template-rows: auto auto auto; }
  #details-form :is(.dialog-header, .dialog-body, .dialog-footer) { padding-inline: clamp(12px, 4vw, 18px); }
  #details-form .dialog-body { overflow: visible; }
}

@media (max-width:740px) {
  .ticket-history .event-list { max-block-size: 19rem; }
}

.ticket-priority {
  display: inline-block;
  width: fit-content;
  border: 1px solid var(--line-strong);
  border-radius: .35rem;
  padding: .1rem .38rem;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--muted);
  background: var(--panel-raised);
}
.ticket-priority[data-priority=high] { color: var(--sand); }
.ticket-priority:is([data-priority=emergency],[data-priority=urgent]) { color: var(--urgent-ink); border-color: currentColor; }
#details-ticket { overflow-wrap: anywhere; }
