/* Layout: a building's wayfinding system. Directory board on the left, the floor in the
   middle, conversation on the right. Yellow plates mark "you are here" and the main action. */
:root {
  --paper: #e9edf1;
  --panel: #ffffff;
  --panel-2: #f2f5f7;
  --ink: #16202b;
  --ink-2: #51606f;
  --line: #d5dce3;
  --sign: #f5b800;
  --sign-ink: #16202b;
  --focus: #1f5fd1;
  --ok: #2e9e5b;
  --busy: #d9463b;
  --idle: #8e9aa7;
  --scrim: rgba(13, 18, 24, 0.46);
  --tag: rgba(255, 255, 255, 0.94);
  --shadow: 0 6px 22px rgba(22, 32, 43, 0.16);
  /* One set of sizes for every control: small (inline tools, chips), regular, large (the dock, the main action). */
  --h-sm: 28px;
  --h-md: 36px;
  --h-lg: 40px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  /* The conversation you have open, in the sidebar. */
  --current-bg: #16202b;
  --current-ink: #ffffff;
  --font-sign: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1218;
    --panel: #151c24;
    --panel-2: #1c2530;
    --ink: #e9eef3;
    --ink-2: #9aa8b6;
    --line: #2b3643;
    --sign: #f5b800;
    --sign-ink: #16202b;
    --focus: #7fb0ff;
    --ok: #3fbf74;
    --busy: #f0655a;
    --idle: #7c8997;
    --scrim: rgba(0, 0, 0, 0.6);
    --tag: rgba(21, 28, 36, 0.94);
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
    --current-bg: #2b3847;
    --current-ink: #ffffff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0d1218;
  --panel: #151c24;
  --panel-2: #1c2530;
  --ink: #e9eef3;
  --ink-2: #9aa8b6;
  --line: #2b3643;
  --sign: #f5b800;
  --sign-ink: #16202b;
  --focus: #7fb0ff;
  --ok: #3fbf74;
  --busy: #f0655a;
  --idle: #7c8997;
  --scrim: rgba(0, 0, 0, 0.6);
  --tag: rgba(21, 28, 36, 0.94);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
  --current-bg: #2b3847;
  --current-ink: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.45 var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
}

h2,
h3,
p,
ul,
dl,
fieldset {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--sign);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--ink-2);
  font-weight: 400;
}

.icon {
  flex: none;
}

/* ------------------------------------------------------------------ shell */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.app[data-chat="open"] {
  grid-template-columns: 272px minmax(0, 1fr) 360px;
}

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
}

/* When the floor view is squeezed between two panels, the dock folds the emotes into one button,
   then drops what pinch and scroll already cover. (.dock prefix: these must outrank the base rules below.) */
@container (max-width: 780px) {
  .dock .dock-emote-inline {
    display: none;
  }

  .dock .dock-fold {
    display: block;
  }
}

@container (max-width: 600px) {
  .dock .dock-zoom,
  .dock .dock-status-text {
    display: none;
  }

  .dock .dock-status {
    padding: 0;
  }
}

.tabs {
  display: none;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-md);
  border: 0;
  border-radius: var(--r-md);
  padding: 0 14px;
  line-height: 1;
  background: var(--sign);
  color: var(--sign-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  filter: none;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-quiet:hover {
  background: var(--panel-2);
  filter: none;
}

.btn-small {
  height: var(--h-sm);
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
}

.btn-wide {
  width: 100%;
  height: var(--h-lg);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--h-md);
  height: var(--h-md);
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink-2);
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--sign);
  color: var(--sign-ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dot,
.w-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--idle);
}

.dot[data-status="available"],
.w-tag[data-status="available"] .w-dot {
  background: var(--ok);
}

.dot[data-status="focus"],
.w-tag[data-status="focus"] .w-dot {
  background: var(--busy);
}

.chip {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

.chip-s {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.chip-l {
  width: 40px;
  height: 40px;
  font-size: 17px;
}

.chip-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--idle);
}

.chip-dot[data-status="available"] {
  background: var(--ok);
}

.chip-dot[data-status="focus"] {
  background: var(--busy);
}

.chip-dot[data-status="offline"] {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--idle);
}

/* -------------------------------------------------------------- directory */

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.plate {
  padding: 3px 10px 4px;
  border-radius: 3px;
  background: var(--sign);
  color: var(--sign-ink);
  font: 700 22px/1.1 var(--font-sign);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand-count {
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.brand-count b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  padding: 0 16px;
  color: var(--ink-2);
  font: 600 13px/1.2 var(--font-body);
}

/* The two parts of the sidebar: the floor, then the conversations. */
.side-heading {
  margin: 0 0 6px;
  padding: 0 16px;
  color: var(--ink);
  font: 600 15px/1.2 var(--font-body);
}

.eyebrow-sub {
  margin-top: 16px;
}

.room-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 16px;
  border: 0;
  background: transparent;
  text-align: left;
}

.room-head:hover {
  background: var(--panel-2);
}

