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

html,
body {
  height: 100%;
  margin: var(--space-0);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: var(--space-0);
  font-size: inherit;
  font-weight: inherit;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus {
  outline: none;
}

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

input:focus-visible,
textarea:focus-visible {
  outline: none;
}

#app {
  height: 100%;
}

.icon {
  flex-shrink: 0;
}

.mono {
  font-family: var(--font-mono);
}

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

kbd {
  display: inline-grid;
  place-items: center;
  min-width: var(--size-count);
  height: var(--size-count);
  padding: var(--space-0) var(--space-1);
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--size-control);
  padding: var(--space-0) var(--space-3);
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition:
    background-color var(--duration) var(--ease-out),
    filter var(--duration) var(--ease-out);
}

.button:hover {
  background: var(--surface-3-hover);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  filter: brightness(1.1);
}

.button.neutral {
  border-color: var(--surface-3);
  background: var(--surface-3);
}

.button.neutral:hover {
  filter: brightness(1.05);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.icon-button {
  display: grid;
  place-items: center;
  width: var(--size-control);
  height: var(--size-control);
  padding: var(--space-0);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  transition: background-color var(--duration) var(--ease-out);
}

.icon-button:hover,
.icon-button[aria-expanded="true"],
.icon-button[aria-pressed="true"] {
  background: var(--surface-3-hover);
  color: var(--text-primary);
}

.input {
  width: 100%;
  min-width: var(--space-0);
  height: var(--size-control);
  padding: var(--space-0) var(--space-2);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: var(--border-strong);
}

.segmented {
  display: inline-flex;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
}

.segmented button {
  height: calc(var(--size-segment) - var(--hairline) * 2);
  padding: var(--space-0) var(--space-2);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  transition: background-color var(--duration) var(--ease-out);
}

.segmented button[aria-checked="true"] {
  background: var(--surface-3);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--size-avatar);
  height: var(--size-avatar);
  border-radius: var(--radius-round);
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-semibold);
}

.avatar.small {
  width: var(--size-avatar-sm);
  height: var(--size-avatar-sm);
}

.avatar.assistant {
  background: var(--text-primary);
  color: var(--surface-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: var(--size-chip);
  padding: var(--space-0) var(--space-2);
  border-radius: var(--radius-round);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip.small {
  height: var(--size-count);
  padding: var(--space-0) var(--space-1);
}

.chip.waiting {
  background: var(--waiting-bg);
  color: var(--waiting);
}

.chip.waiting.hot {
  background: var(--danger-bg);
  color: var(--danger);
}

.chip.open {
  background: var(--surface-3);
  color: var(--text-secondary);
}

.chip.resolved {
  background: var(--resolved-bg);
  color: var(--resolved);
}

.progress {
  position: absolute;
  top: var(--space-0);
  right: var(--space-0);
  left: var(--space-0);
  z-index: 2;
  height: var(--size-bar);
  background: var(--accent);
}

/* layout */

.app {
  display: grid;
  grid-template-columns: var(--size-sidebar) var(--size-list) minmax(var(--size-thread-min), 1fr) var(--size-context);
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: var(--space-0);
  padding: var(--space-3) var(--space-2);
  border-right: var(--hairline) solid var(--border);
  background: var(--surface-0);
}

.list {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: var(--space-0);
  min-height: var(--space-0);
  border-right: var(--hairline) solid var(--border);
  background: var(--surface-1);
}

.thread {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: var(--space-0);
  min-height: var(--space-0);
  background: var(--surface-2);
}

.context {
  min-width: var(--space-0);
  min-height: var(--space-0);
  overflow-y: auto;
  padding: var(--space-3);
  border-left: var(--hairline) solid var(--border);
  background: var(--surface-1);
}

/* sidebar */

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--size-control);
  margin-bottom: var(--space-3);
  padding: var(--space-0) var(--space-2);
  font-weight: var(--weight-semibold);
}

.views {
  display: grid;
}

.view {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--size-view);
  padding: var(--space-0) var(--space-2);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  transition: background-color var(--duration) var(--ease-out);
}

.view:hover {
  background: var(--surface-3-hover);
  color: var(--text-primary);
}

.view[aria-current="true"] {
  background: var(--surface-3);
  color: var(--text-primary);
}

