:root {
  --rail: #07373b;
  --rail-active: #ffffff;
  --ink: #14383d;
  --text: #2f5358;
  --muted: #72898e;
  --line: #dde8ea;
  --line-strong: #c8d7da;
  --page: #f3f8f9;
  --surface: #ffffff;
  --soft: #eaf3f4;
  --orange: #ff5b35;
  --green: #16843a;
  --green-soft: #e5f6e9;
  --red: #b83218;
  --red-soft: #ffe6df;
  --blue: #1277b8;
  --blue-soft: #e3f2fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--page);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(18, 119, 184, 0.18);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 64px 254px minmax(0, 1fr);
}

.icon-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px;
  background: var(--rail);
  color: #d8eeee;
}

.rail-mark {
  position: relative;
  width: 34px;
  height: 22px;
  margin: 5px 0 18px;
}

.rail-mark span {
  position: absolute;
  top: 4px;
  width: 20px;
  height: 13px;
  border: 4px solid #ffffff;
  border-radius: 7px;
}

.rail-mark span:first-child {
  left: 0;
}

.rail-mark span:last-child {
  right: 0;
  border-left-color: transparent;
}

.rail-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d6e7e8;
}

.rail-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.rail-button.active {
  background: var(--rail-active);
  color: var(--ink);
}

.rail-bottom {
  margin-top: auto;
}

.views-panel {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7fbfc;
}

.views-title {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 820;
}

.views-title button,
.views-title a,
.topbar-actions button,
.topbar-actions a,
.conversation-head button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
}

.views-title button:hover,
.views-title a:hover,
.topbar-actions button:hover,
.topbar-actions a:hover,
.conversation-head button:hover {
  background: var(--soft);
}

.view-list {
  display: grid;
  gap: 3px;
  padding: 12px 8px;
}

.view-item {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.view-item:hover {
  background: var(--soft);
  text-decoration: none;
}

.view-item svg {
  width: 20px;
  height: 20px;
}

.view-item.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--orange);
}

.view-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-item strong {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.support-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 0 18px;
}

.queue-search {
  width: min(480px, 100%);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.queue-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

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

.queue-view {
  min-width: 0;
  padding: 22px 24px;
}

.queue-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.clear-filters-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.clear-filters-button:hover {
  background: var(--soft);
}

h1,
h2,
p {
  margin-top: 0;
}

.queue-heading h1,
.conversation-head h1,
.module-placeholder h1 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.queue-heading p,
.conversation-head p,
.module-placeholder p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.message-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.message-table-head,
.message-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) minmax(150px, 0.8fr) 172px 112px;
  align-items: center;
  gap: 14px;
}

.message-table.with-answered .message-table-head,
.message-row.with-answered {
  grid-template-columns: minmax(260px, 1.65fr) minmax(170px, 0.9fr) 172px 112px 112px;
}

.message-table-head {
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.message-table-head button,
.message-table-head a {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  text-transform: inherit;
}

.message-table-head button:hover {
  color: var(--ink);
}

.message-table-head a {
  text-decoration: none;
}

.message-table-head button:hover,
.message-table-head a:hover {
  color: var(--ink);
}

.message-table-head button span,
.message-table-head a span {
  min-width: 10px;
  color: var(--orange);
}

.table-filter-section {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(20, 56, 61, 0.04);
}

.filter-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.filter-section-head strong {
  color: var(--ink);
  font-size: 14px;
}

.filter-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.message-table-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) minmax(150px, 0.8fr) 172px 112px;
  align-items: end;
  gap: 14px;
}

.table-filter-section.with-answered .message-table-filters {
  grid-template-columns: minmax(260px, 1.65fr) minmax(170px, 0.9fr) 172px 112px 112px;
}

.message-table-filters label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.message-table-filters span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.message-table-filters input,
.message-table-filters select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.message-table-filters input::placeholder {
  color: #8aa0a4;
}