/* "Go" appears on the rooms you are not in, as the cue that clicking takes you there. */
.go {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.go .icon {
  width: 14px;
  height: 14px;
}

.room-head:hover .go,
.room-head:focus-visible .go {
  display: inline-flex;
}

.room-head:hover .go + .room-count,
.room-head:focus-visible .go + .room-count {
  margin-left: 8px;
}

@media (hover: none) {
  .go {
    display: inline-flex;
  }

  .go + .room-count {
    margin-left: 8px;
  }
}

.voice-flag {
  display: inline-grid;
  flex: none;
  margin-left: auto;
  color: var(--ink-2);
}

.voice-flag .icon {
  width: 16px;
  height: 16px;
}

.voice-flag[data-speaking="yes"] {
  color: var(--ok);
}

.swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.room-name {
  font: 600 16px/1.2 var(--font-sign);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.room-empty {
  color: var(--ink-2);
}

.room-empty .room-name {
  font-weight: 600;
  opacity: 0.75;
}

.here {
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--sign);
  color: var(--sign-ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.room-count {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 5px 16px;
  border: 0;
  background: transparent;
  text-align: left;
}

.row:hover {
  background: var(--panel-2);
}

.row[aria-current="true"] {
  background: var(--current-bg);
  color: var(--current-ink);
}

.row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-quiet {
  color: var(--ink-2);
}

.people .row {
  padding-left: 34px;
}

.person-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.person-name,
.person-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-name {
  font-weight: 500;
}

.person-note {
  color: var(--ink-2);
  font-size: 12px;
}

.offline {
  margin-top: 8px;
}

.offline summary {
  padding-left: 16px;
}

.hash {
  flex: none;
  width: 10px;
  color: var(--ink-2);
  font: 600 17px/1 var(--font-sign);
  text-align: center;
}

.row[aria-current="true"] .hash {
  color: inherit;
}

.add-channel {
  display: flex;
  gap: 8px;
  padding: 4px 16px;
}

.add-channel input {
  flex: 1;
  min-width: 0;
}

:where(input:not([type="radio"]):not([type="checkbox"])),
:where(select),
:where(textarea) {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
}

:where(input:not([type="radio"]):not([type="checkbox"])),
:where(select) {
  height: var(--h-md);
  padding-block: 0;
}

:where(input, select, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: transparent;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-2);
  opacity: 0.8;
}

.side-foot {
  border-top: 1px solid var(--line);
}

.side-foot .row {
  padding-block: 12px;
}

.edit {
  margin-left: auto;
  font-size: 12px;
}

/* ------------------------------------------------------------------ floor */

.world {
  position: absolute;
  inset: 0;
}

.w-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline-offset: -3px;
}

.world-failed,
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink-2);
  text-align: center;
  pointer-events: none;
}

.w-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.w-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform-origin: 50% 100%;
  will-change: transform;
}

/* Someone speaking sits above the name tags around them. */
.w-label:has(.w-bubble:not([hidden])) {
  z-index: 2;
}

.w-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  padding: 2px 8px 2px 6px;
  border-radius: 4px;
  background: var(--tag);
  box-shadow: 0 1px 4px rgba(13, 18, 24, 0.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.w-tag-self {
  background: var(--sign);
  color: var(--sign-ink);
}

/* Talking lights the tag up; the icons say whose mic is on and who has muted the room. */
.w-tag[data-speaking="yes"] {
  box-shadow: 0 0 0 2px var(--ok), 0 1px 4px rgba(13, 18, 24, 0.22);
}

.w-mic,
.w-deaf {
  display: none;
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.w-tag[data-mic="on"] .w-mic {
  display: block;
}

.w-tag[data-deaf="yes"] .w-deaf {
  display: block;
  opacity: 0.7;
}

.w-note {
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 400;
  text-overflow: ellipsis;
}

.w-tag-self .w-note {
  color: inherit;
  opacity: 0.75;
}

.w-bubble {
  max-width: 230px;
  padding: 6px 10px;
  border-radius: 10px 10px 10px 2px;
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.w-emote {
  position: absolute;
  left: 50%;
  bottom: 100%;
  font-size: 34px;
  line-height: 1;
  animation: w-rise 1.9s ease-out forwards;
}

@keyframes w-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.5);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1.15);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -64px) scale(1);
  }
}

.stage-top,
.stage-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.stage-top > *,
.stage-bottom > * {
  pointer-events: auto;
}

.stage-top {
  top: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.stage-bottom {
  bottom: 16px;
  flex-direction: column;
  align-items: center;
}

.sign {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 4px;
  background: var(--sign);
  color: var(--sign-ink);
  box-shadow: var(--shadow);
}

.sign-bar {
  align-self: stretch;
  width: 40px;
  min-height: 40px;
  border-radius: 2px;
}

.sign-text {
  display: flex;
  flex-direction: column;
}

.sign-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sign-name {
  font: 700 30px/1 var(--font-sign);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sign-meta {
  margin-top: 2px;
  font-size: 12px;
}

.sign .btn {
  background: var(--sign-ink);
  color: var(--sign);
}

.flags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

.flag {
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 12px;
}

.flag-warn {
  background: var(--busy);
  box-shadow: none;
  color: #fff;
  font-weight: 600;
}

.hint {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--panel);
  font-size: 12px;
  font-weight: 600;
}

.card {
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.person-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(520px, 100%);
  padding: 12px;
}

.person-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-card-close {
  margin-left: auto;
  align-self: flex-start;
  width: var(--h-sm);
  height: var(--h-sm);
}

.person-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.person-card-text span {
  color: var(--ink-2);
  font-size: 13px;
}

.person-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 5px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.dock-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.dock-btn:hover {
  background: var(--panel-2);
}

.dock-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--panel);
}

.dock-mic[data-live="yes"] {
  background: var(--sign);
  color: var(--sign-ink);
}

.dock-mic[data-speaking="yes"] {
  box-shadow: 0 0 0 3px var(--ok);
}

.dock-status {
  display: inline-flex;
  gap: 8px;
  max-width: 190px;
  padding: 0 12px 0 10px;
  font-weight: 600;
}

.dock-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-emote {
  font-size: 20px;
  line-height: 1;
}

.dock-emote:active {
  transform: scale(0.88);
}

.dock-fold {
  display: none;
}

.emote-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  display: flex;
  gap: 2px;
  padding: 5px;
  transform: translateX(-50%);
}

.dock-sep {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line);
}

.dock-chat .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
}

/* ------------------------------------------------------------------- chat */

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-title {
  flex: 1;
  min-width: 0;
}