.view-label {
  flex: 1;
  min-width: var(--space-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-count {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-variant-numeric: tabular-nums;
}

.view[aria-current="true"] .view-count {
  color: var(--text-secondary);
}

.view-count.attention {
  min-width: var(--size-count);
  height: var(--size-count);
  padding: var(--space-0) var(--space-1);
  border-radius: var(--radius-round);
  background: var(--waiting-fill);
  color: var(--on-waiting);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.account {
  margin-top: auto;
}

.account-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
  transition: background-color var(--duration) var(--ease-out);
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  background: var(--surface-3-hover);
}

.account-name {
  flex: 1;
  min-width: var(--space-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button .icon {
  color: var(--text-secondary);
}

/* floating surfaces */

.menu,
.popover {
  position: fixed;
  z-index: 20;
  border-radius: var(--radius-float);
  background: var(--surface-3);
  box-shadow: var(--shadow-float);
}

.menu {
  min-width: var(--size-menu);
  padding: var(--space-1);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  height: var(--size-control);
  padding: var(--space-0) var(--space-2);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
  transition: background-color var(--duration) var(--ease-out);
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--menu-hover);
}

.menu-item:disabled {
  color: var(--text-secondary);
  background: transparent;
  cursor: default;
}

.menu-item kbd {
  margin-left: auto;
}

.menu-label {
  padding: var(--space-1) var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.menu .segmented {
  display: flex;
  margin: var(--space-0) var(--space-2) var(--space-2);
}

.menu .segmented button {
  flex: 1;
}

.menu .segmented button[aria-checked="true"] {
  background: var(--surface-2);
}

.menu-separator {
  height: var(--hairline);
  margin: var(--space-1) var(--space-0);
  background: var(--border);
}

.popover {
  width: var(--size-popover);
  padding: var(--space-3);
}

.link-form {
  display: flex;
  gap: var(--space-2);
}

.popover .input {
  flex: 1;
}

.popover-error {
  margin-top: var(--space-2);
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.toasts {
  position: fixed;
  bottom: var(--space-4);
  left: calc(var(--size-sidebar) + var(--space-4));
  z-index: 30;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-float);
  background: var(--surface-3);
  box-shadow: var(--shadow-float);
}

.toast .icon {
  color: var(--text-secondary);
}

.toast.resolved .icon {
  color: var(--resolved);
}

.toast .button {
  margin-right: calc(var(--space-1) * -1);
}

.overlay {
  position: fixed;
  inset: var(--space-0);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--scrim);
}

.sheet {
  width: min(var(--size-overlay), 100%);
  padding: var(--space-4);
  border-radius: var(--radius-float);
  background: var(--surface-2);
  box-shadow: var(--shadow-float);
}

.sheet-title {
  margin-bottom: var(--space-2);
  font-weight: var(--weight-semibold);
}

.shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: var(--size-control);
}

.shortcut-label {
  color: var(--text-secondary);
}

.shortcut-keys {
  display: inline-flex;
  gap: var(--space-1);
}

/* list */

.list-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
  height: var(--size-list-head);
  padding: var(--space-0) var(--space-3);
  border-bottom: var(--hairline) solid var(--border);
}

.list-title {
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.list-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  min-width: var(--space-0);
  height: var(--size-control);
  margin-left: var(--space-2);
  padding: var(--space-0) var(--space-2);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.search:focus-within {
  border-color: var(--border-strong);
}

.search .icon {
  color: var(--text-muted);
}

.search input {
  flex: 1;
  min-width: var(--space-0);
  height: 100%;
  padding: var(--space-0);
  border: var(--space-0);
  background: transparent;
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

.search input::placeholder {
  color: var(--text-muted);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search input:focus + kbd,
.search input:not(:placeholder-shown) + kbd {
  display: none;
}

.filters {
  display: flex;
  flex-shrink: 0;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--hairline) solid var(--border);
}

.filter {
  height: var(--size-chip);
  padding: var(--space-0) var(--space-2);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-round);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  transition: background-color var(--duration) var(--ease-out);
}

.filter:hover {
  background: var(--surface-3-hover);
}

.filter[aria-pressed="true"] {
  border-color: var(--surface-3);
  background: var(--surface-3);
  color: var(--text-primary);
}

.list-error {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-3);
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.rows {
  flex: 1;
  min-height: var(--space-0);
  overflow-y: auto;
  padding: var(--space-1);
}

.rows:focus-visible {
  outline-offset: calc(var(--ring) * -1);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: var(--size-dot) var(--size-avatar) minmax(0, 1fr) auto;
  grid-template-rows: var(--size-avatar) var(--leading-sm);
  align-items: center;
  column-gap: var(--space-2);
  width: 100%;
  height: var(--size-row);
  padding: var(--space-row) var(--space-3) var(--space-row) var(--space-2);
  border: var(--space-0);
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
  transition: background-color var(--duration) var(--ease-out);
}

.row:hover {
  background: var(--surface-3-hover);
}

.row[aria-selected="true"] {
  background: var(--surface-3);
}

.row[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: var(--space-2);
  bottom: var(--space-2);
  left: var(--space-0);
  width: var(--size-bar);
  background: var(--accent);
}

.row-dot {
  grid-row: 1;
  grid-column: 1;
  width: var(--size-dot);
  height: var(--size-dot);
  border-radius: var(--radius-round);
}

.row.unread .row-dot {
  background: var(--accent);
}

.row .avatar {
  grid-row: 1;
  grid-column: 2;
}

.row-top {
  display: flex;
  grid-row: 1;
  grid-column: 3;
  align-items: baseline;
  gap: var(--space-2);
  min-width: var(--space-0);
}

.row-name {
  flex: 0 0 auto;
  max-width: 100%;
  min-width: var(--space-0);
  overflow: hidden;
  font-weight: var(--weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row.unread .row-name {
  font-weight: var(--weight-semibold);
}

.row-team {
  flex: 0 1 auto;
  min-width: var(--space-0);
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row[aria-selected="true"] .row-time,
.row[aria-selected="true"] .replied {
  color: var(--text-secondary);
}

.row-time {
  grid-row: 1;
  grid-column: 4;
  justify-self: end;
  padding-left: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-variant-numeric: tabular-nums;
}

.row-snippet {
  grid-row: 2;
  grid-column: 3;
  min-width: var(--space-0);
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: flex;
  grid-row: 2;
  grid-column: 4;
  justify-self: end;
  padding-left: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-variant-numeric: tabular-nums;
}

.wait {
  color: var(--text-secondary);
  white-space: nowrap;
}

.wait.warm {
  color: var(--waiting);
}

.wait.hot {
  color: var(--danger);
  font-weight: var(--weight-medium);
}

.replied {
  color: var(--text-muted);
  white-space: nowrap;
}

.list-empty {
  position: absolute;
  top: 25%;
  right: var(--space-0);
  left: var(--space-0);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-0) var(--space-6);
  color: var(--text-secondary);
  text-align: center;
}

.list-empty .icon {
  color: var(--text-muted);
}

/* thread */

.thread-empty {
  margin: auto;
  color: var(--text-secondary);
}

.thread-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-3);
  height: var(--size-thread-head);
  padding: var(--space-0) var(--space-4);
  border-bottom: var(--hairline) solid var(--border);
}

.who {
  flex: 1;
  min-width: var(--space-0);
}

.who-name {
  overflow: hidden;
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-lg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-meta {
  display: flex;
  gap: var(--space-2);
  min-width: var(--space-0);
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  white-space: nowrap;
}

.who-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.head-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
}

.back,
.info {
  display: none;
}

.messages {
  flex: 1;
  min-height: var(--space-0);
  overflow-y: auto;
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.day {
  margin: var(--space-6) var(--space-0) var(--space-0);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.day:first-child {
  margin-top: var(--space-0);
}

.msg {
  display: grid;
  grid-template-columns: var(--size-avatar-sm) minmax(0, var(--measure));
  align-items: center;
  column-gap: var(--space-2);
  row-gap: var(--space-1);
  margin-top: var(--space-4);
}

.msg.cont {
  margin-top: var(--space-2);
}

.msg > .avatar {
  grid-row: 1;
  grid-column: 1;
}

.author {
  display: flex;
  grid-row: 1;
  grid-column: 2;
  align-items: center;
  gap: var(--space-2);
  min-width: var(--space-0);
}

.author-name {
  overflow: hidden;
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  padding: var(--space-0) var(--space-1);
  border-radius: var(--radius-control);
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
}

.tag.helpful {
  background: var(--resolved-bg);
  color: var(--resolved);
}

.tag.unhelpful {
  background: var(--danger-bg);
  color: var(--danger);
}

.msg.note .tag {
  background: var(--waiting-bg);
  color: var(--waiting);
}

.author time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-variant-numeric: tabular-nums;
}

.msg > .body,
.msg > .article-link,
.msg > .shot {
  grid-column: 2;
}

.shot {
  justify-self: start;
  overflow: hidden;
  padding: var(--space-0);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-float);
  background: var(--surface-3);
  cursor: zoom-in;
}

.shot img {
  display: block;
  width: var(--size-shot);
  height: auto;
}

.shot-view {
  margin: var(--space-0);
  outline: none;
}

.shot-view img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 2 * var(--space-4));
  border-radius: var(--radius-float);
  box-shadow: var(--shadow-float);
}

