.inbox-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.inbox-header,
.inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

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

.header-meta .header-search-shell {
  width: min(18rem, 100%);
  max-width: 18rem;
  margin-left: auto;
  flex: 0 1 18rem;
}

.meta-pill,
.compose-link,
.search-shell,
.message-tag {
  border-radius: 999px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(124, 196, 255, 0.22);
  background: rgba(124, 196, 255, 0.08);
  color: #d6ecff;
  white-space: nowrap;
}

.live-pill-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #7cc4ff;
  box-shadow: 0 0 0 0 rgba(124, 196, 255, 0.35);
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(124, 196, 255, 0.3);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(124, 196, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(124, 196, 255, 0);
  }
}

.list-row.is-processing {
  cursor: not-allowed;
  opacity: 0.92;
}

.list-row.is-processing:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
}

.meta-pill,
.compose-link {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.compose-link {
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.compose-link:hover,
.compose-link:focus-visible,
.review-filter-menu-trigger:hover,
.review-filter-menu-trigger:focus-visible,
.review-filter-pill:hover,
.review-filter-pill:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 196, 255, 0.16);
}

.review-filter-menu {
  position: relative;
  display: inline-flex;
}

.review-filter-menu-trigger {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.review-filter-menu-trigger::-webkit-details-marker {
  display: none;
}

.review-filter-menu-icon {
  font-size: 0.85rem;
  opacity: 0.75;
}

.review-filter-menu-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 0.5rem;
  min-width: 12rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1rem;
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.review-filter-menu:not([open]) .review-filter-menu-panel {
  display: none;
}

.review-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.review-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.review-filter-pill.active {
  border-color: rgba(124, 196, 255, 0.22);
  background: rgba(124, 196, 255, 0.12);
}

.review-filter-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.search-shell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
}

.search-shell-form {
  margin: 0;
  min-width: 0;
  width: 100%;
}

.search-shell-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.search-shell-input::placeholder {
  color: inherit;
  opacity: 0.7;
}

.search-icon {
  font-size: 1rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
}

.search-shell-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.search-shell-submit,
button.meta-pill.search-shell-submit {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding: 0.45rem 0.8rem;
  line-height: 1;
  min-height: 0;
  font-size: 0.92rem;
}

.search-shell-clear {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  line-height: 1;
  min-height: 0;
  font-size: 0.92rem;
}

.meta-pill.disabled,
.compose-link.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.message-list {
  margin-top: 0.25rem;
}

.message-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1rem 1rem 0.85rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.message-row:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 196, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.message-row.unread .message-subject,
.message-row.unread .message-topline strong {
  color: #fff;
}

.message-status {
  width: 10px;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 196, 255, 0.12);
}

.message-status.muted {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.message-main {
  min-width: 0;
}

.message-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
}

.message-subject {
  margin-top: 0.35rem;
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.88);
}

.message-snippet {
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.45;
}

.message-tag {
  align-self: start;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(124, 196, 255, 0.16);
  background: rgba(124, 196, 255, 0.08);
  color: #d6ecff;
  font-size: 0.82rem;
  white-space: nowrap;
}

.message-tag.soft {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 992px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .inbox-sidebar {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .inbox-content,
  .inbox-sidebar {
    padding: 1.1rem;
  }

  .inbox-header,
  .inbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .message-row {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .message-tag {
    grid-column: 2;
    justify-self: start;
  }
}

.table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-block: 1.35rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.table-shell-scroll {
  overflow: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.list-table thead th {
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-header-label {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.74);
  padding: 1rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
}

.list-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.list-row {
  transition: background 0.15s ease, transform 0.15s ease;
}


.list-row[data-href] {
  cursor: pointer;
}

.list-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.list-row.is-loading-row {
  cursor: progress;
  opacity: 0.85;
  pointer-events: none;
}

.list-row.is-loading-row:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.03);
}

.list-row.is-loading-row .list-subject-cell {
  position: relative;
  padding-right: 2rem;
}

.list-row.is-loading-row .list-subject-cell::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: -0.45rem;
  border-radius: 50%;
  border: 2px solid var(--button-loading-spinner);
  border-right-color: transparent;
  animation: button-spin 0.7s linear infinite;
  box-sizing: border-box;
  pointer-events: none;
}

.list-row:focus-visible {
  outline: 2px solid rgba(124, 196, 255, 0.35);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.05);
}