.chat-title h2 {
  overflow: hidden;
  font: 600 23px/1.15 var(--font-sign);
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title p {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 4px;
}

.load-older {
  align-self: center;
  margin-block: 4px 8px;
}

.chat-empty {
  margin: auto;
  color: var(--ink-2);
}

.day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block: 12px 2px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.day::before,
.day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.msg {
  display: flex;
  gap: 10px;
  padding-top: 10px;
}

.msg-follow {
  padding-top: 2px;
}

.msg-gutter {
  flex: none;
  width: 28px;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.msg-name {
  font-weight: 600;
}

/* Beside the name of an integration that posts in a channel, so it is not taken for a colleague. */
.msg-app {
  align-self: center;
  padding: 0 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.msg-time {
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.msg-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.typing {
  min-height: 20px;
  padding: 0 16px;
  color: var(--ink-2);
  font-size: 12px;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin: 4px 16px 16px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel-2);
}

.composer:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 132px;
  padding: 7px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  line-height: 1.4;
  outline: none;
}

.composer .icon-btn {
  width: 34px;
  height: 34px;
}

.send {
  border-radius: var(--r-md);
  background: var(--sign);
  color: var(--sign-ink);
}

.send:hover {
  background: var(--sign);
  color: var(--sign-ink);
  filter: brightness(1.06);
}

.send:disabled {
  opacity: 0.4;
  cursor: default;
  filter: none;
}

/* ---------------------------------------------------------------- dialogs */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
}

.modal {
  width: min(430px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h2 {
  font: 700 28px/1.1 var(--font-sign);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead {
  color: var(--ink-2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span,
legend {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}

legend {
  margin-bottom: 8px;
}

.modal-wide {
  width: min(720px, 100%);
}

/* Character editor: a turning preview beside the choices, which scroll on their own. */
.look {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.look-stage {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--panel-2);
}

.look-canvas {
  width: 216px;
  height: 300px;
  cursor: grab;
  touch-action: none;
}

.look-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.look-actions .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.look-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.look-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 12px 6px 4px 2px;
  overscroll-behavior: contain;
}

.pick {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pick legend {
  float: left;
  width: 100%;
  margin-bottom: 7px;
}

.pick-pills {
  gap: 6px;
}

.swatch-pick {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.swatch-pick input,
.status-pick input,
.pill-pick input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch-pick:has(input:checked) {
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--ink);
}

.swatch-pick:has(input:focus-visible),
.status-pick:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}

.pill-pick {
  position: relative;
}

.pill-pick span {
  display: inline-flex;
  align-items: center;
  height: var(--h-sm);
  padding: 0 11px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
}

.pill-pick:has(input:checked) span {
  background: var(--ink);
  box-shadow: none;
  color: var(--panel);
}

.pill-pick:has(input:focus-visible) span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signed-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  color: var(--ink-2);
  font-size: 13px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .look {
    grid-template-columns: minmax(0, 1fr);
  }

  .look-stage {
    position: static;
    flex-direction: row;
    justify-content: center;
  }

  .look-canvas {
    width: 132px;
    height: 184px;
  }

  .look-actions {
    flex-direction: column;
  }

  .look-options {
    max-height: none;
  }
}

/* Choices as pictures: the person's own look, with that choice made. */
.pick-tiles {
  gap: 6px;
}

.tile-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 76px;
  padding: 5px 3px 6px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.tile-wide {
  width: 104px;
}

.tile-wide .tile-img {
  width: 92px;
  height: 92px;
}

.tile-img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}

.tile-wait {
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--line) 60%, transparent) 50%, transparent 70%) 0 0 / 300% 100%;
  animation: tile-wait 1.3s linear infinite;
}

@keyframes tile-wait {
  to {
    background-position: -150% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile-wait {
    animation: none;
  }
}

.tile-pick > span {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-pick:hover {
  background: var(--panel);
}

.tile-pick:has(input:checked) {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.tile-pick:has(input:checked) > span {
  color: var(--ink);
  font-weight: 600;
}

.tile-pick:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tile-pick input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pick .look-note {
  width: 100%;
  margin-bottom: 2px;
}

/* Any colour: a rainbow until one is chosen, then that colour. */
.swatch-custom {
  display: grid;
  place-items: center;
  background: conic-gradient(#e5484d, #f5b800, #3fbf74, #1f8a8a, #1f5fd1, #8c6bb1, #c2408f, #e5484d);
  color: #ffffff;
}

.swatch-custom .icon {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6));
}

.swatch-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch-custom.is-custom {
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--ink);
}

.statuses {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.status-pick:has(input:checked) {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.status-pick:has(input:focus-visible) {
  outline-offset: 2px;
}

.status-pick-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.status-pick-text span {
  color: var(--ink-2);
  font-size: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

.controls {
  margin-bottom: 14px;
}

@media (min-width: 900px) {
  /* Two columns of controls, so the whole list fits without scrolling. */
  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}

.controls div {
  display: grid;
  grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.controls dt {
  font-weight: 600;
}

.controls dd {
  margin: 0;
  color: var(--ink-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 500;
  transform: translateX(-50%);
}

/* ------------------------------------------------------------------ phone */

@media (max-width: 820px) {
  .app,
  .app[data-chat="open"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .stage,
  .side,
  .chat {
    grid-column: 1;
    grid-row: 1;
  }

  .side,
  .chat {
    z-index: 5;
    display: none;
    border: 0;
  }

  .app[data-tab="people"] .side,
  .app[data-tab="chat"] .chat {
    display: flex;
  }

  .tabs {
    grid-row: 2;
    z-index: 6;
    display: flex;
    background: var(--panel);
    border-top: 1px solid var(--line);
  }

  .tabs button {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 9px;
    border: 0;
    border-top: 3px solid transparent;
    background: transparent;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
  }

  .tabs button[aria-current="page"] {
    border-top-color: var(--sign);
    color: var(--ink);
  }

  .tabs .badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    margin: 0;
  }

  .sign-name {
    font-size: 24px;
  }

  .sign-bar {
    width: 28px;
  }

  .dock-zoom,
  .dock-chat,
  .dock-status-text {
    display: none;
  }

  .dock-status {
    padding: 0;
  }

  .toast {
    bottom: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .w-emote {
    animation-duration: 1.9s;
    animation-name: w-fade;
  }

  @keyframes w-fade {
    0%,
    80% {
      opacity: 1;
      transform: translate(-50%, -8px);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -8px);
    }
  }
}

/* ------------------------------------------------- pictures and videos in chat */

.files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.file {
  display: block;
  max-width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line);
}

.file-pic {
  cursor: zoom-in;
}

.file-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-pic:hover img {
  filter: brightness(0.94);
}

video.file {
  background: #000;
}

/* What is about to be sent: small tiles above the message box. */
.tray {
  padding: 0 16px 4px;
}

.tray-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tray-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line);
}

.tray-item img,
.tray-item video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.tray-item[data-state="sending"] img,
.tray-item[data-state="sending"] video {
  opacity: 0.55;
}

.tray-item[data-state="failed"] {
  box-shadow: 0 0 0 2px var(--busy);
}

.tray-item[data-state="failed"] img,
.tray-item[data-state="failed"] video {
  opacity: 0.35;
}

.tray-item progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  width: calc(100% - 12px);
  height: 5px;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--panel);
  accent-color: var(--sign);
  appearance: none;
}

.tray-item progress::-webkit-progress-bar {
  background: var(--panel);
}

.tray-item progress::-webkit-progress-value {
  background: var(--sign);
}

.tray-item progress::-moz-progress-bar {
  background: var(--sign);
}

.tray-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--panel);
}

