/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #1d1d1b;
  --muted: #6f6f68;
  --line: #deded6;
  --accent: #146c5f;
  --accent-ink: #ffffff;
  --commit: #1f6feb;
  --danger: #9f2f2f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 10px 24px;
}

.brand {
  font-weight: 800;
  line-height: 1.1;
}

.topbar__identity {
  align-self: center;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-subnav {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  padding-left: 0;
  transition: color 140ms ease;
}

.brand-subnav:hover,
.brand-subnav:focus-visible {
  color: var(--accent);
}

.topbar__right {
  align-self: center;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: end;
}

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

.topbar__actions:not(:has(> :not([hidden]))) {
  display: none;
}

.topbar__account {
  align-content: center;
  align-items: start;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 5px;
  line-height: 1;
  min-width: 82px;
  padding-left: 14px;
}

.topbar__greeting {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 4px;
}

.topbar nav a {
  align-items: center;
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  line-height: 1;
  min-height: 34px;
  padding: 0 10px;
  transition: background 140ms ease, color 140ms ease;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
  background: #f0f0ea;
  color: var(--accent);
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-button--small {
  border-bottom: 1px solid transparent;
  font-size: 12px;
  line-height: 1;
  transition: border-color 140ms ease, color 140ms ease;
}

.topbar__signout {
  line-height: 1;
}

.link-button--small:hover {
  border-bottom-color: currentColor;
  color: var(--ink);
}

.topbar a:focus-visible,
.topbar button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.link-button--danger {
  color: var(--danger);
}

.flash {
  background: #e8f4ef;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
}

.flash--alert {
  background: #fae8e8;
}

.auth {
  margin: 80px auto;
  max-width: 360px;
}

.auth--wide {
  max-width: 520px;
}

.form-panel,
.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin-block: 12px;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-block: 12px;
}

.checkbox-field input {
  width: auto;
}

.checkbox-field label {
  justify-content: start;
}

label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
  justify-content: space-between;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.required-indicator {
  color: var(--danger);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.form-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"])),
textarea,
select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  outline: none;
  padding: 10px 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}

input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"])):focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.12);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.form-actions input,
.form-actions .button {
  width: auto;
}

.login-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  letter-spacing: 0;
}

.login-code--large {
  background: #f2f2ed;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 28px;
  margin-top: 14px;
  padding: 18px;
  text-align: center;
}

.table-actions {
  align-items: center;
  display: flex;
  white-space: nowrap;
}

.table-actions__controls {
  align-items: center;
  display: flex;
  gap: 4px;
}

.table-actions form {
  margin: 0;
}