.message-row {
  width: 100%;
  min-height: 74px;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.message-row:last-child {
  border-bottom: 0;
}

.message-row:hover {
  background: #f7fbfc;
}

.subject-cell {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.subject-cell strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 610;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row > span:not(.subject-cell):not(.name-cell) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 680;
}

.name-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.name-cell strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-cell small {
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-mark {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  color: var(--muted);
  stroke-width: 2;
}

mark {
  display: inline-flex;
  min-width: 50px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

mark.yes {
  background: var(--green-soft);
  color: var(--green);
}

mark.no {
  background: var(--red-soft);
  color: var(--red);
}

.detail-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  grid-template-rows: 46px minmax(0, 1fr);
  gap: 0;
  background: #ffffff;
}

.back-button {
  grid-column: 1 / -1;
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  background: #ffffff;
  color: var(--text);
  font-weight: 760;
  text-align: left;
}

.back-button:hover {
  background: #f7fbfc;
}

.conversation-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}

.conversation-head {
  min-height: 96px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.conversation-head span {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.thread {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px 22px;
  background: #fbfdfd;
}

.thread-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text);
  font-weight: 850;
}

.thread-message.agent .avatar {
  background: #d7f3e8;
  color: var(--green);
}

.bubble {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background: #ffffff;
}

.thread-message.customer .bubble {
  background: #eef8f6;
}

.bubble div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.bubble strong {
  color: var(--ink);
  font-size: 14px;
}

.bubble span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bubble p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.reply-box {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.reply-box textarea {
  width: 100%;
  min-height: 280px;
  display: block;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  color: var(--ink);
  line-height: 1.5;
}

.reply-actions {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 12px;
}

.reply-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--text);
  font-weight: 760;
}

.send-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.reply-actions .send-button,
.reply-actions .send-done-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.reply-actions .send-button {
  background: var(--orange);
  color: #ffffff;
}

.reply-actions .send-done-button {
  background: #fff1ec;
  color: var(--orange);
}

.context-pane {
  min-width: 0;
  overflow: auto;
  background: #ffffff;
}

.context-pane section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.context-pane h2 {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.2;
}

.order-list,
.related-list {
  display: grid;
  gap: 10px;
}

.order-list article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px;
  background: #fbfdfd;
}

.order-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-list strong {
  color: var(--ink);
}

.order-list span,
.order-list small,
.empty-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.order-list p {
  margin: 7px 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.related-list button,
.related-list a {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.related-list button:hover {
  background: #f7fbfc;
}

.related-list a:hover {
  background: #f7fbfc;
}

.related-list strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-history {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 14px;
}

.status-history::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: var(--line);
}

.status-history article {
  position: relative;
  display: grid;
  gap: 3px;
}

.status-history article::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
}

.status-history strong {
  color: var(--ink);
  font-size: 13px;
}

.status-history span,
.status-history p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-placeholder,
.settings-view {
  padding: 28px;
}

.module-placeholder h1,
.settings-heading h1 {
  margin-bottom: 8px;
}

.settings-heading {
  margin-bottom: 18px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-panel,
.email-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-panel-head h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.settings-panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.settings-field input,
.settings-field select {
  height: 38px;
  padding: 0 10px;
}

.settings-field input[type="color"] {
  padding: 4px;
}

.settings-field textarea {
  resize: vertical;
  min-height: 110px;
  padding: 10px;
  line-height: 1.45;
}

.settings-panel button,
.settings-panel .button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  padding: 0 13px;
  background: var(--orange);
  color: #ffffff;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
}

.settings-panel button:hover,
.settings-panel .button:hover {
  filter: brightness(0.98);
}

.settings-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.email-preview {
  padding: 18px;
}

.email-preview .metric-row {
  margin: 0 0 18px;
}

.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #253f43;
}

.preview-card header {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-top: 5px solid var(--preview-accent);
  background: #f8fbfc;
}

.preview-card img {
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
}

.preview-logo-fallback {
  width: 120px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-weight: 800;
}

.preview-card header strong {
  font-size: 18px;
}

.preview-card article {
  padding: 20px;
  font-size: 14px;
  line-height: 1.55;
}

.preview-card article a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 5px;
  padding: 0 12px;
  background: var(--preview-accent);
  color: #ffffff;
  font-weight: 780;
  text-decoration: none;
}