.tray-remove .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.tray-error {
  margin-top: 6px;
  color: var(--busy);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.attach {
  width: 38px;
  height: 38px;
}

.attach:disabled {
  opacity: 0.4;
}

.chat {
  position: relative;
}

.drop-note {
  position: absolute;
  inset: 8px;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 2px dashed var(--sign);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  font: 600 22px/1.2 var(--font-sign);
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

/* A picture opened at full size. Always dark, whatever the theme, so the picture is what you see. */
.viewer {
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: rgba(9, 12, 16, 0.92);
  color: #e9eef3;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px 10px 18px;
}

.viewer-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.viewer-title strong,
.viewer-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-title span {
  color: #9aa8b6;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.viewer .icon-btn {
  color: #e9eef3;
}

.viewer .icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.viewer-stage {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  padding: 0 16px 16px;
}

.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  background-position: center;
  background-size: 100% 100%;
  object-fit: contain;
}

.viewer-step {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(9, 12, 16, 0.6);
  transform: translateY(-50%);
}

.viewer-prev {
  left: 12px;
}

.viewer-next {
  right: 12px;
}

/* ------------------------------------------- nudges, mentions and deleting */

.nudges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.nudge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow), 0 0 0 2px var(--sign);
}

.nudge-bell {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sign);
  color: var(--sign-ink);
  animation: nudge-ring 0.9s ease-in-out 2;
  transform-origin: 50% 20%;
}

@keyframes nudge-ring {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(18deg);
  }
  40% {
    transform: rotate(-16deg);
  }
  60% {
    transform: rotate(10deg);
  }
  80% {
    transform: rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nudge-bell {
    animation: none;
  }
}

.nudge-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.nudge-text span {
  color: var(--ink-2);
  font-size: 13px;
}

.msg-nudge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 13px;
}

.msg-nudge .icon {
  width: 16px;
  height: 16px;
  color: var(--ink);
}

.msg-nudge .msg-time {
  margin-left: auto;
}

.mention {
  padding: 0 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--focus) 14%, transparent);
  color: var(--focus);
  font-weight: 500;
}

.mention-me {
  background: var(--sign);
  color: var(--sign-ink);
}

.composer {
  position: relative;
}

.mention-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 6;
  margin: 0;
  padding: 4px;
  list-style: none;
}

.mention-pop button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.mention-pop li[aria-selected="true"] button,
.mention-pop button:hover {
  background: var(--panel-2);
}

.mention-away {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 12px;
}

.msg {
  position: relative;
}

.msg-tools {
  position: absolute;
  top: -22px;
  right: 4px;
  z-index: 2;
  display: none;
  gap: 1px;
  padding: 2px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

/* Shown while the pointer is over the message, while one of its buttons has the keyboard, or after a tap. */
.msg:hover .msg-tools,
.msg-tools:focus-within,
.msg[data-tools="open"] .msg-tools {
  display: flex;
}

.msg-tool {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
}

.msg-tool:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.msg-tool .icon {
  width: 16px;
  height: 16px;
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 0;
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.reaction[aria-pressed="true"] {
  background: color-mix(in srgb, var(--focus) 14%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--focus);
}

/* Who gave a reaction: a card that appears over it on hover or keyboard focus. */
.reaction-wrap {
  position: relative;
  display: inline-flex;
}

.reaction-who {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
  pointer-events: none;
}

.reaction-wrap:hover .reaction-who,
.reaction-wrap:focus-within .reaction-who {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.15s, 0.15s, 0s;
}

.reaction-wrap[data-below="true"] .reaction-who {
  top: calc(100% + 6px);
  bottom: auto;
}

.reaction-who-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}

.reaction-who-emoji {
  font-size: 18px;
}

.reaction-who-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reaction-who-person {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reaction-who-more {
  color: var(--ink-2);
  font-size: 12px;
}

.msg-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.settings-note {
  color: var(--ink-2);
  font-size: 13px;
}

/* ------------------------------------------------------------ shared screens */

/* The video takes the whole stage and keeps its own shape inside it, so nothing is cut off. */
.viewer-stage video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.dock-share {
  position: relative;
}

.dock-share[data-live="yes"] {
  background: var(--busy);
  color: #fff;
}

/* A dot on the button when someone else is showing something on this room's screen. */
.dock-live {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--busy);
  box-shadow: 0 0 0 2px var(--panel);
}

/* A person's role shows as a band of its colour down the side of their name tag. */
.w-tag[data-role="yes"] {
  box-shadow: inset 4px 0 0 var(--role), 0 1px 4px rgba(13, 18, 24, 0.22);
  padding-left: 10px;
}

.w-tag[data-role="yes"][data-speaking="yes"] {
  box-shadow: inset 4px 0 0 var(--role), 0 0 0 2px var(--ok), 0 1px 4px rgba(13, 18, 24, 0.22);
}

/* --------------------------------------------- roles, people and the directory */

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px 1px 6px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--role) 14%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--role) 45%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.role-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--role);
}

