/* v7: the owner's account. The dot on the corner face and the menu counts (js/ui/avatar.js), the inbox (.ib-),
   the owner panel (.op-), the author's replies and "Redeem a code" (.fb-). Sheets render outside #screen. */

/* ---------- the corner: a dot for an unseen reply / a new message ---------- */
.av-btn { position: relative; }
.av-btn__dot {
  position: absolute; top: 3px; left: calc(var(--corner-h, 42px) - 15px); width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px rgb(var(--bg-rgb) / 0.9); pointer-events: none;
}
.av-btn__dot[hidden] { display: none; }
.av-menu__label { flex: 1 1 auto; min-width: 0; }
.av-menu__count {
  flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center;
  background: rgb(var(--cta-rgb)); color: #fff; font: 700 12px/1 var(--f-sans); font-variant-numeric: tabular-nums;
}
.av-menu__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ---------- inbox ---------- */
.ib { padding: 2px 0 20px; }
.ib-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 0 10px; }
/* on a wide screen the filters and the search stay on top while the list scrolls (an opaque strip: no text shows through) */
@media (min-width: 720px) {
  .ib-bar { position: sticky; top: -8px; z-index: 2; margin: 0 -22px; padding: 8px 22px 10px; background: rgb(var(--sheet-rgb, var(--bg-rgb))); box-shadow: 0 1px 0 var(--line); }
}
/* one row; a longer translation scrolls sideways instead of breaking into two rows */
.ib-filters { display: flex; flex-wrap: nowrap; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; }
.ib-filters::-webkit-scrollbar { display: none; }
.ib-filter { flex: none; gap: 5px; min-height: 36px; padding-inline: 11px; font-size: 14px; }
.ib-filter__n { font-variant-numeric: tabular-nums; opacity: 0.7; font-weight: 700; }
.ib-search { flex: 1 1 220px; min-width: 0; max-width: 100%; min-height: 40px; }
.ib-live { margin: 2px 0 8px; font-size: 12px; }
.ib-list { display: flex; flex-direction: column; gap: 10px; }
.ib-empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 15px; }
.ib-item { padding: 14px 16px 12px; border-radius: var(--r-s, 14px); background: rgb(var(--fg-rgb) / 0.05); box-shadow: inset 0 0 0 1px var(--line); }
.ib-item.is-new { box-shadow: inset 3px 0 0 rgb(var(--cta-rgb)), inset 0 0 0 1px var(--line); }
.ib-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; line-height: 1.3; }
.ib-who { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ib-dotsep { color: var(--faint); }
.ib-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-kind, .ib-tag, .ib-new {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgb(var(--fg-rgb) / 0.09); color: var(--fg);
}
.ib-kind--idea { background: rgb(255 214 10 / 0.18); }
.ib-kind--bug { background: rgb(255 69 58 / 0.18); }
.ib-tag--will { background: rgb(var(--cta-rgb) / 0.2); }
.ib-tag--done { background: rgb(48 209 88 / 0.22); }
.ib-tag--wont { background: rgb(var(--fg-rgb) / 0.08); color: var(--muted); }
.ib-new { background: rgb(var(--cta-rgb)); color: #fff; }
.ib-text { margin: 8px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ib-replies { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ib-reply { padding: 8px 12px; border-radius: 10px; background: rgb(var(--cta-rgb) / 0.12); }
.ib-reply--done { background: rgb(48 209 88 / 0.14); }
.ib-reply__who { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.ib-reply__text { margin: 2px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-reply__when { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ib-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-tagbtn { min-height: 34px; }
.ib-tagbtn[aria-pressed="true"][data-tag="will"] { background: rgb(var(--cta-rgb)); color: #fff; }
.ib-tagbtn[aria-pressed="true"][data-tag="done"] { background: var(--green); color: #04210d; }
.ib-tagbtn[aria-pressed="true"][data-tag="wont"] { background: rgb(var(--fg-rgb) / 0.32); color: var(--fg); }
.ib-replybtn { margin-left: auto; }
.ib-replyform { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ib-replyform__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ib-replyform .ac-muted { font-size: 12px; }
@media (max-width: 479px) {
  .ib-filters { gap: 4px; }
  .ib-filter { padding-inline: 9px; font-size: 13px; gap: 4px; }
  .ib-replybtn { margin-left: 0; }
  .ib-search { flex-basis: 100%; }
}

/* ---------- the author's replies (in "Write to the author") ---------- */
.fb-top:empty { display: none; }
.fb-replies { margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); outline: none; }
.fb-replies__title { margin: 0 0 10px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.fb-thread + .fb-thread { margin-top: 14px; }
.fb-reply { padding: 12px 14px; border-radius: var(--r-s, 14px); background: rgb(var(--cta-rgb) / 0.1); }
.fb-reply + .fb-reply { margin-top: 8px; }
.fb-reply.is-new { box-shadow: inset 3px 0 0 rgb(var(--cta-rgb)); }
.fb-reply--done { background: rgb(48 209 88 / 0.14); }
.fb-reply--done.is-new { box-shadow: inset 3px 0 0 var(--green); }
.fb-reply__quote { margin: 0 0 8px; padding-left: 10px; border-left: 2px solid var(--line-strong); font-size: 13px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.fb-reply__kind { font-weight: 600; }
.fb-reply__text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-reply__when { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-noreply { margin-bottom: 14px; }
.fb-code { font-size: 20px; letter-spacing: 0.12em; text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* ---------- owner panel ---------- */
.op { padding: 2px 0 22px; }
.op-view { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--r-s, 14px); background: rgb(var(--cta-rgb) / 0.12); }
.op-view__text { min-width: 0; }
.op-view__title { margin: 0; font-size: 15px; font-weight: 650; }
.op-view .op-note { margin-top: 2px; }
.op-view .switch { flex: none; }
.op-cols { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 720px) { .op-cols { grid-template-columns: 1fr 1fr; } .op-ann, .op-gift, .op-promos, .op-errs { grid-column: 1 / -1; } }
.op-card { min-width: 0; padding: 14px 16px 16px; border-radius: var(--r-s, 14px); background: rgb(var(--fg-rgb) / 0.05); box-shadow: inset 0 0 0 1px var(--line); }
.op-card__title { margin: 0 0 10px; font-size: 13px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.op-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.op-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-tile__n { font: 700 26px/1.1 var(--f-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.op-tile__label { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.op-tile__sub { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.op-note { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.op-note--plain { margin: 0; font-size: 15px; color: var(--fg); }
.op-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.op-bar { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; border-radius: 8px; font-size: 13px; overflow: hidden; }
.op-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: rgb(var(--cta-rgb) / 0.22); border-radius: inherit; }
.op-bar > * { position: relative; }
.op-bar__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-bar__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.op-never { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.op-never__label { margin: 0 0 2px; font-weight: 650; color: var(--fg); }
.op-never__line { margin: 0; }
.op-never__kind { font-weight: 600; }
.op-form { display: flex; flex-direction: column; gap: 10px; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.op-span { grid-column: 1 / -1; }
.op-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.op-row .op-note { margin: 0; flex: 1 1 180px; }
.op-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.op-num { font-variant-numeric: tabular-nums; }
.op-ann-text { min-height: 64px; }
.op-ann-now { margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.op-ann-now .op-note { margin: 0; }
.op-ann-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 10px; background: rgb(var(--cta-rgb) / 0.12); }
.op-ann-item__text { margin: 0; font-size: 14px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.op-ann-item .btn { flex: none; }
.op-codes, .op-errors { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.op-code { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 7px 10px; border-radius: 8px; background: rgb(var(--fg-rgb) / 0.05); font-size: 13px; }
.op-code__code { font-weight: 700; letter-spacing: 0.06em; }
.op-code__left, .op-code__until { color: var(--muted); font-variant-numeric: tabular-nums; }
.op-err { padding: 8px 10px; border-radius: 8px; background: rgb(255 69 58 / 0.08); }
.op-err__head { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.op-err__msg { margin: 2px 0 0; font: 500 13px/1.4 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.op-inbox { width: 100%; margin-top: 14px; gap: 8px; }
.op-inbox__n:empty { display: none; }
.op-inbox__n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; background: rgb(var(--cta-rgb)); color: #fff; font: 700 12px/1 var(--f-sans); }
.op .ac-error[hidden], .ib .ac-error[hidden] { display: none; }
.op .ac-error { margin: 0 0 10px; }
.op-form .ac-error { margin: 0; }
.op-form .input, .op-form .select { font-size: 15px; }
/* the gift on a wide screen: nickname, sparks and the item in one row */
@media (min-width: 720px) {
  .op-gift .op-grid { grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1.4fr); }
  .op-gift .op-span { grid-column: auto; }
}
