/* In-app inbox (InboxController) */
.inbox {
  --inbox-line: rgba(0, 0, 0, 0.1);
  --inbox-surface: rgba(255, 255, 255, 0.5);
  --inbox-hover: rgba(0, 0, 0, 0.05);
  --inbox-muted: #5f5f5f;

  max-width: 52rem;
  margin: 6rem auto 2rem; /* clears the fixed .glassy-top bar */
  padding: 0 1rem;
  font-family: 'Archivo-Variable', sans-serif;
}

:root.dark .inbox {
  --inbox-line: rgba(255, 255, 255, 0.12);
  --inbox-surface: rgba(255, 255, 255, 0.05);
  --inbox-hover: rgba(255, 255, 255, 0.07);
  --inbox-muted: #b0b0b0;
}

.inbox__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.inbox__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
}

.inbox__count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--major-link);
}

/* Doubles as the legend: filled in this colour means unread */
.inbox__key {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--major-link);
}

.inbox__note {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--inbox-muted);
  overflow-wrap: anywhere;
}

.inbox__empty {
  padding: 2rem 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  color: var(--inbox-muted);
}

.inbox__list,
.inbox-report {
  overflow: hidden;
  background: var(--inbox-surface);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--inbox-line);
  border-radius: 8px;
}

.inbox__list {
  list-style: none;
  margin-bottom: 0.75rem;
}

.inbox-report + .inbox-report { margin-top: 0.75rem; }

.inbox-report__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  padding: 0.6rem 0.75rem;
}

.inbox-report__name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  font-family: inherit;
  color: var(--text);
}

.inbox-report__kind {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--inbox-muted);
}

.inbox-month {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--inbox-line);
}

.inbox-month__label {
  flex: none;
  width: 4.5rem;
  font-size: 0.8rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--inbox-muted);
}

.inbox-month__weeks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inbox-week {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: none;
  border: 1px solid var(--inbox-line);
  border-radius: 50%;
  color: var(--inbox-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
}

/* A fixed dark ink reads on both the light theme's blue and the dark theme's green */
.inbox-week--unread {
  background: var(--major-link);
  border-color: var(--major-link);
  color: #0f1117;
  font-weight: 700;
}

.inbox-week:hover {
  background: var(--inbox-hover);
  border-color: var(--text);
  color: var(--text);
}
.inbox-week:focus-visible { outline: 2px solid var(--major-link); outline-offset: 2px; }

.inbox__list li + li { border-top: 1px solid var(--inbox-line); }

.inbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  background: none;
  color: var(--inbox-muted);
  font-family: inherit;
  font-weight: 400;
}

.inbox-row:hover {
  background: var(--inbox-hover);
  color: var(--text);
}

.inbox-row__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.inbox-row--unread .inbox-row__dot { background: var(--major-link); }

/* Read aloud by screen readers; the dot and weight say it on screen */
.inbox-row__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.inbox-row__subject {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: inherit;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-row__date {
  flex: none;
  font-size: 0.75rem;
  font-weight: inherit;
}

.inbox-row--unread {
  color: var(--text);
  font-weight: 700;
}

.inbox-message {
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: #fff;
}

.inbox-message--text {
  min-height: 0;
  white-space: pre-wrap;
  font-family: inherit;
}
