/* ── Account and ticket pages. Builds on /guide/guide.css (tokens, masthead,
   theme toggle, action, foot). */

:root {
  --alarm: #9e3226;
  --field: rgba(251, 250, 247, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --alarm: #f0968a; --field: rgba(233, 228, 218, .04); }
}
:root[data-theme="dark"] { --alarm: #f0968a; --field: rgba(233, 228, 218, .04); }

body.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ── Desk */

.desk {
  flex: 1 0 auto;
  width: min(100% - (var(--edge) * 2), 50rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4rem, 9vw, 7rem);
}

.desk__head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.desk__head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.desk__meta {
  margin-bottom: .9rem;
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  color: var(--ink-soft);
}
.desk__title {
  font: 400 clamp(2.25rem, 5.2vw, 3.4rem)/1.04 var(--display);
  letter-spacing: -.012em;
  text-wrap: balance;
}
.desk__title--subject {
  font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.12 var(--display);
  overflow-wrap: anywhere;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  margin-bottom: 1.6rem;
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .4s var(--ease), gap .45s var(--ease);
}
.back:hover,
.back:focus-visible { color: var(--ink); gap: .85em; }

/* ── States */

.state { display: grid; justify-items: start; gap: 1.4rem; }
.state[data-state="ready"] { display: block; justify-items: normal; }
.state[hidden] { display: none; }
.state__text {
  max-width: 34rem;
  font: 400 1.25rem/1.5 var(--text);
  color: var(--ink);
  text-wrap: pretty;
}
.state__note { max-width: 34rem; font-size: 1rem; color: var(--ink-soft); }
/* The verify page's Cap widget, in the page's colours (it reads these through its shadow root). */
cap-widget {
  display: block; margin-top: 1.25rem;
  --cap-background: var(--field); --cap-border-color: var(--ink-faint); --cap-color: var(--ink);
  --cap-checkbox-background: transparent; --cap-checkbox-border: 1px solid var(--ink-soft);
  --cap-spinner-color: var(--ink); --cap-spinner-background-color: var(--ink-faint);
  --cap-troubleshoot-color: var(--ink-soft); --cap-font: var(--sans);
}
.state__note a,
.notice a,
.state__text a { text-underline-offset: .2em; text-decoration-thickness: 1px; }

[data-state="loading"] .state__text {
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 2.9rem;
  padding: .7rem 1.35rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: 600 .875rem/1.2 var(--sans);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.button:hover,
.button:focus-visible { background: transparent; color: var(--ink); }
.button:focus-visible { outline-offset: .25em; }
.button:disabled { opacity: .55; cursor: progress; }
.button:disabled:not([data-idle]) { opacity: .4; cursor: not-allowed; }
.button:disabled:hover { background: var(--ink); color: var(--paper); }
.button--quiet:disabled:hover { background: transparent; color: var(--ink); }
.button--small { min-height: 2.5rem; padding: .5rem 1rem; font-size: .75rem; }
.button--danger-quiet { border-color: var(--alarm); background: transparent; color: var(--alarm); }
.button--danger-quiet:hover,
.button--danger-quiet:focus-visible { background: var(--alarm); color: var(--paper); }
.button--danger-quiet:disabled:hover { background: transparent; color: var(--alarm); }
.clip {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button--danger { border-color: var(--alarm); background: var(--alarm); color: var(--paper); }
.button--danger:hover,
.button--danger:focus-visible { background: transparent; color: var(--alarm); }

:where(button).action {
  padding-inline: 0;
  padding-top: 0;
  border-width: 0 0 1px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.action--quiet { color: var(--ink-soft); }
.action--quiet:hover,
.action--quiet:focus-visible { color: var(--ink); }
.action--danger { color: var(--alarm); border-bottom-color: color-mix(in srgb, var(--alarm) 35%, transparent); }
.action:disabled { opacity: .55; cursor: progress; }
.arrow--back { transition: transform .45s var(--ease); }
.back:hover .arrow--back,
.back:focus-visible .arrow--back { transform: translateX(-.2em); }

.row-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem 2rem; }

/* ── Notices */

.notice {
  max-width: 40rem;
  margin: 0 0 2rem;
  padding: .95rem 0 .95rem 1.1rem;
  border-left: 2px solid var(--warm);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-body);
}
.notice--quiet { border-left-color: var(--ink-faint); color: var(--ink-soft); margin-block: .5rem 1.75rem; }

.flash {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: .85rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  font: 500 .875rem/1.45 var(--sans);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.flash--error { background: var(--alarm); }

/* ── Tags and status */

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  padding: .28rem .55rem .24rem;
  border: 1px solid var(--ink-faint);
  font: var(--meta);
  font-size: .625rem;
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  color: var(--ink-soft);
  list-style: none;
}
.tag--staff { border-color: var(--sky); color: var(--sky); }
.tag--muted { border-style: dashed; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font: var(--meta);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-soft);
}
.status__mark { width: 7px; height: 7px; flex: none; background: currentColor; }
.status--open { color: var(--sky); }
.status--pending { color: var(--warm); }
.status--closed .status__mark { background: none; box-shadow: inset 0 0 0 1px currentColor; }

.ticket-status { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: 1.1rem; }
.ticket-status__by { font-size: .875rem; color: var(--ink-soft); }
.ticket-status__by:empty { display: none; }

/* ── Profile */

.profile { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 2.25rem; }
.profile__avatar,
.avatar {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-wash);
}
.profile__avatar { width: 4rem; height: 4rem; }
.profile__name { font: 400 1.6rem/1.15 var(--text); overflow-wrap: anywhere; }
.profile__handle { margin-top: .2rem; font-size: 1rem; color: var(--ink-soft); }
.profile__handle:empty { display: none; }

.ledger,
.danger { position: relative; margin-top: clamp(3rem, 6vw, 4.25rem); padding-top: 1.6rem; }
.ledger::before,
.danger::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink-faint); transform-origin: left; }
.ledger__title {
  margin-bottom: 1.25rem;
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ledger__list { display: grid; gap: 1.1rem; }
.ledger__list > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .3rem 1.5rem; }
.ledger__list dt { font: 600 .875rem/1.6 var(--sans); }
.ledger__list dd { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--ink-body); max-width: 36rem; }

.danger > p { max-width: 36rem; margin-bottom: 1.4rem; font-size: 1rem; line-height: 1.6; color: var(--ink-body); }
.confirm { display: grid; gap: 1rem; }
.confirm > p { font: 400 1.125rem/1.4 var(--text); }