.preview-card footer {
  display: grid;
  gap: 3px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #fbfdfd;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 22px;
  top: 72px;
  z-index: 50;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--green);
  color: #ffffff;
  font-weight: 760;
  box-shadow: 0 16px 34px rgba(10, 72, 42, 0.22);
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.clear-filters-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.visually-hidden-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.table-empty {
  padding: 18px;
}

.attachment-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.notice {
  margin: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.notice.success {
  color: var(--green);
  background: var(--green-soft);
}

.notice.error {
  color: var(--red);
  background: var(--red-soft);
}

body > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: #ffffff;
  color: var(--ink);
}

body > header .brand {
  font-size: 17px;
  font-weight: 860;
}

body > header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body > header nav a,
body > main .button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

body > header nav a:hover,
body > main .button:hover {
  background: var(--soft);
}

body > main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(20, 56, 61, 0.04);
}

.panel + .panel,
.grid + .panel,
.panel + .grid {
  margin-top: 18px;
}

.panel.narrow {
  max-width: 430px;
  margin: 8vh auto 0;
}

.panel h1,
.panel h2 {
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 14px;
}

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

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

.stack label,
.form-grid label,
.panel > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.stack input,
.stack select,
.stack textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-transform: none;
}

.stack input,
.stack select,
.form-grid input,
.form-grid select {
  height: 38px;
  padding: 0 10px;
}

.stack textarea,
.form-grid textarea {
  min-height: 110px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

body > main button,
body > main .button:not(.secondary) {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  padding: 0 13px;
  background: var(--orange);
  color: #ffffff;
  font-weight: 780;
}

body > main .button.secondary {
  color: var(--text);
  background: #ffffff;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
  background: #fbfdfd;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.status-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.status-item strong {
  color: var(--ink);
}

.status-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.status-item.ok span {
  color: var(--green);
}

.status-item.warn span {
  color: var(--red);
}

.status-item.neutral span {
  color: var(--blue);
}

.actions,
.worker-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.clean-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
}

code {
  border-radius: 4px;
  padding: 2px 5px;
  background: var(--soft);
  color: var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 64px 220px minmax(0, 1fr);
  }

  .message-table-head,
  .message-row {
    grid-template-columns: minmax(220px, 1fr) 130px 144px 94px;
  }

  .message-table.with-answered .message-table-head,
  .message-row.with-answered,
  .table-filter-section.with-answered .message-table-filters {
    grid-template-columns: minmax(220px, 1fr) 150px 132px 88px 88px;
  }

  .message-table-filters {
    grid-template-columns: minmax(220px, 1fr) 130px 144px 94px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

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

  .context-pane {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  body > header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  body > main {
    width: calc(100vw - 24px);
    padding-top: 16px;
  }

  .grid.two,
  .form-grid,
  .status-item {
    grid-template-columns: 1fr;
  }

  .actions,
  .worker-actions {
    display: grid;
  }

  body > main .button,
  body > main button {
    width: 100%;
  }

  .app-shell {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .icon-rail {
    width: 54px;
  }

  .views-panel {
    position: static;
    grid-column: 2;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .support-workspace {
    grid-column: 1 / -1;
  }

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

  .app-topbar {
    padding: 0 12px;
  }

  .queue-view {
    padding: 16px 12px;
  }

  .settings-view {
    padding: 16px 12px;
  }

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

  .message-table {
    border-radius: 5px;
  }

  .message-table-head {
    display: none;
  }

  .filter-section-head {
    display: grid;
    gap: 3px;
  }

  .message-table-filters {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px;
  }

  .table-filter-section.with-answered .message-table-filters {
    grid-template-columns: 1fr;
  }

  .message-row {
    min-height: 122px;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 13px;
  }

  .message-row.with-answered {
    grid-template-columns: 1fr;
  }

  .message-row > span:not(.subject-cell),
  .name-cell strong,
  .name-cell small {
    white-space: normal;
  }

  .detail-layout {
    grid-column: 1 / -1;
  }

  .conversation-head,
  .thread,
  .context-pane section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .reply-actions,
  .send-actions {
    align-items: stretch;
    display: grid;
  }

  .reply-actions button {
    width: 100%;
  }

  .toast {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
  }
}