.role-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: 1px;
}

.pill {
  flex: none;
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.row[aria-current="true"] .pill,
.row[aria-current="true"] .person-note {
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

.row[aria-current="true"] .person-note {
  box-shadow: none;
  opacity: 0.8;
}

.side-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.side-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: var(--h-md);
  padding: 0 6px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--ink-2);
  text-align: left;
}

.side-search-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-search:hover {
  color: var(--ink);
}

.side-search .icon,
.threads .row > .icon,
.row-quiet > .icon {
  width: 16px;
  height: 16px;
}

.threads .row > .icon,
.threads .row > .hash,
.group-mark {
  flex: none;
  width: 16px;
  color: var(--ink-2);
}

.row[aria-current="true"] > .icon,
.row[aria-current="true"] .group-mark {
  color: inherit;
}

.group-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px currentColor;
  font-size: 11px;
  font-weight: 600;
}

.threads .group-mark {
  margin-inline: -3px;
}

.modal-xl {
  width: min(880px, 100%);
}

.tabbar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tabbar button {
  height: var(--h-md);
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
}

.tabbar button[aria-selected="true"] {
  border-bottom-color: var(--sign);
  color: var(--ink);
}

.team {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 20px;
  min-height: 380px;
}

.team-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.team-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.team-people {
  flex: 1;
  max-height: 46vh;
  overflow-y: auto;
  margin-inline: -8px;
}

.team-people .row,
.team-list > .row,
.picker-list .row,
.members .row {
  padding-inline: 8px;
  border-radius: 6px;
}

.team-people .row[data-gone="yes"] .person-name {
  text-decoration: line-through;
  color: var(--ink-2);
}

.team-empty {
  padding: 24px 0;
}

.team-detail {
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.person-back {
  display: none;
  margin-bottom: 12px;
}

.person-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.person-view-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.person-view-head h3 {
  font: 700 24px/1.15 var(--font-sign);
  letter-spacing: 0.02em;
}

.person-view-head p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 4px;
}

.person-view-head .pill {
  margin-left: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--ink-2);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.person-about {
  white-space: pre-wrap;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.details-wide {
  grid-column: 1 / -1;
}

.field textarea {
  resize: vertical;
  min-height: 58px;
}

.field-note {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
}

.field > span.field-note {
  font-weight: 400;
}

.profile-role {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--busy) 9%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--busy) 40%, transparent);
  font-size: 13px;
}

.btn-danger {
  background: var(--busy);
  color: #fff;
}

.check {
  align-items: flex-start;
}

.check input {
  flex: none;
  margin-top: 2px;
}

.prefixed {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.prefixed > span {
  color: var(--ink-2);
  font: 600 18px/1 var(--font-sign);
}

.prefixed input {
  flex: 1;
  min-width: 0;
}

.roles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.role-item {
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.role-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.role-line code {
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
}

.role-tools {
  display: flex;
  margin-left: auto;
}

.role-about {
  margin-top: 4px;
}

.role-facts {
  color: var(--ink-2);
  font-size: 12px;
}

.role-facts:empty {
  display: none;
}

.role-item .confirm {
  margin-top: 8px;
}

/* ------------------------------------------------- conversations: making and managing */

.picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.picked li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 5px;
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 500;
}

.picked button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
}

.picked button:hover {
  background: var(--line);
  color: var(--ink);
}

.picked .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.picker-list,
.members {
  max-height: 190px;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 4px;
}

.picker-list .row > .icon {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--ink-2);
}

.picker-list .row:disabled {
  opacity: 0.45;
  cursor: default;
}

.picker-empty {
  padding: 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.role-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-checks .check {
  align-items: center;
}

.role-checks .check input {
  margin-top: 0;
}

.channel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
}

.channel-head > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.channel-head strong {
  font: 600 22px/1.2 var(--font-sign);
  letter-spacing: 0.01em;
}

.channel-head span {
  font-size: 12px;
}

.member {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 2px 4px 2px 8px;
}

.member .icon-btn {
  width: 28px;
  height: 28px;
  margin-left: auto;
}

.member .icon {
  width: 16px;
  height: 16px;
}

.status-pick > .icon,
.status-pick > .hash {
  flex: none;
  width: 18px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------- search */

.search {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .icon {
  position: absolute;
  left: 10px;
  color: var(--ink-2);
  pointer-events: none;
}

.search-box input[type="search"] {
  width: 100%;
  height: var(--h-lg);
  padding-left: 38px;
  font-size: 16px;
}

.search-results {
  min-height: 220px;
  max-height: 56vh;
  overflow-y: auto;
  margin-inline: -8px;
  padding-inline: 8px;
}

.hit {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.hit:hover {
  background: var(--panel-2);
}

.hit-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hit-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.hit-head span {
  color: var(--ink-2);
  font-size: 12px;
}

.hit-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

mark {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--sign);
  color: var(--sign-ink);
}

/* ------------------------------------- replies, pins, edits, files and links in chat */

.chat-title h2 .icon,
.chat-title h2 .hash {
  width: 17px;
  height: 17px;
  margin-right: 5px;
  vertical-align: -2px;
}

.chat-head .icon-btn {
  position: relative;
}

.chat-head .icon-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--panel);
}

.count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--sign);
  color: var(--sign-ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
}

