/* Shell shared by the signed-in pages: /requests and /inbox.
   They are ordinary pages, not overlays, so they get a page header, a real
   URL and a back link rather than a close button. */

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 20px 90px;
}

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

.page-top h1 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.15;
  margin: 0;
}

.page-top p {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 4px 0 0;
}

/* One nav row across every signed-in page, so the sections aren't dead ends. */
.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-decoration: none;
}

.page-nav a:hover { background: var(--surface-inset); color: var(--ink); }
.page-nav a[aria-current="page"] { background: var(--surface-inset); color: var(--ink); border-color: var(--border-strong); }

.count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent, #6d5efc);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rows { list-style: none; margin: 0; padding: 0; }

.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.rows li:last-child { border-bottom: 0; }
.rows li.clickable { cursor: pointer; }
.rows li.clickable:hover, .rows li.clickable[aria-current="true"] { background: var(--surface-inset); }

.who { font-weight: 600; font-size: 15px; }
.meta { color: var(--ink-muted); font-size: 13px; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty {
  color: var(--ink-muted);
  text-align: center;
  padding: 40px 24px;
  font-size: 14.5px;
}

.gate { max-width: 460px; margin: 80px auto; text-align: center; }
.gate h1 { font-family: var(--font-display); font-size: 28px; margin: 0 0 10px; }
.gate p { color: var(--ink-muted); margin: 0 0 20px; }
.gate .btn { margin: 0 4px 8px; }

.note { font-size: 13.5px; margin-top: 12px; }
.note.ok { color: var(--live); }
.note.bad { color: var(--danger); }
.hidden { display: none !important; }

/* ---- inbox: list beside the thread on a wide screen --------------------- */
.inbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.thread {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  max-height: 72vh;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.thread-head h2 { font: 600 15px/20px var(--font-text); margin: 0; }

.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: min(78%, 460px);
  padding: 9px 13px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.bubble.mine { align-self: flex-end; background: var(--accent, #6d5efc); color: #fff; }
.bubble.theirs { align-self: flex-start; background: var(--surface-inset); color: var(--ink); }

.thread-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
}

.thread-form input {
  flex: 1;
  min-width: 0;
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font: inherit;
}

.thread-form input:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* On a phone the two panes become one: the list, then the thread, with a way
   back. Two columns at this width would leave neither one usable. */
.back-to-list { display: none; }

@media (max-width: 760px) {
  .page { padding: 16px 14px 80px; }
  .page-top h1 { font-size: 22px; }
  .inbox-grid { grid-template-columns: minmax(0, 1fr); }
  .inbox-grid[data-view="thread"] .inbox-list { display: none; }
  .inbox-grid[data-view="list"] .inbox-thread { display: none; }
  .back-to-list { display: inline-flex; }
  .thread { max-height: none; min-height: 60vh; }
  .rows li { padding: 13px 14px; }
  .row-actions { width: 100%; }
  .row-actions .btn { flex: 1 1 auto; }
}