/* ── Filters */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}
.filters { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.filters a,
.filters button {
  position: relative;
  padding: .35rem 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color .35s var(--ease);
}
.filters a::after,
.filters button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.filters a:hover,
.filters button:hover,
.filters [aria-current],
.filters [aria-pressed="true"] { color: var(--ink); }
.filters [aria-current]::after,
.filters [aria-pressed="true"]::after { transform: scaleX(1); transform-origin: left; }
.filters button:disabled { opacity: .55; cursor: progress; }
.filters--scope { padding-left: 1.5rem; border-left: 1px solid var(--ink-faint); }

/* ── Ticket list */

.tickets { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink-faint); }
.tickets[aria-busy="true"] { opacity: .5; transition: opacity .3s var(--ease); }
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem 2rem;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--ink-faint);
  transition: background-color .3s var(--ease);
}
.ticket:hover { background: var(--ink-wash); }
.ticket__link { display: grid; gap: .3rem; text-decoration: none; min-width: 0; }
.ticket__link::before { content: ""; position: absolute; inset: 0; }
.ticket__link:focus-visible { outline: 0; }
.ticket:has(.ticket__link:focus-visible) { outline: 1px solid currentColor; outline-offset: 2px; }
.ticket__subject {
  font: 400 1.1875rem/1.35 var(--text);
  overflow-wrap: anywhere;
  transition: color .3s var(--ease);
}
.ticket.is-closed .ticket__subject { color: var(--ink-soft); }
.ticket__meta { display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; font-size: .875rem; color: var(--ink-soft); }
.ticket__count {
  justify-self: end;
  font: 500 .875rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.empty { padding: 2.5rem 0 1rem; display: grid; justify-items: start; gap: .8rem; }
.empty__title { font: 400 1.5rem/1.3 var(--text); }
.empty__text { max-width: 32rem; color: var(--ink-soft); }
.empty__text:empty { display: none; }
.empty .action { margin-top: .8rem; }

/* ── Forms */

.form { display: grid; gap: 1.9rem; }
.field { display: grid; gap: .55rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label {
  padding: 0;
  font: 600 .75rem/1.4 var(--sans);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
}
.input {
  width: 100%;
  padding: .8rem .95rem;
  border: 1px solid var(--ink-faint);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.input::placeholder { color: var(--ink-soft); }
.input:hover { border-color: color-mix(in srgb, var(--ink) 38%, transparent); }
.input:focus { outline: 0; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.input[aria-invalid="true"] { border-color: var(--alarm); }
.input--area { min-height: 9rem; resize: vertical; }
.field__hint { display: flex; justify-content: space-between; gap: 1.5rem; font-size: .875rem; line-height: 1.5; color: var(--ink-soft); }
.field__hint [data-count] { flex: none; font-variant-numeric: tabular-nums; }
.field__hint .is-near { color: var(--warm); }
.field__error { font: 500 .875rem/1.45 var(--sans); color: var(--alarm); }

.choices { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .15rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 1px solid var(--ink-faint);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.choice label::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  box-shadow: inset 0 0 0 1px currentColor;
  opacity: .6;
}
.choice input:hover + label { border-color: color-mix(in srgb, var(--ink) 38%, transparent); }
.choice input:checked + label { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.choice input:checked + label::before { background: currentColor; opacity: 1; }
.choice input:focus-visible + label { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ── Thread */

.thread { margin: 0 0 2.75rem; padding: 0; list-style: none; border-top: 1px solid var(--ink-faint); }
.message { padding: 1.6rem 0 1.75rem; border-bottom: 1px solid var(--ink-faint); }
.message--staff { position: relative; padding-left: 1.25rem; }
.message--staff::before { content: ""; position: absolute; left: 0; top: 1.6rem; bottom: 1.75rem; width: 2px; background: var(--sky); }
.message__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .95rem; }
.message__head .avatar { width: 2rem; height: 2rem; }
.avatar--none { display: inline-block; width: 2rem; height: 2rem; box-shadow: inset 0 0 0 1px var(--ink-faint); background: none; }
.message__name { font: 600 1rem/1.3 var(--sans); overflow-wrap: anywhere; }
.message__time { margin-left: auto; font-size: .875rem; color: var(--ink-soft); }
.message__body {
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply { padding-top: .25rem; }
.closed-note { display: grid; justify-items: start; gap: 1rem; padding: 1.5rem 0; }
.closed-note > p { font: 400 1.125rem/1.4 var(--text); color: var(--ink-soft); }

.staff-tools { position: relative; margin-top: 3.5rem; padding-top: 1.6rem; }
.staff-tools::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink-faint); }

/* ── Motion */

@media (prefers-reduced-motion: no-preference) {
  .js .state:not([hidden]) { animation: desk-in .6s var(--ease) both; }
  .js .ticket,
  .js .message { animation: desk-in .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
  .js .ledger::before,
  .js .danger::before { animation: desk-draw 1s var(--ease) .15s both; }
  .flash:not([hidden]) { animation: flash-in .45s var(--ease) both; }
}
@keyframes desk-in {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes desk-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes flash-in {
  from { opacity: 0; transform: translate(-50%, .6rem); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Responsive */

@media (max-width: 820px) {
  .desk__head--split { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-direction: column; }
  .filters--scope { padding-left: 0; border-left: 0; }
  .ticket { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1rem; padding: 1rem 0; }
  .ticket__link { grid-column: 1 / -1; }
  .ticket .status { grid-row: 2; }
  .ticket__count { grid-row: 2; }
  .ledger__list > div { grid-template-columns: minmax(0, 1fr); }
  .message--staff { padding-left: 1rem; }
  .message__time { margin-left: 0; flex-basis: 100%; padding-left: 2.75rem; margin-top: -.35rem; }
}

/* ── Faces: Discord avatars sit in a hairline square; people without one get
   a Caslon initial instead of Discord's stock blue. */

.avatar,
.profile__avatar { border-radius: 0; box-shadow: 0 0 0 1px var(--ink-faint); }
.avatar--mono,
.profile__avatar:not(img) {
  display: inline-grid;
  place-items: center;
  background: var(--ink-wash);
  font: 400 1rem/1 var(--text);
  color: var(--ink);
}
.profile__avatar:not(img) { font-size: clamp(1.35rem, 5.2vw, 1.85rem); }
.message__head .avatar--mono { font-size: 1rem; }

/* ── Pause */

.pause {
  position: relative;
  margin: -.75rem 0 2.25rem;
  padding: 1.1rem 1.25rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--warm) 55%, transparent);
  background: color-mix(in srgb, var(--warm) 7%, transparent);
}
.pause__label {
  display: flex;
  align-items: center;
  gap: .6em;
  margin-bottom: .45rem;
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  color: var(--warm);
}
.pause__mark { width: 7px; height: 7px; flex: none; background: currentColor; }
.pause__text { max-width: 40rem; font: 400 1.0625rem/1.55 var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Owner panel */

.owner { position: relative; margin-top: clamp(3rem, 6vw, 4.25rem); padding-top: 1.6rem; }
.owner::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink-faint); }
.owner__form { max-width: 36rem; gap: 1.5rem; }
.field__optional { margin-left: .6em; font-weight: 500; color: var(--ink-soft); letter-spacing: .08em; }
.input--short { min-height: 5.5rem; }

.toggle { display: grid; gap: .5rem; }
.toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__label {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  justify-self: start;
  min-height: 2.75rem;
  font: 600 .875rem/1.2 var(--sans);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  cursor: pointer;
}
.toggle__track {
  position: relative;
  width: 2.6rem;
  height: 1.3rem;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent);
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.3rem - 6px);
  height: calc(1.3rem - 6px);
  background: var(--ink);
  transition: transform .4s var(--ease), background-color .35s var(--ease);
}
.toggle__input:checked + .toggle__label .toggle__track { background: var(--warm); border-color: var(--warm); }
.toggle__input:checked + .toggle__label .toggle__track::after { transform: translateX(1.3rem); background: var(--paper); }
.toggle__input:focus-visible + .toggle__label .toggle__track { outline: 1px solid var(--ink); outline-offset: 3px; }
.toggle__note { max-width: 34rem; font-size: .875rem; line-height: 1.55; color: var(--ink-soft); }

/* ── Claims in the list */

.ticket__claim { color: var(--ink-body); }
.ticket__claim--none { font-style: italic; color: var(--ink-soft); }
.filters--claim { padding-left: 1.5rem; border-left: 1px solid var(--ink-faint); }
.toolbar { align-items: baseline; }
.button--quiet { background: transparent; color: var(--ink); }
.button--quiet:hover,
.button--quiet:focus-visible { background: var(--ink); color: var(--paper); }

/* ── Attaching files */

.attach { display: grid; gap: .9rem; }
.attach__bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; }
.attach__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attach__hint { font-size: .875rem; color: var(--ink-soft); }
.attach__list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.attach__list:empty { display: none; }
.attach__item {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: .55rem .75rem .55rem .55rem;
  border: 1px solid var(--ink-faint);
  background: var(--field);
}
.attach__thumb {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--ink-faint);
}
.attach__thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
span.attach__thumb.attach__thumb--file { display: grid; place-items: center; }
.attach__ext { font: var(--meta); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
span.attach__thumb { position: relative; display: block; background: var(--ink-wash); }
.attach__meta { display: grid; gap: .1rem; min-width: 0; }
.attach__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.attach__sub { display: flex; gap: 1rem; font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.attach__item[data-state="done"] .attach__state { color: var(--sky); }
.attach__item[data-state="failed"] { border-color: color-mix(in srgb, var(--alarm) 55%, transparent); }
.attach__item[data-state="failed"] .attach__state { color: var(--alarm); }
.attach__remove {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: 0 .35rem;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: var(--meta);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  cursor: pointer;
}
.attach__remove:hover,
.attach__remove:focus-visible { color: var(--alarm); }
.attach__x { position: relative; width: .7rem; height: .7rem; flex: none; }
.attach__x::before,
.attach__x::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: currentColor; }
.attach__x::before { transform: rotate(45deg); }
.attach__x::after { transform: rotate(-45deg); }
.attach__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; }
.attach__bar-fill { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .3s var(--ease); }
.attach__item[data-state="done"] .attach__progress { display: none; }

.attach__big {
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding: 1.1rem 1.25rem;
  border-left: 2px solid var(--warm);
  background: color-mix(in srgb, var(--warm) 6%, transparent);
}
.attach__big-lede { max-width: 38rem; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.attach__ways { display: grid; gap: .6rem; margin: 0; }
.attach__ways > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .2rem 1rem; }
.attach__ways dt { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); padding-top: .3em; }
.attach__ways dd { margin: 0; font-size: 1rem; line-height: 1.6; }
.attach__ways a,
.attach__big-lede a { text-underline-offset: .2em; text-decoration-thickness: 1px; }