.pins {
  max-height: 42%;
  overflow-y: auto;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.pins-note {
  padding: 6px 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.pin {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.pin-open {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.pin-open:hover {
  background: var(--panel);
}

.pin-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pin-head span {
  color: var(--ink-2);
  font-size: 12px;
}

.pin-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.pin .icon-btn {
  width: 28px;
  height: 28px;
}

.pin .icon {
  width: 15px;
  height: 15px;
}

.msg[data-pinned="yes"] {
  margin-inline: -8px;
  padding-inline: 8px;
  padding-bottom: 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sign) 9%, transparent);
}

.msg-pinned {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.msg-pinned .icon {
  width: 13px;
  height: 13px;
}

/* A message that was jumped to is picked out for a moment. */
.msg[data-spot="yes"] {
  margin-inline: -8px;
  padding-inline: 8px;
  padding-bottom: 6px;
  border-radius: 8px;
  animation: spot 2.6s ease-out;
}

@keyframes spot {
  0%,
  55% {
    background: color-mix(in srgb, var(--sign) 38%, transparent);
  }
  100% {
    background: transparent;
  }
}

.msg-edited {
  color: var(--ink-2);
  font-size: 12px;
}

.msg-edit textarea {
  width: 100%;
  resize: none;
  border-radius: 8px;
  line-height: 1.4;
}

.msg-tool[aria-pressed="true"] {
  background: var(--sign);
  color: var(--sign-ink);
}

.msg-replies {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 10px 4px 5px;
  border: 0;
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
}

.msg-replies:hover {
  box-shadow: inset 0 0 0 1px var(--ink-2);
}

.msg-replies > span:last-child {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-replies[data-fresh="yes"] {
  box-shadow: inset 0 0 0 2px var(--sign);
}

.msg-replies[data-fresh="yes"] > span:last-child {
  color: var(--ink);
  font-weight: 600;
}

.msg-replies-who {
  display: inline-flex;
}

.msg-replies-who .chip + .chip {
  margin-left: -6px;
}

.msg-replies-who .chip-dot {
  display: none;
}

.replies-rule {
  margin-block: 12px 0;
}

.load-newer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-block: 12px 8px;
}

.composer-closed {
  margin: 0 16px 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 13px;
}

.file-card,
.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none;
}

.file-card:hover,
.link-card:hover {
  box-shadow: inset 0 0 0 1px var(--ink-2);
}

.file-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.file-card-text,
.link-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.file-card-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-text span,
.link-card-site {
  color: var(--ink-2);
  font-size: 12px;
}

.file-card > .icon:last-child {
  color: var(--ink-2);
}

.link-card {
  align-items: stretch;
  border-left: 3px solid var(--line);
  border-radius: 4px 8px 8px 4px;
}

.link-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.link-card-about {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--ink-2);
  font-size: 13px;
}

.link-card img {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel);
}

.tray-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}

.mention-group {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-2);
  color: #fff;
}

.mention-group .icon {
  width: 13px;
  height: 13px;
}

.person-card-text strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 720px) {
  .team {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .team[data-detail="open"] .team-list,
  .team[data-detail="closed"] .team-detail {
    display: none;
  }

  .team-detail {
    padding-left: 0;
    border-left: 0;
  }

  .person-back {
    display: inline;
    align-self: flex-start;
  }

  .details-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-people {
    max-height: none;
  }
}

/* ------------------------------ messages an admin has put on everyone's screen */

.alerts {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
  min-width: 0;
  margin-inline: auto;
}

.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow), 0 0 0 2px var(--sign);
}

.alert-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sign);
  color: var(--sign-ink);
}

.alert-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.alert-text strong {
  font-size: 15px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.alert-from {
  color: var(--ink-2);
  font-size: 12px;
}

/* Fewer pixels are drawn in low detail; let the browser smooth them up to size. */
.w-canvas[data-detail="low"] {
  image-rendering: auto;
}

/* The character editor's groups of choices. */
.look-tabs {
  margin-bottom: 0;
}

.look-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}

.look-tabs {
  flex-wrap: wrap;
}

.look-tabs button {
  padding: 0 9px;
}

.look-options {
  min-height: 330px;
}

/* In a quiet room: a veil over everything outside it. Soft, not a blackout. */
.w-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(22, 32, 43, 0.2);
  -webkit-backdrop-filter: blur(var(--veil-blur, 6px)) saturate(0.6) brightness(0.74);
  backdrop-filter: blur(var(--veil-blur, 6px)) saturate(0.6) brightness(0.74);
  transition: opacity 0.5s ease;
}

.w-veil[data-on="true"] {
  opacity: 1;
}

/* Where the browser cannot blur what is behind an element, dim it a little more instead. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .w-veil {
    background: rgba(22, 32, 43, 0.5);
  }
}

.w-label {
  transition: opacity 0.4s ease, visibility 0.4s;
}

/* In a focus room the name tags of everyone outside it are put away. */
.w-label[data-away="true"] {
  opacity: 0;
  visibility: hidden;
}

.sign-quiet {
  max-width: 190px;
  line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
  .w-veil,
  .w-label {
    transition: none;
  }
}

/* ---------------------------------------------------------------- conversations, arranged */

.conv-top {
  display: flex;
  align-items: center;
  padding-right: 10px;
}

.conv-top .side-heading {
  flex: 1;
  margin: 0;
}

.conv-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
}

.conv-sort .icon {
  width: 16px;
  height: 16px;
}

.conv-sort:hover,
.conv-sort[aria-expanded="true"] {
  background: var(--panel-2);
  color: var(--ink);
}

.convs > .threads {
  margin-top: 6px;
}

.conv-section {
  margin-top: 10px;
}

.conv-head {
  display: flex;
  align-items: center;
  padding-right: 10px;
}

.conv-toggle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.conv-toggle:hover {
  color: var(--ink);
}