.event-log-sections {
  padding-left: 0.25rem;
}

.event-log-section {
  position: relative;
}

.event-log-section-summary {
  padding-left: 0.25rem;
}

.event-log-section-body {
  margin-left: 1.35rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.event-log-entry {
  position: relative;
}

.event-log-entry-summary {
  padding-left: 0.15rem;
}

.event-log-entry-body {
  margin-left: 1.15rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.warning-pill {
  color: #ffd9d9;
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.15);
}

.warning-pill:hover,
.warning-pill:focus-visible {
  color: #fff;
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(239, 68, 68, 0.24);
}

.list-row.unread .list-subject-cell,
.list-row.unread .list-text-cell,
.list-row.unread .list-time-cell,
.list-row.unread .list-status-cell {
  color: #fff;
  font-weight: 700;
}

.list-row td {
  padding: 1rem;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.8);
}

.list-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 196, 255, 0.12);
}

.list-dot.muted {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.list-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-subject-cell {
  min-width: 0;
  white-space: normal;
  max-width: none;
  overflow: hidden;
  text-overflow: clip;
}

.list-text-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.list-title-link {
  color: inherit;
  text-decoration: none;
}

.list-subject-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-time-cell {
  color: rgba(255, 255, 255, 0.62);
  width: 1%;
  font-variant-numeric: tabular-nums;
}

.list-confidence-cell {
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
  width: 1%;
}

.list-confidence-cell.confidence-tier-high {
  color: #7ee2a8;
}

.list-confidence-cell.confidence-tier-warm {
  color: #ffcd86;
}

.list-confidence-cell.confidence-tier-hot {
  color: #ff9f73;
}

.list-confidence-cell.confidence-tier-critical {
  color: #ff7575;
}

.list-status-cell {
  width: 1%;
}

.inbox-processing-modal {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.inbox-processing-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.72);
}

.inbox-processing-modal-panel {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(80vh, 36rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 18, 34, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.inbox-processing-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.inbox-processing-modal-body {
  display: grid;
  gap: 1rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.2rem;
}

.inbox-processing-modal-summary {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.inbox-processing-modal-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.inbox-processing-modal-value {
  color: #fff;
  font-weight: 700;
}

.inbox-processing-modal-footer {
  display: flex;
  justify-content: flex-end;
}

.upload-subject-modal {
  position: fixed;
  inset: 0;
  z-index: 1145;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 8, 16, 0.46);
  backdrop-filter: blur(4px);
}

.upload-subject-modal-backdrop {
  position: absolute;
  inset: 0;
}

.upload-subject-modal-panel {
  position: relative;
  z-index: 1;
  width: min(42rem, calc(100vw - 2rem));
  padding: 1.35rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(124, 196, 255, 0.14);
  background: linear-gradient(180deg, rgba(10, 18, 34, 0.98) 0%, rgba(8, 14, 26, 0.96) 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.upload-subject-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.upload-subject-modal-body {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.upload-subject-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.upload-subject-input {
  width: 100%;
}

.upload-subject-error {
  margin-top: 0.75rem;
}

.inbox-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 8, 16, 0.38);
  backdrop-filter: blur(2px);
}

.inbox-drop-overlay-panel {
  width: min(46rem, calc(100vw - 2rem));
  padding: 1.35rem;
  border-radius: 1.5rem;
  border: 1px dashed rgba(124, 196, 255, 0.24);
  background: rgba(8, 18, 34, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.inbox-drop-message {
  margin-top: 1rem;
}

.inbox-drop-message.is-error {
  border-color: rgba(255, 113, 113, 0.2);
  background: rgba(255, 113, 113, 0.1);
  color: #ffd2d2;
}

@media (max-width: 992px) {
  .list-table thead {
    display: none;
  }

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

  .list-row {
    padding: 0.5rem 0;
  }

  .list-row td {
    padding: 0.55rem 1rem;
    white-space: normal;
  }

  .list-cell[data-label]::before {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    content: attr(data-label);
  }

  .list-subject-cell,
  .list-text-cell,
  .list-confidence-cell,
  .list-time-cell,
  .list-status-cell {
    display: block;
    max-width: none;
  }

  .inbox-processing-modal-panel {
    width: min(100vw - 1.5rem, 40rem);
  }

  .inbox-drop-overlay-panel {
    width: min(100vw - 1.5rem, 46rem);
  }
}
