/* ASRT Mail console — inbox view (30_inbox.css).
   An email client: quiet two-pane worklist, dense rows, one reading column.
   Reuses .mail-list / .mail-row / .mail-read / .tl from views.css and the
   design tokens from ui.css; only genuinely new structure is declared here. */

.inbox-shell {
  display: grid;
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.inbox-list-pane {
  position: sticky;
  top: calc(var(--topbar) + 14px);
  min-width: 0;
}

.inbox-list-pane .mail-list {
  max-height: min(56vh, calc(100vh - var(--topbar) - 268px));
}

.inbox-detail-pane {
  min-width: 0;
}

/* ---------- filter bar ---------- */
.inbox-filters {
  display: grid;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.inbox-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
}
.inbox-filters .switch {
  font-size: 12.5px;
  color: var(--slate);
}

/* ---------- rows ---------- */
.inbox-line1 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.inbox-subject {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--slate);
}
.mail-row .who2.seen {
  font-weight: 500;
  color: var(--slate);
}
.inbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
}
.inbox-arrived {
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.inbox-when {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.inbox-capnote {
  padding: 8px 13px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- detail ---------- */
.inbox-back {
  display: none;
}
.inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.inbox-meta-kv {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.inbox-mid {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.inbox-mid .trunc {
  min-width: 0;
  max-width: 420px;
}
.inbox-origin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}
.inbox-origin .btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-contact {
  margin-top: 5px;
}

/* message body — plain text is the default reading surface */
.inbox-body-plain {
  margin: 0;
  font: 400 13.5px/1.65 var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 720px;
}
.inbox-view-seg {
  margin-bottom: 9px;
}
.inbox-html-note {
  margin-top: 7px;
}
.inbox-html-view {
  max-width: 720px;
  font-size: 13.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.inbox-html-view p,
.inbox-html-view ul,
.inbox-html-view ol {
  margin: 0 0 0.85em;
}
.inbox-html-view ul,
.inbox-html-view ol {
  padding-left: 1.3em;
}
.inbox-html-view a {
  color: var(--cyan-deep);
  text-decoration: underline;
}
.inbox-html-view img {
  max-width: 100%;
  border-radius: var(--r);
}
.inbox-html-view blockquote {
  margin: 0 0 0.85em;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--cyan);
  color: var(--slate);
}

/* ---------- reply ---------- */
.inbox-reply {
  display: grid;
  gap: 11px;
  padding-top: 13px;
  border-top: 1px dashed var(--line-strong);
}
.inbox-result-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
}
.inbox-from {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--wash);
  font-size: 12.5px;
}
.inbox-from-addr {
  color: var(--cyan-deep);
  overflow-wrap: anywhere;
}

/* ---------- raw headers ---------- */
.inbox-headers-disc summary {
  cursor: pointer;
  list-style: none;
  color: var(--slate);
  display: flex;
  gap: 7px;
  align-items: center;
}
.inbox-headers-disc summary::-webkit-details-marker {
  display: none;
}
.inbox-headers-disc summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid var(--cyan-deep);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.12s ease;
}
.inbox-headers-disc[open] summary::before {
  transform: rotate(90deg);
}
.inbox-headers {
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
  font-size: 11.5px;
}

/* ---------- narrow screens: list, then detail (the .rail-open pattern) ---------- */
@media (max-width: 1080px) {
  .inbox-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .inbox-list-pane {
    position: static;
  }
  .inbox-detail-pane {
    display: none;
  }
  .inbox-shell.inbox-open .inbox-list-pane {
    display: none;
  }
  .inbox-shell.inbox-open .inbox-detail-pane {
    display: block;
  }
  .inbox-shell.inbox-open .inbox-back {
    display: inline-flex;
  }
  .inbox-list-pane .mail-list {
    max-height: calc(100vh - var(--topbar) - 220px);
  }
}