.form.is-dropping { outline: 1px dashed var(--ink); outline-offset: .75rem; }

/* ── Files in a thread */

.media { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.1rem; max-width: 42rem; }
.media__shot { display: block; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--ink-faint); transition: box-shadow .3s var(--ease); }
.media__shot:hover,
.media__shot:focus-visible { box-shadow: 0 0 0 1px var(--ink); }
.media__shot img { width: auto; height: 9rem; max-width: 100%; object-fit: cover; }
.media__video { flex: 1 1 100%; margin: 0; display: grid; gap: .45rem; }
.media__video video { width: 100%; max-height: 24rem; background: var(--code-bg); box-shadow: 0 0 0 1px var(--ink-faint); }
.media__video figcaption { display: flex; gap: 1rem; font-size: .875rem; color: var(--ink-soft); }
.media__file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  flex: 1 1 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--ink-faint);
  text-decoration: none;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.media__file:hover,
.media__file:focus-visible { border-color: var(--ink); background: var(--ink-wash); }
.media__glyph { position: relative; width: .8rem; height: 1rem; border: 1px solid currentColor; opacity: .7; }
.media__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.media__size { font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ── Staff tools */

.staff-tools__rows { display: grid; gap: 1.4rem; }
.staff-tools__row { display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: baseline; gap: .5rem 1.5rem; }
.staff-tools__label { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.staff-tools__row { align-items: center; }
.staff-tools__row .row-actions { align-items: center; gap: .75rem 1.25rem; }
.staff-tools__hint { font-size: .875rem; color: var(--ink-soft); }
.staff-tools__delete { display: grid; gap: 1rem; }

@media (max-width: 820px) {
  .filters--claim { padding-left: 0; border-left: 0; }
  .staff-tools__row { grid-template-columns: minmax(0, 1fr); }
  .attach__ways > div { grid-template-columns: minmax(0, 1fr); }
  .media__shot img { height: 7rem; }
  .attach__remove-label { display: none; }
}

/* ── Owner dashboard */

body[data-page="owner"] .desk { width: min(100% - (var(--edge) * 2), 66rem); }
.tabs { margin-bottom: 2.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--ink-faint); gap: .4rem 1.6rem; }
.tabs__count { color: var(--sky); letter-spacing: .08em; }
.pane__title { margin-bottom: 1.25rem; font: 400 1.5rem/1.2 var(--text); }
.pane__title--gap { margin-top: 3rem; }
.pane__lede { margin: -.5rem 0 1.5rem; max-width: 36rem; color: var(--ink-soft); font-size: 1rem; }
.pane__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.input--search { flex: 1 1 18rem; max-width: 26rem; }
.input--select { appearance: none; padding-right: 2.2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-soft) 50%); background-size: 5px 5px; background-position: right 1.05rem center, right .75rem center; background-repeat: no-repeat; }
.input--number { max-width: 9rem; font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(10rem, 1fr); gap: 1rem 1.25rem; }
.check { display: inline-flex; align-items: center; gap: .6rem; font-size: 1rem; cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--ink); }
.tag--banned { border-color: var(--alarm); color: var(--alarm); }
code { font: 400 .875rem/1.4 var(--mono); }