.body {
  font-size: var(--text-md);
  line-height: var(--leading-md);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg.customer .body {
  padding: var(--space-row) var(--space-3);
  border-radius: var(--radius-control);
  background: var(--surface-3);
}

.msg.assistant .body {
  color: var(--text-secondary);
}

.msg.note .body {
  padding: var(--space-row) var(--space-3);
  border-left: var(--size-bar) solid var(--waiting-fill);
  border-radius: var(--space-0) var(--radius-control) var(--radius-control) var(--space-0);
  background: var(--waiting-bg);
}

.msg.pending .body {
  opacity: 0.6;
}

.article-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: var(--space-1);
  max-width: 100%;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: var(--underline-offset);
}

.article-link:hover {
  color: var(--text-primary);
  text-decoration-color: currentColor;
}

.event {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.composer {
  flex-shrink: 0;
  margin: var(--space-0) var(--space-4) var(--space-4);
  padding: var(--space-3);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  transition:
    border-color var(--duration) var(--ease-out),
    background-color var(--duration) var(--ease-out);
}

.composer:focus-within {
  border-color: var(--border-strong);
}

.composer.note {
  border-color: var(--waiting-border);
  background: var(--waiting-bg);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: var(--composer-min);
  max-height: var(--composer-max);
  padding: var(--space-0);
  border: var(--space-0);
  background: transparent;
  font-size: var(--text-md);
  line-height: var(--leading-md);
  resize: none;
}

.composer textarea::placeholder {
  color: var(--text-muted);
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.spacer {
  flex: 1;
}

.keys {
  display: inline-flex;
  gap: var(--space-1);
}

.composer-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

/* context */

.context-head {
  display: none;
}

.ctx-section + .ctx-section {
  margin-top: var(--space-4);
}

.ctx-title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  height: var(--size-control);
  padding: var(--space-0);
  border: var(--space-0);
  background: transparent;
  font-weight: var(--weight-semibold);
  text-align: left;
}

.ctx-title .icon {
  color: var(--text-secondary);
}

.ctx-row {
  display: grid;
  grid-template-columns: var(--size-label) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  height: var(--size-control);
}

.ctx-row dt {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.ctx-row dd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  min-width: var(--space-0);
}

.ctx-value {
  min-width: var(--space-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctx-row.stacked {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-0);
  height: auto;
  padding: var(--space-1) var(--space-0);
}

.ctx-row.stacked dd {
  justify-content: flex-start;
}

.ctx-row.stacked .ctx-value {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ctx-row .copy {
  width: var(--size-segment);
  height: var(--size-segment);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
}

.ctx-row:hover .copy,
.ctx-row .copy:focus-visible {
  opacity: 1;
}

.muted-line {
  padding: var(--space-1) var(--space-0);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.error-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-0);
  border: var(--space-0);
  background: transparent;
  text-align: left;
}

.error-msg {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-row[aria-expanded="true"] .error-msg {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error-row time {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-variant-numeric: tabular-nums;
}

.error-row.reported .error-msg {
  color: var(--danger);
}

.issue {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--size-control);
  padding: var(--space-0) var(--space-2);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
  text-decoration: none;
  transition: background-color var(--duration) var(--ease-out);
}

.issue:hover {
  background: var(--surface-3-hover);
}

.issue + .issue {
  margin-top: var(--space-1);
}

.issue-key {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.issue-title {
  flex: 1;
  min-width: var(--space-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue .icon {
  color: var(--text-muted);
}

.ctx-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* sign in */

.signin {
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-6);
  background: var(--surface-2);
}

.signin form {
  display: grid;
  gap: var(--space-2);
  width: min(var(--size-signin), 100%);
}

.signin-mark {
  margin-bottom: var(--space-3);
}

.signin h1 {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-lg);
}

.signin-lede {
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
}

.form-error {
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.form-error:empty {
  display: none;
}

.signin .button {
  margin-top: var(--space-1);
}

/* narrower windows */

@media (max-width: 1279px) {
  .app {
    grid-template-columns: var(--size-sidebar) var(--size-list) minmax(0, 1fr);
  }

  .context {
    position: fixed;
    top: var(--space-0);
    right: var(--space-0);
    bottom: var(--space-0);
    z-index: 10;
    display: none;
    width: var(--size-context);
    border-left: var(--space-0);
    box-shadow: var(--shadow-float);
  }

  .app.context-open .context {
    display: block;
  }

  .context-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--size-control);
    margin-bottom: var(--space-2);
    font-weight: var(--weight-semibold);
  }

  .info {
    display: grid;
  }
}

@media (max-width: 1023px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    overflow-x: auto;
    border-right: var(--space-0);
    border-bottom: var(--hairline) solid var(--border);
  }

  .brand {
    margin: var(--space-0) var(--space-2) var(--space-0) var(--space-0);
    padding: var(--space-0);
  }

  .views {
    display: flex;
    gap: var(--space-1);
  }

  .view-label {
    flex: none;
  }

  .account {
    margin: var(--space-0) var(--space-0) var(--space-0) auto;
  }

  .account-name {
    display: none;
  }

  .list {
    border-right: var(--space-0);
  }

  .app.has-selection .list,
  .app:not(.has-selection) .thread {
    display: none;
  }

  .back {
    display: grid;
  }

  .messages {
    padding: var(--space-3) var(--space-4) var(--space-4);
  }

  .toasts {
    left: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