.conv-toggle .icon {
  flex: none;
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.conv-toggle[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

.conv-count {
  margin-left: auto;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.conv-btn {
  width: 28px;
  height: 28px;
}

.conv-btn .icon {
  width: 16px;
  height: 16px;
}

/* The conversation's own menu button, over the end of its row, shown on hover or focus. */
.conv-row {
  position: relative;
}

.row-more {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(-50%);
}

.row-more .icon {
  width: 16px;
  height: 16px;
}

.conv-row:hover .row-more,
.row-more:focus-visible,
.row-more[aria-expanded="true"] {
  opacity: 1;
}

.row-more:hover {
  color: var(--ink);
}

.conv-row .row[aria-current="true"] ~ .row-more {
  background: var(--ink);
  color: var(--panel);
}

@media (hover: none) {
  .row-more {
    opacity: 0.7;
    background: transparent;
  }
  .conv-row .row {
    padding-right: 40px;
  }
}

.conv-row[data-muted="true"] > .row:not([aria-current="true"]) {
  color: var(--ink-2);
}

.row-flag {
  display: inline-grid;
  flex: none;
  color: var(--ink-2);
}

.row-flag .icon {
  width: 14px;
  height: 14px;
}

.row[aria-current="true"] .row-flag {
  color: inherit;
}

.conv-row[data-muted="true"] .badge {
  margin-left: 0;
}

.conv-row[data-muted="true"] .row-flag {
  margin-left: auto;
}

.conv-empty {
  margin: 2px 0 4px;
  padding: 0 16px 0 30px;
  color: var(--ink-2);
  font-size: 12px;
}

.conv-name {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
}

.conv-name input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.conv-hidden .row {
  padding-right: 64px;
}

.conv-show {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.side-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 240px;
  padding: 6px;
}

.side-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.side-menu button .icon {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--ink-2);
}

.side-menu button:hover,
.side-menu button:focus-visible {
  background: var(--panel-2);
  outline: none;
}

.side-menu hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- the guided first visit */

.guide-steps {
  display: flex;
  gap: 4px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  flex: 1;
  min-width: 0;
}

.guide-steps button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px 8px;
  border: 0;
  border-bottom: 3px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}

.guide-steps button:disabled {
  cursor: default;
}

.guide-steps [data-state="now"] button {
  border-bottom-color: var(--sign);
  color: var(--ink);
  font-weight: 600;
}

.guide-steps [data-state="done"] button {
  border-bottom-color: var(--ink-2);
}

.guide-steps [data-state="done"] button:hover {
  color: var(--ink);
}

.guide-dot {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.guide-dot .icon {
  width: 14px;
  height: 14px;
}

.guide-steps [data-state="now"] .guide-dot {
  background: var(--sign);
  color: var(--sign-ink);
}

.guide-step-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide .look-options {
  min-height: 300px;
}

.guide-tips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-tips li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.4;
}

.guide-tips strong {
  display: block;
  margin-bottom: 2px;
}

.guide-tip-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
}

.guide-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.guide-foot .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guide-foot .icon {
  width: 16px;
  height: 16px;
}

.guide-gap {
  flex: 1;
}

@media (max-width: 640px) {
  .guide-step-name {
    display: none;
  }
  .guide-steps button {
    justify-content: center;
  }
  .guide-tips {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The room sign's own chat button: dark on the sign's yellow. */
.sign-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sign-ink);
  color: var(--sign);
  pointer-events: auto;
}

.sign-chat:hover {
  background: var(--sign-ink);
  color: var(--sign);
  filter: brightness(1.25);
}

.sign-chat[aria-pressed="true"] {
  background: transparent;
  color: var(--sign-ink);
  box-shadow: inset 0 0 0 1.5px var(--sign-ink);
}

.sign-chat .icon {
  width: 16px;
  height: 16px;
}

.sign-chat .badge {
  min-width: 18px;
  height: 18px;
  margin-left: 2px;
  background: var(--sign);
  color: var(--sign-ink);
}

@media (max-width: 560px) {
  .sign-chat {
    padding-inline: 8px;
  }
}

/* Walking with someone. */
.following {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  font-size: 14px;
}

/* A name or face on a message that shows that person. */
.msg-face {
  align-self: flex-start;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.msg-name-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.msg-name-link:hover,
.msg-name-link:focus-visible {
  text-decoration: underline;
}

/* An invitation to a room: the room's colour, and no ringing. */
.invite-mark {
  color: #fff;
  animation: none;
}

.invite-list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.invite-row:hover {
  background: var(--panel-2);
}

.invite-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

/* ---------------------------------------------------------------- the quick switcher */

.switch-scrim {
  align-items: flex-start;
  padding-top: min(14vh, 120px);
}

.switch {
  display: flex;
  flex-direction: column;
  width: min(600px, 100%);
  max-height: min(70vh, 560px);
  overflow: hidden;
}

.switch-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.switch-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
}

.switch-list {
  flex: 1;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.switch-group {
  padding: 10px 10px 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.switch-item[aria-selected="true"] {
  background: var(--panel-2);
}

.switch-lead {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  color: var(--ink-2);
}

.switch-lead .icon {
  width: 18px;
  height: 18px;
}

.switch-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.switch-label,
.switch-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-label {
  font-weight: 500;
}

.switch-note {
  color: var(--ink-2);
  font-size: 12px;
}

.switch-alt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
}

.switch-item[aria-selected="true"] .switch-alt,
.switch-item:hover .switch-alt {
  opacity: 1;
}

.switch-none {
  padding: 16px 10px;
  color: var(--ink-2);
}

.switch-foot {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}

@media (hover: none) {
  .switch-alt {
    opacity: 1;
  }
}

a.msg-tool,
a.icon-btn {
  color: var(--ink-2);
  text-decoration: none;
}

/* ---------------------------------------------------------------- pointers after the setup */

.tip-ring {
  position: fixed;
  z-index: 70;
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--sign), 0 0 0 9999px rgba(10, 16, 24, 0.18);
  pointer-events: none;
  transition: all 0.25s ease;
}

