/* Redesign phase 4b: unread counts, the bell, the Chat tab, plan cards in
   the chat and the Notifications page. Tokens come from r.css. */

.r-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: var(--on-pink); font-size: 11px; font-weight: 800; line-height: 1; box-sizing: border-box; }
.r-iconbtn, .r-bar a, .r-bell { position: relative; }
.r-iconbtn > .r-count { position: absolute; top: -2px; right: -2px; }
.r-icowrap { position: relative; display: inline-flex; }
.r-icowrap .r-count { position: absolute; top: -6px; left: 60%; }
.r-button-count, .button > .r-count { margin-left: 8px; }

/* The bell: in the header in a browser; in the installed phone app (standalone) the header drops it and home carries it on its own title row. */
.r-bell { color: var(--part-header-fg, inherit); width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--text) !important; text-decoration: none; flex: none; }
.r-bell:hover { background: var(--tile); }
.r-bell .r-count { position: absolute; top: 3px; right: 1px; }
.r-bell-narrow { display: none; justify-content: flex-end; margin: 6px -10px -14px 0; }
.r-bell-narrow .r-bell { width: 44px; height: 44px; border-radius: 22px; }
@media (display-mode: standalone) and (max-width: 899px), (display-mode: fullscreen) and (max-width: 899px) {
  .r-bell-narrow { display: flex; }
}
@media (min-width: 900px) {
  .r-bell { width: 44px; height: 44px; border-radius: 22px; }
  .r-top .r-bell { margin-right: -4px; }
}

/* Unread count and time on a group row */
.rc-when { font-size: 12px; color: var(--muted); flex: none; }
.rc-unread { flex: none; min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px; }

/* Plan card in the chat log */
.r .chat-plan { align-self: stretch; max-width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.chat-plan-cap { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.chat-plan-card { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-plan-main { display: flex; flex-direction: column; gap: 3px; color: var(--text) !important; text-decoration: none; }
.chat-plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chat-plan-title { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.chat-plan-top .r-chip { flex: none; margin-right: 0; white-space: nowrap; }
.chat-plan-sub { font-size: 14px; color: var(--muted); }
.chat-plan-meter { display: flex; align-items: center; gap: 10px; }
.chat-plan-meter .r-meter { flex: 1; }
.chat-plan-meter .r-seg { height: 6px; }
.chat-plan-came { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.chat-plan-came a { font-weight: 800; min-height: 32px; display: inline-flex; align-items: center; }
.chat-plan-count { font-size: 13px; font-weight: 700; flex: none; }
.chat-poll-options { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.chat-poll-go { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 22px; font-size: 15px; font-weight: 800; text-decoration: none; }
.chat-plan-vote { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chat-plan-vote button { height: 44px; border-radius: 22px; font-size: 15px; font-weight: 800; }
/* Voted state of a plan card: the answer and a Change fold that brings the buttons back. */
.chat-plan-voted > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; cursor: pointer; }
.chat-plan-voted > summary::-webkit-details-marker { display: none; }
.chat-plan-said { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 15px; font-weight: 800; background: var(--ok-bg); color: var(--ok-fg); }
.chat-plan-voted-out .chat-plan-said { background: var(--gray-bg); color: var(--text); }
.chat-plan-change { font-size: 14px; font-weight: 700; color: var(--link); text-decoration: underline; padding: 8px 4px; }
.chat-plan-voted[open] .chat-plan-change { color: var(--muted); }
.chat-plan-voted .chat-plan-vote { margin-top: 8px; }
.chat-plan-vote button[aria-pressed="true"] { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat-plan-voted > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 12px; }

/* Notifications */
.rn-head { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
.rn-markall { height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--link); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.rn-page { display: flex; flex-direction: column; gap: 18px; }
.rn-sec { display: flex; flex-direction: column; gap: 6px; }
.rn-list { display: flex; flex-direction: column; gap: 6px; }
.rn-item { display: flex; gap: 12px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--text) !important; }
.rn-item.is-unread { background: var(--card); border: 1px solid var(--card-line); }
.rn-item:hover { background: var(--tile); }
.rn-icon { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--f3-bg); color: var(--f3-fg); }
.rn-new_plan { background: var(--f1-bg); color: var(--f1-fg); }
.rn-on { background: var(--pink); color: var(--on-pink); }
.rn-cancelled { background: var(--gray-bg); color: var(--muted); }
.rn-reminder, .rn-recap { background: var(--f2-bg); color: var(--f2-fg); }
.rn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rn-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.rn-body { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.rn-when { font-size: 12px; color: var(--muted); }
.rn-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--pink); margin-top: 6px; flex: none; }
.rn-settings { align-self: center; font-size: 14px; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

.r-sec-links { display: inline-flex; align-items: center; gap: 16px; }
/* An owner or admin announcement in the chat log */
.r .chat-announce { align-self: stretch; max-width: 100%; text-align: left; border-radius: 20px; background: var(--plum-bg); border: 1px solid var(--plum-bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.r .chat-announce-cap { font-size: 13px; font-weight: 800; color: var(--plum); }
.r .chat-announce .chat-meta { padding: 0; }
.r .chat-announce .chat-body { background: none; border: 0; border-radius: 0; padding: 2px 0 0; font-size: 16px; color: var(--text); }
.r .chat-announce .chat-actions { top: 6px; left: auto; right: 6px; }
.r .chat-announce.chat-deleted { background: none; border: 1px dashed var(--line); }
.r .chat-announce.chat-mine .chat-meta { justify-content: flex-start; }
.r .rg-actions .rg-announce-btn { grid-column: 1 / -1; min-height: 48px; }
