:root {
  color: #172018;
  background: #f4f1e9;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #b56b1f;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: white;
  border-radius: 0.35rem;
  background: #172018;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid #c9c5b8;
}

.app-header nav {
  display: flex;
  gap: 1rem;
}

.workspace-shell { min-height: 100vh; }

.workspace-header {
  display: flex;
  position: sticky;
  z-index: 10;
  top: 0;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid #c9c5b8;
  background: #f4f1e9;
}

.workspace-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.connection-state { margin: 0; color: #526454; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 52rem) minmax(14rem, 18rem);
  gap: clamp(1rem, 4vw, 3rem);
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.channel-rail,
.conversation,
.right-rail,
.work-drawer { min-width: 0; }

.channel-rail h2 { font-size: 1rem; }

.channel-rail ul,
.message-list { padding: 0; list-style: none; }

.channel-rail a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 0.35rem;
  text-decoration: none;
}

.channel-rail a.active { background: #dde7db; font-weight: 700; }

.channel-management {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #c9c5b8;
}

.channel-management h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.channel-management p { margin: 0 0 0.65rem; font-size: 0.85rem; }
.channel-management-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.channel-management-actions button { font-size: 0.8rem; }
.conversation > header h1 { margin-top: 0.25rem; font-size: clamp(1.75rem, 5vw, 3rem); }
.history { min-height: 10rem; }
.message-timeline {
  max-height: min(58vh, 46rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.2rem 0.35rem 0.35rem 0;
  scrollbar-gutter: stable;
}
.message-list { display: grid; gap: 1rem; }

.new-messages-button {
  position: sticky;
  z-index: 2;
  bottom: 0.75rem;
  margin: -0.15rem auto 0;
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 0.4rem 1rem rgb(23 32 24 / 18%);
  font-size: 0.82rem;
  font-weight: 700;
}

.message-list > li {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #dedacf;
  border-radius: 0.5rem;
  background: #faf8f2;
}

.message-meta,
.history-state { color: #526454; font-size: 0.875rem; }

.work-drawer {
  align-self: start;
  padding: 0.85rem;
  border: 1px solid #dedacf;
  border-radius: 0.5rem;
  background: #faf8f2;
}

.right-rail {
  display: grid;
  align-self: start;
  gap: 1rem;
}

.conversation-summary {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #9eac9d;
  border-radius: 0.5rem;
  background: #edf3eb;
}

.conversation-summary > header {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  justify-content: space-between;
}

.conversation-summary h2,
.conversation-summary h3,
.conversation-summary header p,
.summary-overview p,
.summary-list p,
.summary-footnote { margin: 0; }

.conversation-summary h2 { font-size: 1rem; }
.conversation-summary h3 { font-size: 0.82rem; }
.conversation-summary header p { margin-top: 0.15rem; color: #526454; font-size: 0.72rem; }

.inference-badge {
  flex: 0 0 auto;
  padding: 0.18rem 0.4rem;
  border: 1px solid #9eac9d;
  border-radius: 999px;
  color: #36513b;
  background: #f7faf5;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-overview {
  margin-top: 0.75rem;
  padding: 0.65rem;
  border-radius: 0.4rem;
  background: #fff;
}

.summary-overview p {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.summary-overview button,
.summary-actions button,
.linked-work-list button {
  min-height: auto;
  padding: 0.25rem 0.4rem;
  color: #24442c;
  border-color: #aebbaa;
  background: transparent;
  font-size: 0.7rem;
}

.summary-overview button { margin-top: 0.45rem; }

.summary-group {
  padding: 0.6rem 0;
  border-bottom: 1px solid #c7d2c4;
}

.summary-group summary {
  color: #294b31;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.summary-group > p {
  margin: 0.5rem 0 0;
  color: #526454;
  font-size: 0.75rem;
  line-height: 1.35;
}

.summary-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: grid;
  gap: 0.3rem;
  padding: 0.5rem;
  border: 1px solid #d5ddd2;
  border-radius: 0.35rem;
  background: #fff;
  font-size: 0.75rem;
}

.topic-list li > span,
.linked-work-list span { color: #526454; font-size: 0.68rem; }
.summary-list p { line-height: 1.4; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.linked-work-list button { padding: 0; border: 0; font-size: 0.78rem; font-weight: 700; text-align: left; }
.summary-footnote { padding-top: 0.6rem; color: #526454; font-size: 0.66rem; line-height: 1.35; }

.summary-source-active {
  border-color: #b56b1f !important;
  box-shadow: 0 0 0 3px rgb(181 107 31 / 22%);
}

.mention-indicator {
  color: var(--accent, #1f5134);
  font-weight: 700;
}

.mention-chips,
.mention-suggestions {
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mention-chips {
  display: flex;
  flex-wrap: wrap;
}

.mention-chips:empty {
  display: none;
}

.mention-chips li {
  align-items: center;
  color: #24442c;
  border: 1px solid #aebbaa;
  border-radius: 999px;
  background: #edf3eb;
  display: inline-flex;
  gap: 0.3rem;
  padding-left: 0.65rem;
  font-size: 0.85rem;
  font-weight: 650;
}

.mention-chips button {
  min-height: 2rem;
  color: #24442c;
  border: 0;
  border-left: 1px solid #aebbaa;
  border-radius: 0 999px 999px 0;
  background: transparent;
  padding: 0 0.55rem;
}

.mention-suggestions {
  display: grid;
  overflow: hidden;
  border: 1px solid #aebbaa;
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 0.6rem 1.5rem rgb(23 32 24 / 12%);
}

.mention-suggestions li + li {
  border-top: 1px solid #dedacf;
}

.mention-suggestions button {
  width: 100%;
  min-height: 2.75rem;
  justify-content: flex-start;
  padding: 0.55rem 0.75rem;
  color: #24442c;
  border: 0;
  border-radius: 0;
  background: white;
  text-align: left;
}

.mention-suggestions [aria-selected="true"] button,
.mention-suggestions button:hover {
  background: #dde7db;
}

.work-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.work-drawer h2 { margin: 0; font-size: 1rem; }
.work-heading p { margin: 0; color: #526454; font-size: 0.75rem; }
.work-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.work-heading-actions button,
.work-completed > button {
  min-height: auto;
  padding: 0.3rem 0.45rem;
  border-color: #aebbaa;
  color: #24442c;
  background: transparent;
  font-size: 0.75rem;
}
.work-section { padding-top: 0.8rem; border-top: 1px solid #dedacf; }
.work-section h3 { margin: 0 0 0.5rem; font-size: 0.88rem; }
.work-list { display: grid; gap: 0.75rem; padding: 0; list-style: none; }
.work-list li { padding: 0.65rem; border: 1px solid #dedacf; border-radius: 0.4rem; background: white; }
.work-title { margin: 0; font-weight: 700; }
.work-meta,
.work-due,
.work-state { margin: 0.3rem 0; color: #526454; font-size: 0.82rem; }
.work-state-pill { font-weight: 700; }
.work-ref { display: block; overflow-wrap: anywhere; color: #526454; font-size: 0.7rem; }
.work-flow-summary {
  margin: 0.75rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 0.35rem;
  background: #e8eee5;
  color: #36513b;
  font-size: 0.82rem;
}
.work-policy {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(5rem, 7rem);
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin: 0.75rem 0;
  padding: 0.8rem;
  border: 1px solid #c9c5b8;
  border-radius: 0.65rem;
  background: #e8eee5;
}
.work-policy h3,
.work-policy p,
.work-policy button { grid-column: 1 / -1; }
.work-policy h3,
.work-policy p { margin: 0; }
.work-policy p { color: #526454; font-size: 0.8rem; }
.work-policy label { font-size: 0.8rem; font-weight: 700; }
.work-policy input { width: 100%; padding: 0.35rem 0.45rem; }
.work-completion { margin: 0.45rem 0; font-size: 0.82rem; }
.work-transitions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.work-transitions button {
  min-height: auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}
.work-create {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
  padding: 0.8rem;
  border: 1px solid #c9c5b8;
  border-radius: 0.65rem;
  background: #f4f2ea;
}
.work-create h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.work-create label { font-size: 0.78rem; font-weight: 700; }
.work-create input,
.work-create textarea,
.work-create select { width: 100%; min-height: 2.5rem; padding: 0.45rem; }
.work-create textarea { min-height: 5rem; }
.work-create button { margin-top: 0.25rem; }
.work-form-help,
.work-field-help { margin: 0; color: #526454; font-size: 0.78rem; line-height: 1.4; }
.work-form-help { padding-bottom: 0.35rem; border-bottom: 1px solid #dedacf; }
.work-field-help { margin-top: -0.2rem; }
.work-source {
  margin: 0;
  padding: 0.45rem;
  border-radius: 0.3rem;
  background: #e8eee5;
  font-size: 0.78rem;
}
.work-source button,
.work-from-message-button {
  min-height: auto;
  margin-left: 0.4rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
}
.work-completed > button { width: 100%; justify-content: space-between; }
.work-completed .work-list { margin-top: 0.65rem; }
.work-checklist {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid #dedacf;
}
.work-checklist summary { color: #36513b; cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.work-step-list { display: grid; gap: 0.55rem; margin: 0.55rem 0; padding: 0; list-style: none; }
.work-step-list .work-step { padding: 0.5rem; border: 1px solid #dedacf; background: #faf8f2; }
.work-step-line { display: flex; gap: 0.4rem; align-items: baseline; justify-content: space-between; }
.work-step-title { font-size: 0.78rem; font-weight: 650; }
.work-step-state { color: #526454; font-size: 0.7rem; }
.work-step-done .work-step-title { color: #526454; text-decoration: line-through; }
.work-step select { width: 100%; min-height: 2rem; margin-top: 0.4rem; padding: 0.25rem; font-size: 0.72rem; }
.work-step-actions,
.work-step-form-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.work-step-actions button,
.work-step-form-actions button,
.work-checklist > button {
  min-height: auto;
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
}
.work-step-blocker { margin: 0.35rem 0; color: #8b2929; font-size: 0.72rem; }
.work-step-form { display: grid; gap: 0.35rem; margin-top: 0.55rem; padding: 0.55rem; border: 1px solid #c9c5b8; border-radius: 0.4rem; }
.work-step-form label { font-size: 0.72rem; font-weight: 700; }
.work-step-form input,
.work-step-form select { width: 100%; min-height: 2.25rem; padding: 0.35rem; font-size: 0.75rem; }

.empty-state,
.history-state { padding: 0.75rem; border-radius: 0.35rem; background: #ebe8de; }

.page {
  width: min(42rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) 0;
}

.eyebrow {
  color: #526454;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-notice {
  padding: 0.75rem 1rem;
  border: 1px solid #8ca08e;
  border-radius: 0.35rem;
  background: #edf4ec;
}

.auth-notice.error {
  color: #6f2020;
  border-color: #c58f8f;
  background: #faeeee;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 4.5rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
}

form {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

input,
textarea,
button,
.button {
  min-height: 3rem;
  border: 1px solid #667568;
  border-radius: 0.35rem;
  font: inherit;
}

input,
textarea {
  padding: 0.75rem;
  background: white;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.75rem 1rem;
  color: white;
  background: #24442c;
  cursor: pointer;
  text-decoration: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.message-composer,
.reply-composer {
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding: clamp(0.85rem, 2vw, 1.15rem);
  border: 1px solid #c9c5b8;
  border-radius: 0.65rem;
  background: #faf8f2;
  box-shadow: 0 0.35rem 1rem rgb(23 32 24 / 6%);
}

.composer-mode {
  display: inline-flex;
  width: fit-content;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid #c9c5b8;
  border-radius: 0.5rem;
  background: #f0ede4;
}

.composer-mode button {
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  color: #526454;
  border: 0;
  background: transparent;
  font-weight: 700;
}

.composer-mode button.active {
  color: white;
  background: #24442c;
}

.composer-panel,
.task-composer,
.task-options-fields {
  display: grid;
  gap: 0.75rem;
}

.task-composer > label,
.task-options-fields label {
  font-size: 0.85rem;
  font-weight: 700;
}

.task-composer > input,
.task-options-fields input,
.task-options-fields select,
.task-options-fields textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
}

.task-options {
  padding: 0.7rem 0.8rem;
  border: 1px solid #dedacf;
  border-radius: 0.5rem;
  background: #f4f2ea;
}

.task-options summary { color: #36513b; cursor: pointer; font-weight: 700; }
.task-options-fields { margin-top: 0.8rem; }
.task-options-fields textarea { min-height: 5rem; }
.composer-status { margin: 0; color: #36513b; font-size: 0.85rem; }

.composer-heading {
  display: flex;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.composer-heading label {
  font-size: 1rem;
  font-weight: 750;
}

.composer-hint {
  color: #526454;
  font-size: 0.78rem;
}

.composer-body {
  display: grid;
  gap: 0.65rem;
}

.composer-body textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.85rem 0.95rem;
  border-color: #8a978b;
  border-radius: 0.5rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgb(23 32 24 / 5%);
}

.composer-body textarea::placeholder {
  color: #778278;
}

.composer-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.15rem;
}

.composer-actions button {
  min-height: 2.75rem;
  border-radius: 0.45rem;
  font-weight: 700;
}

.composer-attach {
  color: #24442c;
  border-color: #8ca08e;
  background: transparent;
}

.composer-send {
  min-width: 8.5rem;
  justify-content: center;
  background: #24442c;
}

.composer-send:not(:disabled):hover {
  background: #193820;
}

.delivery-state {
  color: #526454;
  font-size: 0.85rem;
}

.author-presence {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.presence-dot {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid #667568;
  border-radius: 999px;
  background: #b6b9b1;
}

.presence-online .presence-dot {
  border-color: #2f6f3e;
  background: #55a868;
}

.presence-away .presence-dot {
  border-color: #8a6817;
  background: #d4a72c;
}

.unread-count {
  display: inline-flex;
  min-width: 1.5rem;
  min-height: 1.5rem;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  color: white;
  border-radius: 999px;
  background: #24442c;
  font-size: 0.75rem;
  font-weight: 700;
}

.delivery-state.failed {
  color: #8b2929;
}

.delivery-state button {
  min-height: auto;
  margin-left: 0.5rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}

.reaction-bar,
.reaction-groups,
.reaction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.reaction-bar {
  margin: 0.45rem 0;
}

.reaction-group {
  display: inline-flex;
  align-items: center;
}

.reaction-group button,
.reaction-picker button {
  min-height: auto;
  padding: 0.25rem 0.5rem;
  color: #24442c;
  border-color: #aebbaa;
  border-radius: 999px;
  background: #f3f6f1;
}

.reaction-empty,
.reaction-removal-state {
  color: #526454;
  font-size: 0.8rem;
}

.thread-button,
.thread-close {
  min-height: auto;
  padding: 0.35rem 0.6rem;
  color: #24442c;
  background: transparent;
  font-size: 0.85rem;
}

.thread-panel {
  position: fixed;
  z-index: 20;
  inset: 0 0 0 auto;
  width: min(38rem, calc(100vw - 2rem));
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 1px solid #c9c5b8;
  border-radius: 0;
  background: #faf8f2;
  box-shadow: -0.75rem 0 2rem rgb(23 32 24 / 16%);
}

.thread-panel > header {
  display: flex;
  position: sticky;
  z-index: 1;
  top: -1rem;
  align-items: center;
  justify-content: space-between;
  margin: -1rem -1rem 0;
  padding: 1rem;
  border-bottom: 1px solid #c9c5b8;
  background: #faf8f2;
}

.thread-panel h2 {
  margin: 0;
}

.thread-root {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #c9c5b8;
}

.thread-replies {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.thread-empty,
.permission-state {
  color: #526454;
}

.typing-indicator {
  min-height: 1.25rem;
  margin: 0.25rem 0;
  color: #526454;
  font-size: 0.875rem;
}

.message-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
}

.message-content p {
  flex-basis: 100%;
  margin-bottom: 0;
  white-space: pre-wrap;
}

.message-content code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  background: #e4e3dc;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.message-content a {
  color: #245c36;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

.message-attachments {
  display: grid;
  flex-basis: 100%;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 20rem));
}

.message-attachment { display: flex; min-width: 0; flex-direction: column; gap: 0.25rem; }

.image-attachment img {
  display: block;
  width: 100%;
  max-height: 20rem;
  border: 1px solid #c9c5b8;
  border-radius: 0.35rem;
  object-fit: contain;
}

.file-attachment { padding: 0.65rem; border: 1px solid #c9c5b8; border-radius: 0.35rem; background: #f4f2ea; }
.pending-attachments { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.pending-attachments:empty { display: none; }
.pending-attachments li { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 0.55rem 0.65rem; border: 1px solid #dedacf; border-radius: 0.4rem; background: white; }
.pending-attachments button { min-height: 2rem; padding: 0.25rem 0.5rem; }

.edit-button,
.edit-composer button,
.edit-state button,
.delete-button,
.delete-confirmation button,
.delete-state button {
  min-height: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.edit-button {
  color: #24442c;
  background: transparent;
}

.delete-button {
  color: #8b2929;
  background: transparent;
}

.edit-composer {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-left: 3px solid #526454;
}

.edit-composer textarea {
  width: 100%;
}

.edit-state {
  color: #526454;
  font-size: 0.8rem;
}

.edit-state.failed {
  color: #8b2929;
}

.edit-state button {
  margin-left: 0.4rem;
}

.delete-confirmation,
.delete-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #8b2929;
  font-size: 0.8rem;
}

.delete-state.failed {
  color: #8b2929;
}

@media (max-width: 44rem) {
  .app-header,
  .workspace-header { align-items: flex-start; flex-direction: column; }
  .workspace-layout { display: block; padding: 0.75rem; }
  .channel-rail { overflow-x: auto; padding-bottom: 0.75rem; border-bottom: 1px solid #c9c5b8; }
  .channel-rail h2 { margin-bottom: 0.35rem; }
  .channel-rail ul { display: flex; width: max-content; gap: 0.35rem; margin: 0; }
  .channel-rail a { min-width: 9rem; }
  .conversation { padding-top: 1rem; }
  .message-timeline { max-height: 55vh; }
  .conversation,
  .right-rail,
  .conversation-summary,
  .work-drawer { width: 100%; max-width: 100%; }
  .right-rail { margin-top: 1.25rem; }
  .thread-panel {
    inset: 0;
    width: 100%;
    padding: max(1rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    border: 0;
    box-shadow: none;
  }
  .thread-panel > header {
    top: calc(-1 * max(1rem, env(safe-area-inset-top)));
    margin: calc(-1 * max(1rem, env(safe-area-inset-top))) calc(-1 * max(0.75rem, env(safe-area-inset-right))) 0 calc(-1 * max(0.75rem, env(safe-area-inset-left)));
    padding: max(1rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.75rem max(0.75rem, env(safe-area-inset-left));
  }
  .message-attachments { grid-template-columns: minmax(0, 1fr); }
  .pending-attachments li { align-items: stretch; flex-direction: column; }
  .composer-heading { align-items: flex-start; flex-direction: column; }
  .composer-actions { align-items: stretch; flex-direction: column-reverse; }
  .composer-actions button { width: 100%; justify-content: center; }
  .composer-body textarea { min-height: 8.5rem; }
}

@media (forced-colors: active) {
  .presence-dot { border-color: CanvasText; background: CanvasText; }
  .unread-count { border: 1px solid CanvasText; }
}