.action-link {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  min-height: 28px;
  padding: 7px 9px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.action-link--edit {
  background: var(--ink);
  color: var(--panel);
}

.action-link--refresh {
  background: #f2f2ed;
  border-color: var(--line);
  color: var(--muted);
}

.action-link--danger {
  color: var(--danger);
}

.action-link:hover,
.action-link:focus-visible {
  border-color: currentColor;
}

.action-link--edit:hover,
.action-link--edit:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.action-link--refresh:hover,
.action-link--refresh:focus-visible {
  background: #e8e8e1;
  color: var(--ink);
}

.action-link--danger:hover,
.action-link--danger:focus-visible {
  background: #fae8e8;
}

.button,
.button--secondary,
button,
input[type="submit"] {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: var(--accent-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 10px 14px;
}

.button--secondary {
  background: #e8e8e1;
  color: var(--ink);
}

form:not(.conversation-search) input[type="submit"]:not(.button--secondary) {
  background: #dcdcd4;
  color: var(--muted);
}

form:not(.conversation-search):valid input[type="submit"]:not(.button--secondary) {
  background: var(--accent);
  color: var(--accent-ink);
}

form:not(.conversation-search):has(:invalid) input[type="submit"]:not(.button--secondary) {
  background: #dcdcd4;
  color: var(--muted);
}

.composer:valid input[type="submit"]:not(.button--secondary) {
  background: var(--commit);
}

.inbox {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfbf8;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: hidden;
}

.sidebar__header {
  border-bottom: 1px solid var(--line);
  padding: 16px 16px 14px;
}

.sidebar__header-main {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}

.sidebar__header-main h2 {
  letter-spacing: -0.03em;
  margin: 0;
}

.conversation-list {
  align-content: start;
  display: grid;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow: auto;
}

.conversation-search {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin-bottom: 0;
}

.conversation-search input[type="search"] {
  min-width: 0;
}

.conversation-filters {
  background: #eeeeea;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 1fr);
  margin-bottom: 10px;
  padding: 2px;
}

.conversation-filter {
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  min-width: 0;
  padding: 7px 4px;
  text-align: center;
  white-space: nowrap;
}

.conversation-filter--active {
  background: var(--panel);
  color: var(--ink);
}

.conversation-link {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.conversation-link[aria-current="page"] {
  background: #eef5f3;
}

.conversation-link strong,
.message__meta strong {
  font-weight: 760;
}

.conversation-link__header,
.conversation-link__meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.conversation-link__header-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  font-size: 13px;
  gap: 8px;
}

.conversation-link__phone {
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-link__preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-link__label {
  color: var(--ink);
  font-weight: 650;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.thread__header {
  align-items: end;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) auto;
  justify-content: space-between;
  padding: 18px;
}

.thread__identity {
  display: grid;
  gap: 4px;
}

.thread__identity h1 {
  margin: 0;
}

.thread__details {
  display: grid;
  gap: 2px;
}

.back-link {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 4px;
  width: fit-content;
}

.back-link::before {
  content: "<";
  font-size: 12px;
  line-height: 1;
}

.notification-toggle,
.app-install {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  padding: 8px 10px;
  white-space: nowrap;
}

.notification-toggle[hidden],
.app-install[hidden] {
  display: none;
}

.notification-toggle--topbar,
.app-install--topbar {
  font-size: 16px;
  font-weight: 750;
  padding: 8px 11px;
}

.notification-toggle__icon,
.app-install__icon {
  fill: none;
  flex: 0 0 auto;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.messages {
  align-content: start;
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  max-width: 720px;
  padding: 10px 12px;
}

.message--outbound {
  background: #e7f2ef;
  justify-self: end;
}

.message--inbound {
  background: var(--panel);
}

.message--failed {
  border-color: var(--danger);
  background: #fae8e8;
}

.message__status {
  font-weight: 650;
}

.message--failed .message__status {
  color: var(--danger);
}

.message__error {
  border-top: 1px solid rgba(159, 47, 47, 0.24);
  color: var(--danger);
  display: grid;
  font-size: 13px;
  gap: 2px;
  padding-top: 6px;
}

.message__images {
  display: grid;
  gap: 8px;
}

.message__image-link {
  display: block;
}

.message__image {
  border-radius: 6px;
  display: block;
  height: auto;
  max-height: 420px;
  max-width: min(100%, 420px);
  object-fit: contain;
}

.composer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}

.composer--disabled {
  color: var(--muted);
}

.form-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.composer__row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
}

.composer__inputs {
  display: contents;
}

.composer textarea {
  grid-column: 1 / -1;
}

.composer input[type="submit"] {
  grid-column: 3;
  width: auto;
}

.composer__attachment {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  grid-column: 1;
  justify-content: center;
  width: fit-content;
}

.composer__attachment-input {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.composer__attachment:has(.composer__attachment-input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.composer__attachment-icon {
  fill: none;
  flex: 0 0 auto;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.thread__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.contact-editor {
  position: relative;
}

.contact-editor summary {
  display: inline-block;
  list-style: none;
}

.contact-editor summary::-webkit-details-marker {
  display: none;
}

.contact-editor__form {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 360px) minmax(132px, 180px) auto;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 2;
}

.compact-field {
  margin-block: 0;
}

.contact-editor__submit {
  width: 100%;
}

.empty {
  color: var(--muted);
  padding: 24px;
}

.empty--compact {
  padding: 10px 0 0;
}

.empty--inbox {
  align-content: center;
  display: grid;
  gap: 18px;
  justify-items: start;
}

.empty--inbox h1 {
  color: var(--ink);
  margin: 0 0 6px;
}

.empty--inbox p {
  margin: 0;
}

.new-message {
  width: min(100%, 460px);
}

.new-message--sidebar {
  flex: 0 0 auto;
  width: auto;
}

.new-message summary {
  display: inline-block;
  list-style: none;
}

.new-message summary::-webkit-details-marker {
  display: none;
}

.new-message__form {
  margin-top: 12px;
}

.new-message__image-upload {
  align-items: center;
  border: 1px dashed #bfc1ba;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 12px;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  width: 100%;
}

.new-message__image-upload:hover,
.new-message__image-upload:focus-within {
  background: #f4f7f5;
  border-color: #7ca99a;
  color: #245f50;
}

.new-message__image-upload input[type="file"] {
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.new-message__automated-setting {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.sidebar .new-message__form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 14px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 32px));
  z-index: 3;
}

.page {
  margin: 28px auto;
  max-width: 900px;
  padding: 0 18px;
}

.page-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-collapse: collapse;
  width: 100%;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .auth {
    margin: 28px auto;
    padding: 0 16px;
    width: 100%;
  }

  .page {
    margin: 22px auto;
    padding: 0 14px;
  }

  .page-header {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-header h1 {
    line-height: 1.02;
    margin: 0;
  }

  .page-header .button {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
  }

  .employee-table {
    background: transparent;
    border: 0;
  }

  .employee-table thead {
    display: none;
  }

  .employee-table,
  .employee-table tbody,
  .employee-table tr,
  .employee-table td {
    display: block;
    width: 100%;
  }

  .employee-table tbody {
    display: grid;
    gap: 12px;
  }

  .employee-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .employee-table td {
    align-items: start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(88px, 0.38fr) minmax(0, 1fr);
    padding: 11px 12px;
  }

  .employee-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .employee-table td:last-child {
    border-bottom: 0;
  }

  .employee-table td:not(.table-actions) {
    overflow-wrap: anywhere;
  }

  .employee-table .table-actions {
    align-items: start;
    white-space: normal;
  }

  .employee-table .table-actions__controls {
    align-items: stretch;
    display: grid;
    gap: 8px;
  }

  .employee-table .table-actions form {
    min-width: 0;
  }

  .employee-table .action-link {
    justify-content: center;
    width: 100%;
  }

  body:has(.inbox) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .topbar {
    flex: 0 0 auto;
    align-items: start;
    gap: 10px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 12px 16px;
  }

  .topbar__identity {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar__right {
    display: contents;
  }

  .topbar nav {
    gap: 2px;
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
  }

  .topbar nav a {
    padding: 7px 8px;
  }

  .topbar__account {
    align-self: start;
    grid-column: 2;
    grid-row: 2;
    margin-left: auto;
    min-width: 0;
    padding-left: 10px;
  }

  .topbar__actions {
    align-self: start;
    display: flex;
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .notification-toggle--topbar,
  .app-install--topbar {
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;
  }

  .notification-toggle--topbar span,
  .app-install--topbar span {
    display: none;
  }

  .inbox {
    display: block;
    flex: 1 1 auto;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .inbox:has(.thread) {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .inbox:has(.thread) .sidebar {
    display: none;
  }

  .sidebar {
    border-right: 0;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }

  .sidebar__header {
    padding: 14px;
  }

  .sidebar .new-message__form {
    padding: 12px;
  }

  .sidebar .new-message__form textarea {
    min-height: 72px;
  }

  .sidebar__header-main {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }

  .sidebar .notification-toggle {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }

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

  .conversation-search input[type="submit"] {
    width: auto;
  }

  .conversation-link {
    padding: 13px 14px;
  }

  .conversation-link__header {
    align-items: start;
  }

  .conversation-link__header strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .thread {
    height: 100%;
  }

  .thread__header,
  .contact-editor__form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .thread__header {
    gap: 12px;
    padding: 14px;
  }

  .thread__identity h1 {
    font-size: 32px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .thread__actions {
    justify-content: stretch;
  }

  .thread__actions > form,
  .thread__actions > .contact-editor {
    flex: 1 1 0;
  }

  .thread__actions .button--secondary,
  .thread__actions button,
  .thread__actions input[type="submit"],
  .contact-editor summary {
    text-align: center;
    width: 100%;
  }

  .contact-editor__form {
    margin-top: 8px;
    position: static;
  }

  .messages {
    gap: 8px;
    padding: 14px;
  }

  .message {
    max-width: min(92%, 720px);
    overflow-wrap: anywhere;
  }

  .message__meta {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .composer {
    padding: 12px 14px;
  }

  .composer__row {
    align-items: end;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .composer__inputs {
    display: contents;
  }

  .composer textarea {
    grid-column: 1 / -1;
    line-height: 1.35;
    max-height: 132px;
    min-height: 76px;
    overflow-y: auto;
    padding: 11px 12px;
    resize: none;
  }

  .composer__attachment {
    grid-column: 1;
    height: 44px;
    padding: 0;
    width: 44px;
  }

  .composer__attachment span {
    display: none;
  }

  .composer input[type="submit"] {
    align-self: end;
    grid-column: 2;
    min-height: 44px;
    padding-inline: 14px;
    width: 100%;
  }
}

/* DEX revision */
.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  min-width: 0;
  width: fit-content;
}

.brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-logo,
.avatar {
  align-items: center;
  aspect-ratio: 1;
  background: #e8ece8;
  border: 1px solid #d7ddd8;
  border-radius: 50%;
  color: #315b52;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  object-fit: cover;
  overflow: hidden;
  width: 34px;
}

.brand__logo {
  border-radius: 8px;
  height: 36px;
  width: 36px;
}

.avatar--small {
  font-size: 10px;
  height: 26px;
  width: 26px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.page-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 7px 0 0;
}

.form-errors {
  background: #fff0f0;
  border: 1px solid #e8b6b6;
  border-radius: 7px;
  color: var(--danger);
  font-size: 13px;
  padding: 10px 12px;
}

.settings-page {
  min-height: calc(100vh - 64px);
  padding: 52px 28px 70px;
}

.settings-wrap {
  margin: 0 auto;
  max-width: 980px;
}

.settings-wrap--form {
  max-width: 820px;
}

.settings-back {
  margin: 0 0 0 -3px;
  padding: 5px 3px;
}

.settings-back::before {
  content: "←";
  font-size: 16px;
}

.settings-nav-row {
  align-items: center;
  display: flex;
  gap: 7px;
  margin-bottom: 25px;
}

.settings-nav {
  background: #eeeeea;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  gap: 3px;
  margin: 0;
  overflow-x: auto;
  padding: 3px;
}

.settings-nav__link {
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 750;
  padding: 8px 12px;
}

.settings-nav__link:hover,
.settings-nav__link:focus-visible,
.settings-nav__link--active {
  background: var(--panel);
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  color: var(--ink);
}

.settings-heading {
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
}

.settings-heading h1,
.settings-wrap--form > h1 {
  font-size: 34px;
  letter-spacing: -0.035em;
  margin: 0;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.settings-card__heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.settings-card__heading h2,
.settings-card__heading p {
  margin: 0;
}

.settings-card__heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

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

.settings-grid__wide {
  grid-column: 1 / -1;
}

.settings-switches,
.template-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.checkbox-field--detail {
  align-items: start;
}

.checkbox-field--detail label {
  align-items: start;
}

.checkbox-field--detail label span {
  display: grid;
  gap: 3px;
}

.checkbox-field--detail small {
  color: var(--muted);
  font-weight: 500;
}

.settings-form__actions {
  justify-content: end;
}

.automated-prefix-settings {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(32, 35, 32, 0.04);
  margin-bottom: 30px;
  overflow: hidden;
}

.automated-prefix-settings__heading {
  align-items: start;
  background: #fafaf7;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 17px 19px;
}

.automated-prefix-settings__heading h2,
.automated-prefix-settings__heading p:not(.eyebrow) {
  margin: 0;
}

.automated-prefix-settings__heading h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.automated-prefix-settings__heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.admin-only-pill {
  background: #e7f2ef;
  border-radius: 999px;
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 7px;
  text-transform: uppercase;
}

.automated-prefix-settings__form {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) auto;
  padding: 18px 19px;
}

.automated-prefix-settings__field,
.automated-prefix-settings__default {
  margin: 0;
}

.automated-prefix-settings__default {
  min-height: 42px;
}

.automated-prefix-settings__form input[type="submit"] {
  white-space: nowrap;
  width: auto;
}

.automated-prefix-settings__errors {
  grid-column: 1 / -1;
}

.canned-messages-heading {
  margin-bottom: 24px;
}

.image-setting {
  align-items: center;
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
}

.image-setting__preview {
  align-items: center;
  background: #e6ece9;
  border: 1px solid #d1dbd6;
  border-radius: 50%;
  color: #315b52;
  display: flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 800;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  width: 72px;
}

.image-setting__preview--company {
  border-radius: 12px;
}

.image-setting__preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-setting__copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.image-setting__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.image-upload {
  cursor: pointer;
  font-size: 13px;
  justify-content: center;
  padding: 8px 11px;
}

.image-upload input[type="file"] {
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.employee-name-cell {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 130px;
}

.employee-table .avatar {
  background: #e7f2ef;
  font-size: 10px;
  height: 30px;
  width: 30px;
}

.employee-table {
  border-collapse: separate;
  border-radius: 10px;
  border-spacing: 0;
  box-shadow: 0 2px 8px rgba(32, 35, 32, 0.04);
  overflow: hidden;
}

.employee-table th {
  background: #f2f2ed;
  color: #55554f;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 13px 14px;
  text-transform: uppercase;
}

.employee-table td {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  padding: 12px 14px;
  vertical-align: middle;
}

.employee-table td:first-child {
  width: 15%;
}

.employee-table .table-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.login-code {
  background: #f7f7f3;
  border: 1px solid #dfdfd8;
  border-radius: 5px;
  color: #30302d;
  display: inline-block;
  font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.03em;
  padding: 5px 7px;
}

.role-pill {
  background: #ecece7;
  border-radius: 999px;
  color: #55554f;
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  padding: 4px 7px;
  text-transform: capitalize;
}

.role-pill.admin {
  background: #e7f2ef;
  color: var(--accent);
}

.status-dot {
  background: #3a9b67;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(58, 155, 103, 0.11);
  display: inline-block;
  height: 7px;
  margin-right: 7px;
  width: 7px;
}

.status-value {
  align-items: center;
  display: inline-flex;
}

.template-admin-list {
  display: grid;
  gap: 10px;
}

.template-admin-row {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  padding: 14px;
}

.template-admin-row--inactive {
  background: #f4f4f0;
  opacity: 0.78;
}

.template-order-controls {
  display: grid;
  gap: 4px;
}

.template-order-controls form,
.template-admin-actions form {
  margin: 0;
}

.template-order-controls button {
  background: #ecece6;
  color: var(--ink);
  line-height: 1;
  padding: 7px 9px;
}

button:disabled,
input[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.template-admin-copy {
  min-width: 0;
}

.template-admin-copy p {
  color: var(--muted);
  font-size: 13px;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.template-admin-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  background: #ecece7;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  padding: 4px 7px;
}

.pill--pinned {
  background: #e1efe9;
  color: #236252;
}

.pill--inactive {
  background: #eee1e1;
  color: var(--danger);
}

.template-admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: end;
}

.template-admin-actions .action-link {
  font-size: 12px;
  min-height: 30px;
  padding: 6px 8px;
}

.variable-help {
  align-items: center;
  background: #f3f5f2;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 7px;
  padding: 10px;
}

.variable-help code {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
}

.settings-empty {
  align-items: start;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 9px;
  display: grid;
  gap: 4px;
}

.inbox {
  grid-template-columns: 360px minmax(0, 1fr);
  height: calc(100vh - 64px);
}

.thread {
  background: var(--bg);
  grid-template-rows: 132px minmax(0, 1fr) 190px;
}

.conversation-search .button--secondary {
  padding-inline: 15px;
}

.conversation-card {
  background: transparent;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 16px 15px;
  position: relative;
}

.conversation-card:hover {
  background: #f4f4ef;
}

.conversation-card--unread::before {
  background: #db6868;
  border-radius: 0 3px 3px 0;
  bottom: 12px;
  content: "";
  left: 0;
  position: absolute;
  top: 12px;
  width: 4px;
}

.conversation-card--active {
  background: #edf4f1;
}

.conversation-card__top {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
  position: relative;
}

.conversation-card__top time {
  flex: 0 0 auto;
}

.conversation-link,
.conversation-link[aria-current="page"] {
  background: transparent;
  border: 0;
  display: grid;
  gap: 5px;
  padding: 0;
}

.conversation-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.conversation-card__name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card__phone,
.conversation-card__preview {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card__preview {
  display: -webkit-box;
  line-height: 1.32;
  margin-top: 4px;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conversation-card__phone {
  font-size: 15px;
  line-height: 1.2;
}

.conversation-card__preview b {
  color: var(--ink);
}

.message {
  gap: 8px;
  line-height: 1.45;
  max-width: 80%;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message__meta {
  font-size: 12px;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.assignment-control {
  position: relative;
}

.assignment-control > summary,
.contact-editor > summary {
  list-style: none;
}

.assignment-control > summary::-webkit-details-marker,
.contact-editor > summary::-webkit-details-marker {
  display: none;
}

.assignment-control__summary {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 550;
  gap: 5px;
  margin-left: -5px;
  max-width: 190px;
  padding: 4px 5px;
}

.assignment-control__summary > span:not(.avatar, .assignment-control__chevron) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-control[open] .assignment-control__summary,
.assignment-control__summary:hover,
.assignment-control__summary:focus-visible {
  background: rgba(20, 108, 95, 0.1);
  color: var(--accent);
}

.assignment-control__chevron {
  font-size: 9px;
  position: relative;
  top: 1px;
  transition: transform 120ms ease;
}

.assignment-control[open] .assignment-control__chevron {
  transform: rotate(180deg);
}

.assignment-control--thread {
  margin-right: auto;
}

.assignment-control--thread .assignment-control__summary {
  border-radius: 999px;
  font-weight: 650;
  gap: 8px;
  margin-left: -4px;
  padding: 3px 7px 3px 4px;
}

.assignment-control--thread[open] .assignment-control__summary,
.assignment-control--thread .assignment-control__summary:hover,
.assignment-control--thread .assignment-control__summary:focus-visible {
  background: #edf4f1;
  color: var(--accent);
}

.assignment-control--thread .avatar--small {
  height: 27px;
  width: 27px;
}

.assignment-control--thread .assignment-menu {
  left: 0;
}

.assignment-menu {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(38, 43, 40, 0.12), 0 2px 6px rgba(38, 43, 40, 0.06);
  display: grid;
  gap: 0;
  left: -6px;
  min-width: 215px;
  padding: 7px;
  position: absolute;
  top: calc(100% + 5px);
  z-index: 20;
}

.assignment-control[open] .assignment-menu {
  animation: panel-in 120ms ease-out;
}

.assignment-menu > strong {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  padding: 5px 7px 7px;
  text-transform: uppercase;
}

.assignment-menu form {
  margin: 0;
}

.assignment-option {
  align-items: center;
  background: transparent;
  color: var(--ink);
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
  border-radius: 6px;
  padding: 6px 7px;
  text-align: left;
  width: 100%;
}

.assignment-option:hover,
.assignment-option:focus-visible,
.assignment-option--selected {
  background: transparent;
}

.assignment-option:hover,
.assignment-option:focus-visible {
  background: #eeeeea;
}

.assignment-option--selected {
  color: var(--accent);
  font-weight: 700;
}

.assignment-option--selected .avatar {
  background: var(--accent);
  color: var(--accent-ink);
}

.thread__header {
  align-items: stretch;
  display: block;
  gap: 5px;
  grid-template-columns: 1fr;
  padding: 13px 18px 15px;
  position: relative;
}

.thread__header-top,
.thread__contact-row,
.thread__name-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.thread__header-top {
  color: var(--muted);
  min-height: 30px;
}

.thread__header-top > time {
  font-size: 12px;
  margin-left: auto;
}

.thread__contact-row {
  align-items: end;
  justify-content: space-between;
  margin-top: 5px;
}

.thread__identity {
  display: block;
  gap: 0;
  min-width: 0;
}

.thread__name-row {
  min-width: 0;
}

.thread__name-row h1 {
  font-size: 28px;
  letter-spacing: -0.035em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread__phone {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.contact-editor > .contact-edit-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  outline: none;
  padding: 0;
  width: 30px;
}

.contact-editor[open] .contact-edit-button,
.contact-edit-button:hover,
.contact-edit-button:focus-visible {
  background: #edf4f1;
  color: var(--accent);
}

.contact-editor {
  position: static;
}

.contact-edit-button svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.contact-editor__form {
  align-items: stretch;
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(38, 43, 40, 0.12), 0 2px 6px rgba(38, 43, 40, 0.06);
  display: block;
  left: 18px;
  padding: 15px;
  right: auto;
  top: 120px;
  width: min(500px, calc(100% - 36px));
  z-index: 35;
}

.contact-editor[open] .contact-editor__form {
  animation: panel-in 140ms ease-out;
}

.contact-editor__head,
.contact-editor__form > .form-errors {
  margin-bottom: 13px;
}

.contact-editor__head {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.contact-editor__head .eyebrow {
  margin-bottom: 2px;
}

.contact-editor__close {
  align-items: center;
  background: #eeeeea;
  color: var(--muted);
  display: flex;
  font-size: 24px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 32px;
}

.contact-editor__close:hover,
.contact-editor__close:focus-visible {
  background: #e8e8e1;
  color: var(--ink);
}

.contact-editor__fields {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.contact-editor__actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: end;
  margin-top: 12px;
}

.contact-editor__cancel {
  background: transparent;
  color: var(--muted);
}

.contact-editor__cancel:hover,
.contact-editor__cancel:focus-visible {
  background: #eeeeea;
  color: var(--ink);
}

.composer {
  gap: 9px;
  grid-template-rows: minmax(58px, 1fr) auto auto;
  padding: 14px 18px;
}

.composer__input-wrap {
  display: grid;
  gap: 6px;
}

.composer textarea {
  align-self: start;
  grid-column: auto;
  height: 76px;
  line-height: 1.4;
  max-height: 100px;
  min-height: 76px;
  overflow-y: auto;
  resize: none;
}

.variable-warning,
.composer__preference-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.composer__actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.composer__tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.composer__attachment {
  grid-column: auto;
}

.composer__tool-icon {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.composer input[type="submit"] {
  flex: 0 0 auto;
  grid-column: auto;
  min-width: 68px;
}

.template-picker-wrap {
  position: relative;
}

.templates-button,
.composer__attachment {
  align-items: center;
  display: inline-flex;
  font-size: 16px;
  font-weight: 750;
  gap: 7px;
  min-height: 39px;
  padding: 10px 14px;
}

.composer__attachment {
  gap: 8px;
}

.templates-button--active {
  background: #dcebe5;
  color: #164f43;
}

.template-picker {
  animation: panel-in 140ms ease-out;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  bottom: calc(100% + 10px);
  box-shadow: 0 20px 55px rgba(31, 35, 32, 0.2);
  display: block;
  left: 0;
  max-height: none;
  min-width: 340px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: min(390px, calc(100vw - 400px));
  z-index: 45;
}

.template-picker[hidden] {
  display: none;
}

.template-picker__head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  padding: 14px 15px 10px;
}

.template-picker__head > div {
  display: grid;
  gap: 2px;
}

.template-picker__head strong {
  font-size: 15px;
}

.template-picker__head span {
  color: var(--muted);
  font-size: 12px;
}

.template-picker__close {
  align-items: center;
  background: transparent;
  color: var(--muted);
  display: flex;
  font-size: 22px;
  border-radius: 5px;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 28px;
}

.template-picker__close:hover,
.template-picker__close:focus-visible {
  background: #eeeeea;
  color: var(--ink);
}

.template-search {
  display: block;
  margin: 0 15px 10px;
  padding: 9px 10px;
  width: calc(100% - 30px);
}

.template-picker__list {
  display: block;
  max-height: 330px;
  overflow: auto;
  padding: 0 8px 10px;
}

.template-group {
  display: grid;
  gap: 4px;
}

.template-group + .template-group {
  border-top: 1px solid var(--line);
  margin-top: 7px;
  padding-top: 7px;
}

.template-group h3 {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 6px 7px;
  text-transform: uppercase;
}

.template-option {
  background: transparent;
  color: var(--ink);
  display: grid;
  font-weight: 400;
  gap: 3px;
  border-radius: 6px;
  padding: 9px 8px;
  text-align: left;
}

.template-option:hover,
.template-option:focus-visible {
  background: #eef4f1;
}

.template-option strong {
  font-size: 13px;
  font-weight: 700;
}

.template-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-empty {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 3px;
  padding: 16px 8px;
}

.template-insert-choice {
  background: #f2f5f1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.template-insert-choice p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 9px;
}

.template-insert-choice > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.template-insert-choice button {
  font-size: 12px;
  padding: 7px 9px;
}

.automated-message-toggle {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  justify-content: start;
  min-height: 38px;
  padding: 5px 9px;
}

.automated-message-toggle input {
  clip: rect(0 0 0 0);
  height: 1px;
  position: absolute;
  width: 1px;
}

.toggle-track {
  background: #b8b9b5;
  border-radius: 999px;
  display: inline-flex;
  height: 17px;
  padding: 2px;
  transition: background 140ms ease;
  width: 29px;
}

.toggle-track > span {
  background: white;
  border-radius: 50%;
  height: 13px;
  transition: transform 140ms ease;
  width: 13px;
}

.automated-message-toggle--enabled {
  border-color: #9dc8b8;
  color: #1f6553;
}

.automated-message-toggle--enabled .toggle-track {
  background: #278067;
}

.automated-message-toggle--enabled .toggle-track > span {
  transform: translateX(12px);
}

.toggle-copy {
  align-items: baseline;
  display: flex;
  gap: 5px;
  line-height: normal;
  white-space: nowrap;
}

.toggle-copy strong {
  font-size: 12px;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.automated-prefix-notice {
  color: #2b6857;
  font-size: 11px;
  min-height: 14px;
}

.automated-prefix-notice--inactive {
  color: #a3a39d;
}

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

  .employee-table {
    background: transparent;
    border: 0;
  }

  .employee-table thead {
    display: none;
  }

  .employee-table,
  .employee-table tbody,
  .employee-table tr,
  .employee-table td {
    display: block;
    width: 100%;
  }

  .employee-table tbody {
    display: grid;
    gap: 12px;
  }

  .employee-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .employee-table td {
    align-items: start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(110px, 0.3fr) minmax(0, 1fr);
    overflow-wrap: anywhere;
    padding: 10px 12px;
  }

  .employee-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .employee-table td:last-child {
    border-bottom: 0;
  }

  .employee-table .table-actions {
    white-space: normal;
  }

  .employee-table .table-actions__controls {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
  }

  .template-admin-row {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .template-admin-actions {
    grid-column: 2;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .brand__logo {
    height: 32px;
    width: 32px;
  }

  .settings-page {
    overflow-x: hidden;
    padding: 20px 14px 40px;
  }

  .settings-nav-row {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
  }

  .settings-nav {
    display: flex;
    margin: 0;
    padding: 3px;
    width: 100%;
  }

  .settings-nav__link {
    flex: 1 1 auto;
    font-size: 12px;
    padding-inline: 7px;
    text-align: center;
  }

  .settings-heading {
    align-items: start;
    flex-wrap: nowrap;
    margin-bottom: 20px;
  }

  .settings-heading h1 {
    font-size: 28px;
  }

  .settings-heading .page-subtitle {
    display: none;
  }

  .settings-heading .button {
    padding: 9px 11px;
    white-space: nowrap;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid__wide {
    grid-column: auto;
  }

  .settings-card {
    padding: 15px;
  }

  .automated-prefix-settings__form {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .automated-prefix-settings__form input[type="submit"] {
    justify-self: start;
  }

  .image-setting {
    align-items: start;
  }

  .image-setting__preview {
    height: 58px;
    width: 58px;
  }

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

  .template-admin-actions {
    align-items: stretch;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-admin-actions .action-link {
    justify-content: center;
    width: 100%;
  }

  .inbox {
    height: auto;
  }

  .thread {
    grid-template-rows: 122px minmax(0, 1fr) 185px;
  }

  .thread__header {
    gap: 10px;
  }

  .thread__header-top {
    flex-wrap: wrap;
  }

  .thread__contact-row {
    align-items: center;
  }

  .thread__name-row h1 {
    font-size: 28px;
  }

  .contact-editor__form {
    left: 10px;
    margin-top: 0;
    position: absolute;
    right: auto;
    top: 112px;
    width: calc(100% - 20px);
  }

  .contact-editor {
    flex: 0 0 auto;
    position: static;
  }

  .contact-editor > .contact-edit-button {
    display: inline-flex;
    width: 30px;
  }

  .contact-editor__fields {
    grid-template-columns: 1fr;
  }

  .composer {
    padding: 10px 12px;
  }

  .composer__actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .composer__tools {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto auto minmax(150px, 1fr);
  }

  .composer__attachment {
    height: 40px;
    width: auto;
  }

  .composer__attachment span {
    display: inline;
  }

  .composer input[type="submit"] {
    grid-column: 2;
    min-height: 42px;
  }

  .template-picker {
    border-radius: 14px 14px 9px 9px;
    bottom: 8px;
    left: 8px;
    max-height: calc(100dvh - 76px);
    min-width: 0;
    position: fixed;
    right: 8px;
    width: auto;
  }

  .template-picker__list {
    max-height: min(42dvh, 330px);
  }

  .employee-table {
    box-shadow: none;
    overflow: visible;
  }

  .employee-table,
  .employee-table tbody {
    display: grid;
    gap: 12px;
    min-width: 0;
  }

  .employee-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 9px;
    display: grid;
    gap: 10px 16px;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
    padding: 15px;
  }

  .employee-table td {
    border: 0;
    display: grid;
    font-size: 13px;
    gap: 3px;
    grid-template-columns: 1fr;
    padding: 0;
    width: auto !important;
  }

  .employee-table td::before {
    font-size: 10px;
    font-weight: 800;
  }

  .employee-table .role-pill,
  .employee-table .status-value {
    justify-self: start;
  }

  .employee-table .table-actions {
    border-top: 1px solid var(--line);
    display: flex !important;
    grid-column: 1 / -1;
    padding-top: 9px;
  }

  .employee-table .table-actions::before {
    display: none;
  }

  .employee-table .table-actions__controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .employee-table .table-actions .action-link {
    width: auto;
  }

  .automated-message-toggle {
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .topbar {
    padding-inline: 12px;
  }

  .topbar nav a {
    font-size: 13px;
    padding-inline: 6px;
  }

  .topbar__greeting {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .image-setting {
    display: grid;
  }

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

  .automated-message-toggle {
    grid-column: 1 / -1;
  }

  .templates-button,
  .composer__attachment {
    justify-content: center;
    width: 100%;
  }
}
