/* Pull to refresh: a dark list of requests on a black page, the ring and the new request in coral. */
:root {
  --page: #000000;          /* the page */
  --panel: #0b0b0d;         /* the list's box */
  --edge: #1d1d21;
  --card: #151518;          /* a request */
  --ink: #f3f3f5;
  --soft: #b4b4bc;
  --muted: #7f7f88;
  --track: #26262b;
  --accent: #ff6b4a;        /* the ring and the new request */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Golos Text Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 12px;
}

.inbox {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: min(620px, calc(100svh - 48px));
  border: 1px solid var(--edge);
  border-radius: 30px;
  background: var(--panel);
  overflow: hidden;
}

/* ---------------------------------------------------------------- the head */
.inbox__head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 18px 12px 22px;
  background: var(--panel);
}

.inbox__title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.inbox__when {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.inbox__refresh {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .inbox__refresh:hover {
    background: #17171a;
    border-color: #2b2b31;
  }
}

.inbox__refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html[data-using='pointer'] .inbox__refresh:focus-visible {
  outline: none;
}

.inbox__refresh svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- the ring behind the list */
.inbox__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.ptr {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
}

.ptr__ring {
  width: 34px;
  height: 34px;
  overflow: visible;
}

.ptr__track,
.ptr__arc {
  fill: none;
  stroke-width: 3;
}

.ptr__track {
  stroke: var(--track);
}

.ptr__arc {
  stroke: var(--accent);
  stroke-linecap: round;
}

.ptr__arrow,
.ptr__check {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ptr__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- the list */
.inbox__scroll {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 4px 12px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.inbox__scroll::-webkit-scrollbar {
  display: none;
}

/* while it is held the list does not scroll, and nothing gets selected */
.inbox__scroll.is-held {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

.inbox__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--card);
  transition: border-color 1.2s, background-color 1.2s;
  will-change: transform;
}

.row__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tone);
  color: #141414;
  font-size: 14px;
  font-weight: 700;
}

.row__text {
  flex: 1;
  min-width: 0;
}

.row__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.row__name {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent);
  color: #1a0b06;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 1.2s;
}

.row__time {
  flex: none;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.row__msg {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* the new request, lit for a moment */
.row.is-new {
  border-color: rgba(255, 107, 74, 0.55);
  background: #1d1412;
}

.row:not(.is-new) .row__badge {
  opacity: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