/* Figures */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--ink-faint); border-left: 1px solid var(--ink-faint); }
.figure { display: grid; align-content: start; gap: .65rem; padding: 1.3rem 1.25rem 1.4rem; border-right: 1px solid var(--ink-faint); border-bottom: 1px solid var(--ink-faint); }
.figure dd { margin: 0; display: grid; gap: .35rem; }
.figure__label { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.figure__value { font: 400 clamp(1.55rem, 5.6vw, 2.45rem)/1 var(--display); font-variant-numeric: lining-nums tabular-nums; text-decoration: none; }
a.figure__value:hover,
a.figure__value:focus-visible { color: var(--sky); }
.figure__note { font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.figure--warn .figure__value { color: var(--warm); }

/* People */
.people { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink-faint); }
.person-row { border-bottom: 1px solid var(--ink-faint); }
.person-row__main {
  display: grid;
  grid-template-columns: 8px 2rem minmax(0, 1.4fr) auto minmax(0, 1.1fr);
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .85rem .35rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .3s var(--ease);
}
.person-row__main:hover,
.person-row__main[aria-expanded="true"] { background: var(--ink-wash); }
.presence { width: 8px; height: 8px; box-shadow: inset 0 0 0 1px var(--ink-faint); transition: background-color .4s var(--ease); }
.person-row.is-online .presence { background: var(--sky); box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .person-row.is-online .presence { animation: discord-live 2.8s var(--ease) infinite; }
}
.person-row .avatar { width: 2rem; height: 2rem; }
.person-row__who { display: grid; gap: .1rem; min-width: 0; }
.person-row__name { font: 400 1.0625rem/1.3 var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row__handle { font-size: .875rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.person-row__tags { display: flex; gap: .4rem; }
.person-row__meta { display: grid; gap: .1rem; justify-items: end; text-align: right; font-size: .875rem; color: var(--ink-soft); }
.seen--on { color: var(--sky); font-weight: 500; }
.person-row.is-banned .person-row__name { text-decoration: line-through; text-decoration-color: var(--alarm); }

.person { display: grid; gap: 1.75rem; padding: 1.25rem 1.1rem 1.75rem 3.4rem; background: var(--ink-wash); }
.person__facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.person__facts dt { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.person__facts dd { margin: .2rem 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.person__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }
.person__h { margin: 0 0 .7rem; font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; }
.person__list { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; }
.person__list a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
.person__list .tag { margin-left: .5rem; }
.person__none,
.person__note { font-size: .875rem; color: var(--ink-soft); }
.person__note { margin-top: .75rem; }
.person__actions { display: grid; gap: 1.25rem; padding-top: 1.4rem; border-top: 1px solid var(--ink-faint); }
.person__ban { display: grid; gap: 1rem; }
.person__wipe { display: grid; gap: 1rem; max-width: 36rem; padding: 1.1rem 1.25rem; border-left: 2px solid var(--alarm); background: color-mix(in srgb, var(--alarm) 6%, transparent); }
.person__wipe > p { font-size: 1rem; line-height: 1.55; }
.person__banned { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; color: var(--alarm); }

/* Bans */
.bans { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink-faint); }
.ban { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: .5rem 1.25rem; padding: .9rem .25rem; border-bottom: 1px solid var(--ink-faint); font-size: .875rem; color: var(--ink-soft); }
.ban.is-active { color: var(--ink); }
.ban__what { display: grid; gap: .15rem; overflow-wrap: anywhere; }
.ban__kind { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.ban.is-active .ban__kind { color: var(--alarm); }
.ban__why { overflow-wrap: anywhere; }

/* Limits */
.limits__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem 2rem; }
.limits { max-width: none; }

/* Activity */
.audit { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink-faint); }
.audit__row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem; padding: .8rem .25rem; border-bottom: 1px solid var(--ink-faint); font-size: 1rem; line-height: 1.5; }
.audit__time { font-size: .875rem; color: var(--ink-soft); padding-top: .1rem; }
.audit__what { overflow-wrap: anywhere; }
.audit__what strong { font-weight: 600; }
.audit__target { font-family: var(--text); }
.audit__detail { display: block; font-size: .875rem; color: var(--ink-soft); }
[data-audit-more] { margin-top: 1.5rem; }

/* New messages while scrolled up */
.jump {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .75rem 1.15rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: 600 .75rem/1 var(--sans);
  letter-spacing: var(--tracked);
  text-transform: uppercase;
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateX(-50%);
}
.arrow--down { transform: rotate(90deg); }
@media (prefers-reduced-motion: no-preference) {
  .jump:not([hidden]) { animation: flash-in .45s var(--ease) both; }
  .js .person-row { animation: desk-in .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
}

@media (max-width: 820px) {
  .person-row__main { grid-template-columns: 8px 2rem minmax(0, 1fr); }
  .person-row__tags,
  .person-row__meta { grid-column: 3; justify-items: start; text-align: left; }
  .person { padding: 1.1rem .9rem 1.5rem; }
  .person__cols,
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .ban { grid-template-columns: minmax(0, 1fr); }
  .audit__row { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.check { align-items: flex-start; }
.check input { margin-top: .3rem; flex: none; }
.check__note { display: block; margin-top: .15rem; font-size: .875rem; line-height: 1.5; color: var(--ink-soft); }

/* ── Selection lock
   The site's text is not selectable and the context menu is off, by request.
   The exceptions below are the places where selecting or right-clicking is
   how the site works at all: anything you type into, the commands in the
   guidebook, what people write on a ticket, and the identifiers staff copy
   out of the owner dashboard. */

html {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select,
[contenteditable="true"],
.selectable {
  -webkit-user-select: text;
  user-select: text;
}

.message__body,
.ticket__ref,
.media__name,
.attach__name,
.person-row__handle,
.person__facts dd,
.person__list,
.audit__target,
.ban__what,
.ban__why,
code {
  -webkit-user-select: text;
  user-select: text;
}

/* ── Bug hunters */
.bh-meta { margin: 0 0 1.1rem; font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.bh-list { display: grid; gap: 1.1rem; margin: 0; padding: 0; list-style: none; }
.bh-list > li { display: grid; gap: .3rem; max-width: 40rem; }
.bh-list .bh-meta { margin: 0; }
.bh-item { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-body); line-height: 1.6; }
.bh-form { margin-top: 1.4rem; max-width: 36rem; }
.bh-form .row-actions { margin-top: 1rem; }
.bh-code { font: 400 1.25rem/1.3 var(--text); letter-spacing: .12em; color: var(--ink); white-space: nowrap; }

/* ── Ticket shell: Discord-shaped desk (both themes)
   The list, ticket and new-ticket pages carry body.app--shell. Sidebar of
   tickets, the conversation in the middle, details on the right. Only the
   inner areas scroll. Colours and type come from each theme's skin below. */

body.app--shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.app--shell .shell {
  --side-w: 20rem; --info-w: 18rem; --bar-h: 3.5rem;
  position: relative; z-index: 2;
  flex: 1 1 auto; min-height: 0; overflow-x: clip;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
}
.app--shell .shell__notices { grid-column: 1 / -1; grid-row: 1; }
.app--shell .shell__notice { margin: 0; padding: .75rem 1.5rem; border-width: 0 0 1px; }
.app--shell .shell__notice .pause__label { margin-bottom: .2rem; }
.app--shell .shell__notice .pause__text { font-size: .9375rem; }
.app--shell .shell.has-side ~ .foot { display: none; }

/* Sidebar */
.app--shell .side { position: relative; top: auto; z-index: 3; align-self: stretch; grid-row: 2; grid-column: 1; width: var(--side-w); min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--ink-faint); }
.app--shell .side__head { padding: 1.25rem 1rem 1rem; }
.app--shell .side__meta { margin-bottom: .35rem; }
.app--shell .side__new { flex: none; margin: 0 .75rem 1rem; }
.app--shell .side__notice { flex: none; margin: 0 .75rem 1rem; padding: .75rem 0; font-size: .8125rem; line-height: 1.55; }
.app--shell .find { flex: none; position: relative; margin: 0 .75rem .75rem; }
.app--shell .find__input { width: 100%; min-height: 2.5rem; padding: .5rem .75rem; border-radius: 0; color: var(--ink); }
.app--shell .find__input::-webkit-search-cancel-button { filter: grayscale(1); }
.app--shell .side__filters { flex: none; display: grid; gap: .5rem; padding: 0 1rem .75rem; border-bottom: 1px solid var(--ink-faint); }
.app--shell .side__staff > summary { display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; cursor: pointer; list-style: none; white-space: nowrap; }
.app--shell .side__staff > summary::-webkit-details-marker { display: none; }
.app--shell .side__staff > summary::before { content: "+"; flex: none; width: 1ch; text-align: center; }
.app--shell .side__staff[open] > summary::before { content: "\2212"; }
.app--shell .side__staff > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.app--shell .side__sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.app--shell .side__grid { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: .25rem .75rem; padding: 0 0 .25rem; }
.app--shell .side__staff .chips { padding-left: .45rem; }
.app--shell .chips { gap: .25rem 1.1rem; padding-left: .45rem; }
.app--shell .chips a { display: inline-flex; align-items: center; min-height: 2rem; padding: .25rem 0; }
.app--shell .side__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: .75rem; }
.app--shell .side__groups[aria-busy="true"] { opacity: .5; transition: opacity .3s var(--ease); }
.app--shell .side__none { padding: 1.25rem 1rem; font-size: .875rem; color: var(--ink-soft); }
.app--shell .side__empty { padding: 1.5rem 1rem; }

.app--shell .group__title { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: .6rem; padding: 1.25rem 1rem .5rem; }
.app--shell .tickets { margin: 0; padding: 0; list-style: none; border: 0; }
.app--shell .ticket { display: block; margin: .125rem .5rem; padding: 0; border: 0; }
.app--shell .ticket:hover { background: none; }
.app--shell .ticket:has(.ticket__link:focus-visible) { outline: 0; }
.app--shell .ticket__link {
  position: relative;
  display: grid;
  grid-template-columns: .5rem minmax(0, 1fr);
  grid-template-areas: "dot subj" ". meta" ". extra";
  align-items: center;
  column-gap: .75rem; row-gap: .125rem;
  min-height: 3.75rem; padding: .75rem 1rem;
  text-decoration: none;
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.app--shell .ticket__link::before { content: none; }
.app--shell .ticket__link:hover { background: var(--ink-wash); }
.app--shell .ticket__link:focus-visible { outline: 1px solid var(--ink); outline-offset: -2px; }
.app--shell .ticket__dot { grid-area: dot; width: 8px; height: 8px; }
.app--shell .ticket__subject { grid-area: subj; min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.app--shell .ticket__dot { align-self: start; margin-top: .45rem; }
.app--shell .ticket__subject::before { content: none; }
.app--shell .ticket__stats { margin-left: auto; display: inline-flex; gap: .75rem; white-space: nowrap; }
.app--shell .ticket__count::before { content: ""; display: inline-block; width: .55rem; height: .45rem; margin-right: .35rem; border: 1px solid currentColor; vertical-align: .05em; opacity: .8; }
.app--shell .ticket__meta { grid-area: meta; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The group heading shows the status; the row keeps it for screen readers. */
.app--shell .ticket__meta .status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app--shell .ticket__extra { grid-area: extra; min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .75rem; overflow-wrap: anywhere; }
.app--shell .ticket__meta > * + :not(.status):not(.ticket__ref)::before { content: "·"; margin: 0 .5em; opacity: .7; }

/* User panel */
.app--shell .me {
  flex: none;
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; column-gap: .75rem; row-gap: .15rem;
  min-height: 3.75rem; padding: .5rem 1rem;
  border-top: 1px solid var(--ink-faint);
}
.app--shell .me__face { width: 2rem; height: 2rem; grid-row: 1 / span 2; align-self: start; margin-top: .15rem; }
.app--shell .me__who { display: grid; min-width: 0; }
.app--shell .me__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app--shell .me__role:empty { display: none; }
.app--shell .me__links { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.app--shell .me__links a { display: inline-flex; align-items: center; min-height: 1.5rem; text-decoration: none; }
.app--shell .me__discord { grid-column: 2 / -1; min-width: 0; overflow: hidden; white-space: nowrap; }
.app--shell .me__discord [data-discord-text] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Pane */
.app--shell .pane { grid-row: 2; grid-column: 2; position: relative; width: auto; margin: 0; padding: 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.app--shell .pane__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.app--shell .pane > .state:not(.chat),
.app--shell .pane__scroll > .state:not([data-state="ready"]) { margin: auto; padding: 2rem 1.5rem; width: 100%; max-width: 36rem; }
.app--shell .pane__scroll > .state[data-state="ready"] { width: 100%; max-width: 44rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.app--shell .pane--home > .state[data-state="ready"] { margin: auto; }
.app--shell .home { margin: auto; display: grid; justify-items: center; gap: .75rem; text-align: center; padding: 2rem 1.5rem; max-width: 30rem; }
.app--shell .home__glyph { width: 1em; height: 1em; display: grid; place-items: center; line-height: 1; margin-bottom: .5rem; }

/* Header bar */
.app--shell .bar { flex: none; display: flex; align-items: center; gap: .75rem; min-height: var(--bar-h); padding: 0 1.5rem; border-bottom: 1px solid var(--ink-faint); }
.app--shell .bar__back { display: none; margin: 0; flex: none; min-height: 2.75rem; }
.app--shell .bar__status { flex: none; display: inline-flex; }
.app--shell .bar__title { min-width: 6rem; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app--shell .bar__meta { min-width: 0; flex: 0 1000 auto; display: flex; align-items: center; gap: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app--shell .bar__meta::before { content: ""; flex: none; width: 1px; height: 1.25rem; background: var(--ink-faint); }
.app--shell .bar__meta:empty { display: none; }
.app--shell .bar__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex: none; }
.app--shell .bar__icon {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.app--shell .bar__icon .clip { width: 1.15rem; height: 1.15rem; }
.app--shell .bar__icon:hover,
.app--shell .bar__icon:focus-visible,
.app--shell .bar__icon[aria-expanded="true"] { color: var(--ink); }
.app--shell .bar__icon[aria-expanded="true"] { background: var(--ink-wash); }
.app--shell .bar__icon:focus-visible { outline-offset: -2px; }

/* Conversation */
.app--shell .chat:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; }
.app--shell .chat__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.app--shell .chat__scroll:focus { outline: 0; }
.app--shell .chat__scroll:focus-visible { outline: 1px solid var(--ink); outline-offset: -2px; }
.app--shell .thread { margin: auto 0 0; padding: 1.5rem 0 1rem; border: 0; list-style: none; }
.app--shell .start { padding: 2rem 1.5rem 1rem; display: grid; justify-items: start; gap: .5rem; }
.app--shell .start__glyph { display: grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: .5rem; line-height: 1; }
.app--shell .start__title { overflow-wrap: anywhere; text-wrap: balance; }
.app--shell .start__text { max-width: 46rem; }
.app--shell .day { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 1.5rem .5rem; }
.app--shell .day::before,
.app--shell .day::after { content: ""; flex: 1; height: 1px; background: var(--ink-faint); }
.app--shell .message {
  position: relative;
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 1rem;
  margin: 1.25rem 0 0; padding: .125rem 1.5rem; border: 0;
  transition: background-color .2s var(--ease);
}
.app--shell .day + .message { margin-top: .5rem; }
.app--shell .message--cont { margin-top: 0; }
.app--shell .message:hover,
.app--shell .message:focus-within { background: var(--ink-wash); }
.app--shell .message--staff { padding-left: 1.5rem; }
.app--shell .message--staff::before { content: none; }
.app--shell .message > .avatar { grid-column: 1; grid-row: 1 / span 2; align-self: start; width: 2.5rem; height: 2.5rem; margin-top: .15rem; }
.app--shell .message__head { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; margin: 0 0 .1rem; }
.app--shell .message__time { margin: 0; padding: 0; flex-basis: auto; }
.app--shell .message__gutter { grid-column: 1; grid-row: 1; justify-self: end; align-self: start; padding-top: .3rem; white-space: nowrap; opacity: 0; transition: opacity .15s var(--ease); }
.app--shell .message:hover .message__gutter,
.app--shell .message:focus-within .message__gutter { opacity: 1; }
.app--shell .message__body { grid-column: 2; max-width: 46rem; }
.app--shell .message .media { grid-column: 2; margin: .5rem 0 .25rem; max-width: 46rem; }

/* Markdown in messages (built by mdNodes in ui/app.js) */
.md-h { margin: .5rem 0 .15rem; font: 600 1.375rem/1.3 var(--sans); color: var(--ink); white-space: normal; }
.md-h2 { font-size: 1.1875rem; }
.md-h3 { font-size: 1.0625rem; }
.md-sub { display: block; font-size: .8125rem; line-height: 1.5; color: var(--ink-soft); }
.md-quote { margin: .2rem 0; padding: 0 0 0 .85rem; border-left: 3px solid var(--ink-faint); }
.md-list { margin: .15rem 0; padding-left: 1.4rem; white-space: normal; list-style: disc; }
ol.md-list { padding-left: 1.75rem; list-style: decimal; }
ul.md-list ul.md-list { list-style: circle; }
.md-list > li { margin: .1rem 0; white-space: pre-wrap; }
.md-list .md-list { margin: 0; }
.md-code { padding: .05em .35em; border: 1px solid var(--ink-faint); background: var(--ink-wash); font: 400 .875em/1.4 var(--mono); color: var(--ink); }
.md-pre { margin: .4rem 0; border: 1px solid var(--ink-faint); background: var(--ink-wash); }
.md-pre__lang { display: block; padding: .35rem .75rem 0; font: 400 .75rem/1.4 var(--mono); letter-spacing: .06em; color: var(--ink-soft); }
.md-pre pre { margin: 0; padding: .45rem .75rem .6rem; overflow-x: auto; font: 400 .875rem/1.55 var(--mono); color: var(--ink); white-space: pre; tab-size: 4; }
.md-pre code { font: inherit; }
.md-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-soft); text-underline-offset: .18em; overflow-wrap: anywhere; }
.md-link:hover { text-decoration-color: var(--warm); }
.md-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.md-spoiler { background: var(--ink-soft); cursor: pointer; transition: background .2s; }
.md-spoiler:hover { background: var(--ink); }
.md-spoiler:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.md-spoiler:not(.is-shown) .md-spoiler__text { visibility: hidden; }
.md-spoiler.is-shown { background: var(--ink-wash); cursor: auto; }

/* Composer */
.app--shell .composer { flex: none; position: relative; display: block; padding: .5rem 1.5rem 1.25rem; }
.app--shell .composer .attach { display: grid; gap: .5rem; }
.app--shell .composer .attach__list { margin-bottom: .5rem; }
.app--shell .composer .attach__big { margin-bottom: .5rem; }
.app--shell .composer .attach > .field__error:not([hidden]) { margin-bottom: .5rem; }
.app--shell .composer__box { display: flex; align-items: flex-end; gap: .5rem; min-height: 3.25rem; padding: .375rem; border: 1px solid var(--ink-faint); background: var(--field); transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.app--shell .composer__attach {
  flex: none; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--ink-faint); background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.app--shell .composer__attach .clip { width: 1.15rem; height: 1.15rem; }
.app--shell .composer__attach:hover,
.app--shell .composer__attach:focus-visible { color: var(--ink); border-color: var(--ink); }
.app--shell .composer__input { flex: 1; min-width: 0; min-height: 2.75rem; max-height: 40vh; padding: .6rem .25rem; border: 0; background: none; color: var(--ink); resize: none; field-sizing: content; }
.app--shell .composer__input:focus { outline: 0; }
.app--shell .composer__input::placeholder { color: var(--ink-soft); opacity: 1; }
.app--shell .composer__send { flex: none; min-width: 6.5rem; min-height: 2.75rem; }
.app--shell .composer__help { margin-top: .4rem; font-size: .8125rem; }
.app--shell .composer__error { margin-top: .25rem; }
.app--shell .composer.is-dropping { outline: 0; }
.app--shell .composer.is-dropping .composer__box { outline: 1px dashed var(--ink); outline-offset: .35rem; }
.app--shell .jump { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 100%; z-index: 5; display: flex; justify-content: space-between; transform: none; }
.app--shell .composer-lock { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: .5rem 1.5rem 1.25rem; padding: 1rem 1.25rem; border: 1px solid var(--ink-faint); }
.app--shell .composer-lock[hidden] { display: none; }

/* Details panel */
.app--shell .info { grid-row: 2; grid-column: 3; width: var(--info-w); min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem 1.25rem; border-left: 1px solid var(--ink-faint); }
.app--shell .shell[data-info="closed"] .info { display: none; }
.app--shell .info__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.app--shell .info__title:focus { outline: 0; }
.app--shell .info__title:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.app--shell .info__close { display: none; }
.app--shell .info__list { display: grid; gap: .875rem; margin: 0; }
.app--shell .info__list > div { display: grid; gap: .2rem; }
.app--shell .info__list dd { margin: 0; overflow-wrap: anywhere; }
.app--shell .info__section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--ink-faint); }
.app--shell .info__section::before { content: none; }
.app--shell .info .staff-tools__rows { gap: 1.5rem; }
.app--shell .info .staff-tools__row { grid-template-columns: minmax(0, 1fr); gap: .6rem; align-items: start; }
.app--shell .info [data-set-status] { display: grid; gap: .25rem; }
.app--shell .info [data-set-status] button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 2.75rem; padding: .5rem .75rem; text-align: left; }
.app--shell .info [data-set-status] button::before,
.app--shell .info [data-set-status] button::after { position: static; }
.app--shell .info .row-actions { display: grid; gap: .75rem; }
.app--shell .info .row-actions > .button { width: 100%; padding-inline: .75rem; font-size: .75rem; }

/* Toast below the header */
.app--shell .flash { position: absolute; top: calc(var(--bar-h) + .75rem); bottom: auto; }

@media (prefers-reduced-motion: no-preference) {
  .app--shell .jump:not([hidden]) { animation: jump-in .4s var(--ease) both; }
  .app--shell .thread.is-settled .message { animation: none; }
  .app--shell .composer__input { transition: none; }
}

/* Mid widths: details float over the conversation */
@media (max-width: 1239px) {
  .app--shell .shell { --side-w: 18.5rem; }
  .app--shell .info { grid-column: 1 / -1; position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: min(var(--info-w), 100%); box-shadow: var(--shadow); }
  .app--shell .info__close { display: inline-flex; }
  @media (prefers-reduced-motion: no-preference) {
    .app--shell .info:not([hidden]) { animation: info-in .35s var(--ease) both; }
  }
}
@keyframes jump-in { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: none; } }
@keyframes info-in { from { opacity: 0; transform: translateX(1rem); } to { opacity: 1; transform: none; } }

/* Phones: one view at a time, as on Discord mobile */
@media (max-width: 820px) {
  .app--shell .shell { grid-template-columns: minmax(0, 1fr); }
  .app--shell .side { grid-column: 1; width: auto; border-right: 0; }
  .app--shell .pane { grid-column: 1; }
  .app--shell .info { grid-column: 1; inset: 0; width: auto; border-left: 0; }
  body[data-page="ticket"].app--shell .side,
  body[data-page="new"].app--shell .side { display: none !important; }
  body[data-page="tickets"].app--shell .shell.has-side > .pane { display: none; }
  body[data-page="tickets"].app--shell .side { overflow-y: auto; overscroll-behavior: contain; }
  body[data-page="tickets"].app--shell .side__list { flex: 1 0 auto; overflow: visible; }
  body[data-page="tickets"].app--shell .me { position: sticky; bottom: 0; z-index: 2; background: inherit; }
  .app--shell .bar { padding: 0 .75rem; gap: .5rem; }
  .app--shell .bar__back { display: inline-flex; }
  .app--shell .start { padding: 1.5rem .75rem 1rem; }
  .app--shell .day { margin-inline: .75rem; }
  .app--shell .message { grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: .75rem; padding-inline: .75rem; }
  .app--shell .message > .avatar { width: 2.25rem; height: 2.25rem; }
  .app--shell .composer { padding: .5rem .75rem .75rem; }
  .app--shell .jump { left: .75rem; right: .75rem; }
  .app--shell .composer-lock { margin: .5rem .75rem .75rem; }
  .app--shell .composer__help .attach__hint { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app--shell .composer__send { min-width: 0; }
  .app--shell .pane__scroll > .state[data-state="ready"] { padding: 1.25rem .75rem 2rem; }
  .app--shell .pane > .state:not(.chat),
  .app--shell .pane__scroll > .state:not([data-state="ready"]) { padding: 2rem 1rem; }
  .app--shell .media__shot img { height: 7rem; }
}
@media (max-width: 600px) {
  .app--shell .bar__meta { display: none; }
  .app--shell .bar { flex-wrap: wrap; row-gap: 0; padding-block: .25rem .6rem; }
  .app--shell .bar__title { order: 5; flex: 1 1 100%; padding-inline: .25rem; }
  .app--shell .bar__glyph + .bar__title { order: 0; flex: 0 1 auto; }
  .app--shell .pane--form .bar { padding-block: 0; }
  .app--shell .composer__send::after { content: none; }
  .app--shell .bar__actions { gap: .25rem; }
  .app--shell .bar__actions .button { min-height: 2.5rem; padding-inline: .65rem; letter-spacing: .03em; }
  .app--shell .bar .status { letter-spacing: .04em; }
}
@media (pointer: coarse) {
  .app--shell .chips a,
  .app--shell .me__links a { min-height: 2.75rem; min-width: 2.75rem; justify-content: center; }
  .app--shell .bar__back { min-width: 2.75rem; justify-content: center; margin-left: -.5rem; }
  .app--shell .find__input { min-height: 2.75rem; }
  .app--shell .bar__actions .button--small,
  .app--shell .bar__actions .button,
  .app--shell .composer .action--quiet,
  .app--shell .pane--form .action--quiet { min-height: 2.75rem; }
  .app--shell .me__links { flex-direction: row; gap: .25rem .75rem; }
}
@media (hover: none) and (pointer: coarse) {
  .app--shell .composer__keys { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 400px) {
  .app--shell .bar { column-gap: .375rem; }
  .app--shell .bar__back { margin-left: -.75rem; }
  .app--shell .bar__actions .button { padding-inline: .5rem; letter-spacing: 0; }
  .app--shell .bar__back-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Very short screens: back to page scrolling, the composer pinned to the bottom */
@media (max-height: 30rem) {
  body.app--shell { height: auto; overflow: visible; }
  .app--shell .shell { min-height: calc(100dvh - var(--mast-h, 4rem)); }
  .app--shell .side__list,
  .app--shell .chat__scroll,
  .app--shell .pane__scroll,
  .app--shell .info { overflow: visible; }
  .app--shell .composer { position: sticky; bottom: 0; z-index: 4; background: var(--paper); }
}

.ticket__subject,
.bar__title,
.start__title { -webkit-user-select: text; user-select: text; }

/* ── Ticket shell skin: The Sounding. Paper grounds, ink hairlines, Caslon
   for what people wrote, Archivo for the controls; a 2px warm bar marks the
   one you are on. Every colour is a token, so dark mode comes with it. */

.app--shell .side,
.app--shell .info { background: var(--paper-cool); }
.app--shell .bar { background: var(--paper); }

.app--shell .side__meta { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.app--shell .side__title { font: 400 1.5rem/1.15 var(--display); letter-spacing: -.005em; color: var(--ink); }

body[data-page="ticket"] .side__new,
body[data-page="new"] .side__new { background: transparent; color: var(--ink); }
body[data-page="ticket"] .side__new:hover,
body[data-page="ticket"] .side__new:focus-visible,
body[data-page="new"] .side__new:not(.is-current):hover,
body[data-page="new"] .side__new:not(.is-current):focus-visible { background: var(--ink); color: var(--paper); }
.app--shell .side__new.is-current { background: var(--ink-wash); color: var(--ink); border-color: var(--ink-faint); box-shadow: inset 2px 0 0 var(--warm); cursor: default; }

.app--shell .find__input { border: 1px solid var(--ink-faint); background: var(--field); font: 500 .875rem/1.4 var(--sans); transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.app--shell .find__input:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.app--shell .find__input:focus { outline: 0; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.app--shell .find__input::placeholder { color: var(--ink-soft); opacity: 1; }

.app--shell .chips a { font-size: .6875rem; }
.app--shell .side__label { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }

.app--shell .group__title { background: var(--paper-cool); font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.app--shell .group__count { color: var(--sky); font-variant-numeric: tabular-nums; }

.app--shell .ticket__dot--open { background: var(--sky); }
.app--shell .ticket__dot--pending { background: var(--warm); }
.app--shell .ticket__dot--closed { box-shadow: inset 0 0 0 1px var(--ink-soft); }
.app--shell .ticket__subject { font: 400 1.0625rem/1.35 var(--text); color: var(--ink); }
.app--shell .ticket.is-closed .ticket__subject { color: var(--ink-soft); }
.app--shell .ticket__meta,
.app--shell .ticket__extra,
.app--shell .ticket__when,
.app--shell .ticket__count { font: 500 .8125rem/1.4 var(--sans); color: var(--ink-soft); }
.app--shell .ticket__count { font-variant-numeric: tabular-nums; }
.app--shell .ticket.is-current .ticket__link { background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: inset 2px 0 0 var(--warm); }

.app--shell .me__face { border-radius: 0; box-shadow: 0 0 0 1px var(--ink-faint); }
.app--shell .me__name { font: 600 .875rem/1.3 var(--sans); color: var(--ink); }
.app--shell .me__role { font: var(--meta); font-size: .625rem; letter-spacing: var(--tracked); text-transform: uppercase; color: var(--sky); }
.app--shell .me__links a { font: var(--meta); font-size: .625rem; letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); transition: color .25s var(--ease); }
.app--shell .me__links a:hover,
.app--shell .me__links a:focus-visible { color: var(--ink); }
.app--shell .me__discord { font-size: .75rem; }

.app--shell .bar__back { gap: .5em; }
.app--shell .bar__title { font: 400 1.25rem/1.25 var(--text); color: var(--ink); }
.app--shell .bar__meta { font: 500 .8125rem/1.3 var(--sans); color: var(--ink-soft); }
.app--shell .bar__glyph { font: 400 1.6rem/1 var(--display); color: var(--ink-soft); }

.app--shell .home__glyph { font: 400 clamp(3rem, 8vw, 5rem)/1 var(--display); color: var(--ink-faint); }
.app--shell .home__title { font: 400 1.75rem/1.2 var(--display); color: var(--ink); }
.app--shell .home__text { font: 400 1rem/1.65 var(--text); color: var(--ink-soft); text-wrap: pretty; }

.app--shell .start__glyph { font: 400 2.6rem/1 var(--display); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-faint); background: var(--paper-cool); }
.app--shell .start__title { font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.12 var(--display); letter-spacing: -.01em; color: var(--ink); }
.app--shell .start__text { font-size: 1rem; line-height: 1.65; color: var(--ink-soft); text-wrap: pretty; }
.app--shell .day { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }

.app--shell .message__head { margin-bottom: .15rem; }
.app--shell .message__name { font: 600 1rem/1.3 var(--sans); color: var(--ink); }
.app--shell .message--staff .message__name { color: var(--sky); }
.app--shell .message__time,
.app--shell .message__gutter { font: 500 .75rem/1.4 var(--sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.app--shell .message__gutter { font-size: .6875rem; }
.app--shell .message > .avatar--mono { font-size: 1.1rem; }

.app--shell .composer__box:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.app--shell .composer__input { font: 400 1rem/1.6 var(--text); }
.app--shell .composer__send { padding-inline: 1.15rem; }
.app--shell .composer__help { font-family: var(--sans); color: var(--ink-soft); }

.app--shell .composer-lock { background: var(--paper-cool); border: 0; border-left: 2px solid var(--warm); }
.app--shell .composer-lock > p { font: 400 1.0625rem/1.5 var(--text); color: var(--ink-body); }

.app--shell .jump { align-items: center; gap: 1rem; padding: .75rem 1.15rem; }
.app--shell .jump__go { margin-left: auto; color: var(--ink-soft); transition: color .25s var(--ease); }
.app--shell .jump:hover .jump__go,
.app--shell .jump:focus-visible .jump__go { color: var(--ink); }
.app--shell .jump .arrow--down { flex: none; }

.app--shell .info__title { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.app--shell .info__list dt { font: var(--meta); letter-spacing: var(--tracked); text-transform: uppercase; color: var(--ink-soft); }
.app--shell .info__list dd { font: 400 1rem/1.5 var(--text); color: var(--ink-body); }
.app--shell .info .ledger__title { margin-bottom: 1rem; }
.app--shell .info [data-set-status] button { box-shadow: inset 0 0 0 1px var(--ink-faint); }
.app--shell .info [data-set-status] button::after { content: none; }
.app--shell .info [data-set-status] button:hover { background: var(--ink-wash); }
.app--shell .info [data-set-status] [aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink-faint), inset 2px 0 0 var(--warm); }

.app--shell .shell__notice { border-color: color-mix(in srgb, var(--warm) 55%, transparent); }

@media (max-width: 1239px) {
  .app--shell .info { background: var(--paper); }
}
@media (min-width: 821px) and (max-width: 1239px) {
  .app--shell .info { border-left: 1px solid var(--ink-faint); }
}
@media (max-height: 30rem) {
  .app--shell .composer { background: var(--paper); }
}

/* ── Unread markers and transcript events (shared by both skins: only tokens
   both themes define). Unread is --warm, as on the notifications page. */
.app--shell .ticket.is-unread .ticket__link {
  grid-template-columns: .5rem minmax(0, 1fr) auto;
  grid-template-areas: "dot subj unread" ". meta meta" ". extra extra";
}
.app--shell .ticket.is-unread .ticket__subject { color: var(--ink); font-weight: 600; }
.app--shell .ticket__unread {
  grid-area: unread; align-self: start;
  min-width: 1.5rem; padding: .1rem .4rem; border-radius: 999px;
  background: var(--warm); color: var(--paper);
  font-size: .75rem; line-height: 1.3; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}
.app--shell .day--new { color: var(--warm); }
.app--shell .day--new::before,
.app--shell .day--new::after { background: var(--warm); }
.app--shell .day--new .day__label { color: var(--warm); font-weight: 600; }
.app--shell .event {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 1rem; align-items: center;
  margin: .75rem 0 0; padding: .25rem 1.5rem;
  color: var(--ink-soft); font-size: .875rem;
}
.app--shell .event + .event { margin-top: .25rem; }
.app--shell .event__mark { justify-self: center; width: .625rem; height: .625rem; border: 1px solid currentColor; border-radius: 50%; }
.app--shell .event--closed .event__mark { background: var(--ink-soft); }
.app--shell .event--open .event__mark,
.app--shell .event--pending .event__mark { border-color: var(--warm); }
.app--shell .event__text { margin: 0; overflow-wrap: anywhere; }
.app--shell .event__who { color: var(--ink); font-weight: 600; }
.app--shell .event__time { margin-left: .25rem; opacity: .75; font-size: .8125rem; }
@media (max-width: 820px) {
  .app--shell .event { grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: .75rem; padding-inline: .75rem; }
}

/* Editing and deleting a message: a small toolbar on hover or focus, like Discord's. */
.app--shell .message__tools {
  position: absolute; top: -.85rem; right: 1.5rem; z-index: 1;
  display: flex; gap: 1px; padding: 1px;
  border: 1px solid var(--ink-faint); background: var(--paper);
  opacity: 0; pointer-events: none; transition: opacity .15s var(--ease);
}
.app--shell .message:hover .message__tools,
.app--shell .message:focus-within .message__tools { opacity: 1; pointer-events: auto; }
.app--shell .message__tool {
  min-height: 2rem; padding: .25rem .65rem; border: 0; background: none; color: var(--ink-soft);
  font: 500 .8125rem/1.2 var(--sans); cursor: pointer;
}
.app--shell .message__tool:hover,
.app--shell .message__tool:focus-visible { background: var(--ink); color: var(--paper); }
.app--shell .message__tool--danger { color: var(--alarm); }
.app--shell .message__tool--danger:hover,
.app--shell .message__tool--danger:focus-visible { background: var(--alarm); color: var(--paper); }
.app--shell .message__edited { margin-left: .35rem; color: var(--ink-soft); font-size: .75rem; }
.app--shell .message__edit { grid-column: 2; max-width: 46rem; margin: .25rem 0 .35rem; }
.app--shell .message__edit-input {
  display: block; width: 100%; min-height: 2.75rem; max-height: 50vh; padding: .6rem .75rem;
  border: 1px solid var(--ink-faint); background: var(--field); color: var(--ink);
  font: inherit; resize: vertical; field-sizing: content;
}
.app--shell .message__edit-input:focus { outline: 0; border-color: var(--warm); }
.app--shell .message__edit-hint { margin: .35rem 0 0; color: var(--ink-soft); font-size: .75rem; }
.app--shell .message__link { padding: 0; border: 0; background: none; color: var(--warm); font: inherit; cursor: pointer; }
.app--shell .message__link:hover,
.app--shell .message__link:focus-visible { text-decoration: underline; }
@media (hover: none) {
  .app--shell .message__tools { position: static; grid-column: 2; justify-self: start; margin: .25rem 0; opacity: 1; pointer-events: auto; }
}
@media (max-width: 820px) {
  .app--shell .message__tools { right: .75rem; }
}