.tip-card {
  position: fixed;
  z-index: 71;
  width: min(300px, calc(100vw - 24px));
  padding: 14px 16px 12px;
  border-top: 4px solid var(--sign);
}

.tip-card p {
  margin: 4px 0 10px;
  color: var(--ink-2);
  line-height: 1.45;
}

.tip-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tip-ring {
    transition: none;
  }
}

/* Tooltips on the dock: what each button does, and its key, shown on pointing at it. (Its label says the same to a screen reader.) */
.dock [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 30;
  max-width: 260px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  font: 500 12px/1.3 var(--font-body);
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
  pointer-events: none;
}

.dock [data-tip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0.25s;
}

/* The first and last buttons keep their tip inside the window. */
.dock > [data-tip]:first-child::after {
  left: 0;
  transform: translate(0, 4px);
}

.dock > [data-tip]:first-child:hover::after {
  transform: translate(0, 0);
}

.dock > [data-tip]:last-child::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.dock > [data-tip]:last-child:hover::after {
  transform: translate(0, 0);
}

/* While a menu from the dock is open, its button's tip stays out of the way. */
.dock [aria-expanded="true"]::after {
  display: none;
}

@media (hover: none) {
  .dock [data-tip]::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dock [data-tip]::after {
    transition: none;
  }
}

/* ---------------------------------------------------------------- the emoji picker */

.emoji-picker {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emoji-search {
  margin: 10px 10px 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.emoji-tabs {
  display: flex;
  justify-content: space-between;
  padding: 0 8px 4px;
  border-bottom: 1px solid var(--line);
}

.emoji-tabs button {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 17px;
  filter: grayscale(0.5);
}

.emoji-tabs button:hover {
  background: var(--panel-2);
  filter: none;
}

.emoji-list {
  flex: 1;
  min-height: 0;
  padding: 0 8px 8px;
  overflow-y: auto;
}

.emoji-head {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 8px 2px 4px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
}

.emoji-cell {
  display: grid;
  place-items: center;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.emoji-cell:hover,
.emoji-cell:focus-visible {
  background: var(--panel-2);
  outline: none;
}

.emoji-none {
  padding: 20px 4px;
  color: var(--ink-2);
}

.emoji-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.emoji-foot-char {
  font-size: 22px;
}

.reaction-add {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 0;
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  opacity: 0.7;
}

.reaction-add .icon {
  width: 16px;
  height: 16px;
}

.reaction-add:hover {
  opacity: 1;
}

/* A message that is only a few emoji, shown big. */
.msg-text-jumbo {
  font-size: 32px;
  line-height: 1.25;
}

/* ---------------------------------------------------------------- one set of control sizes */

/* Keyboard keys shown in the interface, all alike. */
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink-2);
  font: 600 11px/1 var(--font-body);
  white-space: nowrap;
}

/* The small square tools: on a message, beside a conversation, by a section, in a menu's head. */
.msg-tool,
.row-more,
.conv-btn,
.conv-sort {
  height: var(--h-sm);
  border-radius: var(--r-sm);
}

.msg-tool,
.row-more,
.conv-btn {
  width: var(--h-sm);
}

/* The room sign's buttons: the same height, the invitation one square. */
.sign .btn {
  height: var(--h-sm);
}

.sign-invite {
  width: var(--h-sm);
  padding: 0;
}

/* Folding lists in the sidebar ("Not in right now", "Hidden") look like its sections. */
.side-fold {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.side-fold::-webkit-details-marker {
  display: none;
}

.side-fold:hover {
  color: var(--ink);
}

.side-fold .icon {
  flex: none;
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

details[open] > .side-fold .icon {
  transform: rotate(90deg);
}

/* A notice in the stack above the dock rather than floating over it. */
.toast-inline {
  position: static;
  max-width: min(480px, 100%);
  transform: none;
}

/* The people and roles dialog keeps one size whichever tab is showing. */
.modal-xl {
  min-height: min(560px, 100%);
}

.team-add {
  align-self: flex-start;
  margin: 2px 0 6px;
}

@media (max-width: 820px) {
  /* Big enough that a phone does not zoom in to type. */
  .composer textarea,
  .switch-box input,
  .emoji-search {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-fold .icon,
  .conv-toggle .icon {
    transition: none;
  }
}

/* No keyboard, no keys to show. */
@media (hover: none), (max-width: 820px) {
  .side-search kbd {
    display: none;
  }
}

/* ------------------------------------------------------------------ the Team Lead on shift */

:root {
  --lead: #1d7a8c;
}

.lead-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 6px 8px 6px 6px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--lead) 10%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lead) 40%, transparent);
}

.lead-strip[data-open="true"] {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.lead-badge {
  flex: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 6px 3px;
  border-radius: var(--r-sm);
  background: var(--lead);
  color: #fff;
  font: 700 11px/1 var(--font-sign);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-who {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 2px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lead-who:hover {
  background: color-mix(in srgb, var(--lead) 10%, transparent);
}

.lead-text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.lead-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-since {
  color: var(--ink-2);
  font-size: 12px;
}

.lead-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--lead);
  color: #fff;
  font: 700 11px/1.6 var(--font-sign);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
  white-space: nowrap;
}

/* On the floor, the lead's name tag carries the same mark. */
.w-tag[data-lead="yes"]::before {
  content: "TEAM LEAD";
  margin-right: 2px;
  padding: 0 5px;
  border-radius: 7px;
  background: var(--lead);
  color: #fff;
  font: 700 10px/1.6 var(--font-sign);
  letter-spacing: 0.06em;
}

.room-floor {
  margin-left: 6px;
  color: var(--ink-2);
  font: 500 11px/1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ------------------------------------------------------------------ the message on the screens */

.screen-message-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
  font-size: 13px;
}

.screen-message-left[data-low="true"] {
  color: var(--busy);
  font-weight: 600;
}
