/* Referent · цвета продукта и результат справа: стопки писем, строки «Сначала это», обещания, дни недели с задачами. */
:root {
  --brand: #6d2856; --brand-2: #8a3a6e; --brand-ink: #521d40; --brand-soft: #f7edf3; --brand-line: #ead3e0;
  --accent: #c7b8ea; --accent-soft: #f1edfb; --accent-ink: #4a3a86;
}
.w-mark svg .rf-flag { fill: var(--accent); }

/* виды писем и люди: --c линия, --cs фон, --ci текст */
.c-cli, .t-a { --c: var(--brand); --cs: var(--brand-soft); --ci: var(--brand-ink); }
.c-sup { --c: #c27c0e; --cs: #fdf3e0; --ci: #7a4d00; }
.c-bank, .t-b { --c: #6a58c4; --cs: var(--accent-soft); --ci: var(--accent-ink); }
.c-news { --c: #8b9691; --cs: #f1f3f2; --ci: #59635f; }
.t-me { --c: var(--brand); --cs: var(--brand); --ci: #fff; }
.t-bad { --c: var(--bad); --cs: var(--bad-soft); --ci: var(--bad-ink); }
.rf-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.rf { position: relative; display: flex; flex-direction: column; gap: 14px; }

/* шапка результата: сколько пришло и что понял */
.rf-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; min-height: 40px; }
.rf-tot { display: flex; align-items: center; gap: 10px; }
.rf-n { font-size: 38px; line-height: 1; letter-spacing: -.03em; color: var(--brand); font-variant-numeric: tabular-nums; min-width: 1.3em; }
.rf-tot > span { display: flex; flex-direction: column; line-height: 1.25; }
.rf-tot > span b { font-size: 16px; }
.rf-tot > span small, .rf-vh small { font-size: 13px; color: var(--muted); }
.rf-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-left: auto; }
.rf-cl { font-size: 13.5px; color: var(--muted); margin-right: 2px; }
.rf-cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; background: var(--cs); color: var(--ci);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.rf-cat i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

/* ---------- почта ---------- */
.rf-body { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rf-first { border: 1px solid var(--brand-line); border-radius: 14px; padding: 9px 10px 4px; background: #fff;
  box-shadow: 0 8px 20px -14px color-mix(in srgb, var(--brand) 60%, transparent); }
.rf-fh { display: flex; align-items: center; gap: 8px; padding: 1px 4px 7px; }
.rf-fh b, .rf-prh b, .rf-ctl-h { font-size: 13px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink); }
.rf-fc { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 750;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.rf-fs { margin-left: auto; font-size: 13px; color: var(--good-ink); font-weight: 650; }
.rf-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 4px 6px; border-top: 1px solid var(--line-2); }
.rf-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--cs); color: var(--ci); font-size: 13px; font-weight: 750;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); letter-spacing: -.02em; }
.rf-av .rf-ic { width: 18px; height: 18px; }
.rf-av.sm { width: 24px; height: 24px; font-size: 13px; border: 0; }
.rf-r1 { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; min-width: 0; min-height: 22px; }
.rf-r1 b { font-size: 14.5px; }
.rf-tag { font-size: 13px; color: var(--ci); background: var(--cs); padding: 0 7px; border-radius: 6px; line-height: 20px; }
.rf-st { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 650;
  white-space: nowrap; line-height: 20px; }
.rf-st.ok { background: var(--good-soft); color: var(--good-ink); }
.rf-st.me { background: var(--warn-soft); color: var(--warn-ink); }
.rf-st .rf-ic { width: 14px; height: 14px; }
.rf-r2 { font-size: 14px; color: var(--ink-2); line-height: 1.32; margin-top: 1px; }
.rf-dp { margin-top: 5px; font-size: 13.5px; font-style: italic; line-height: 1.35; color: var(--brand-ink); background: var(--brand-soft); border-radius: 8px; padding: 4px 9px; min-height: 26px; }

.rf-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rf-piles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rf-pile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 9px 6px 9px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); min-width: 0; }
.rf-stack { position: relative; width: 64px; height: 58px; flex: none; }
.rf-stack i { position: absolute; left: 4px; bottom: calc(var(--k) * 3.4px); width: 56px; height: 37px; }
.rf-stack svg { display: block; width: 56px; height: 37px; transform: rotate(calc(var(--r) * 1deg)); filter: drop-shadow(0 1px 1.5px rgba(17, 24, 22, .12)); }
.rf-stack rect { fill: var(--pf); stroke: var(--pc); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.rf-stack path { fill: none; stroke: var(--pc); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.p-later { --pc: #8f9a95; --pf: #fff; }
.p-hand { --pc: #6a58c4; --pf: var(--accent-soft); }
.p-arch { --pc: #b3bbb7; --pf: #f4f6f5; }
.rf-pn { font-size: 29px; line-height: 1; margin-top: 7px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p-hand .rf-pn { color: var(--accent-ink); }
.p-hand .rf-stack { margin-right: 16px; }
.p-arch .rf-pn { color: #7a8681; }
.rf-pl { font-size: 14.5px; font-weight: 700; margin-top: 3px; }
.rf-ps { font-size: 13px; color: var(--muted); margin-top: 1px; line-height: 1.25; }
.rf-avs { position: absolute; top: 9px; right: 7px; display: flex; flex-direction: column; gap: 3px; }
.rf-avs i { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 750;
  background: var(--cs); color: var(--ci); border: 2px solid #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); letter-spacing: -.03em; }

.rf-prom { position: relative; display: flex; flex-direction: column; border: 1px solid var(--accent); border-radius: 14px; padding: 9px 12px 6px;
  background: linear-gradient(180deg, #fbf9ff, #fff 60%); }
.rf-prh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.rf-prh b { color: var(--accent-ink); }
.rf-prh small { font-size: 13px; color: var(--muted); }
.rf-pr { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 7px 0 7px; border-top: 1px dashed var(--line); }
.rf-pr:first-of-type { border-top: 0; padding-top: 5px; }
.rf-pr q, .rf-q q { quotes: "«" "»"; }
.rf-pr q { font-size: 15px; font-weight: 650; line-height: 1.3;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 60%, transparent) 58%); }
.rf-pw { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.rf-dl { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 650; line-height: 20px; white-space: nowrap; }
.rf-dl .rf-ic { width: 13px; height: 13px; }
.rf-pf { display: flex; align-items: center; gap: 6px; padding: 6px 0 2px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); min-height: 30px; }
.rf-pf .rf-ic { width: 14px; height: 14px; color: var(--accent-ink); }
.rf-stamp { position: absolute; right: 10px; bottom: -6px; --rot: -6deg; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 14px;
  border: 3px solid #15803d; border-radius: 10px; color: #15803d; background: rgba(255, 255, 255, .92); text-transform: uppercase;
  box-shadow: inset 0 0 0 2px rgba(21, 128, 61, .2); white-space: nowrap; }
.rf-stamp b { font-size: 15px; letter-spacing: .07em; font-weight: 850; }
.rf-stamp span { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.rf-stamp:not(.in) { transform: rotate(var(--rot)) scale(1.35); }

/* летящие конверты */
.rf-fly { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.rf-e { position: absolute; left: 0; top: 0; width: 30px; height: 20px; will-change: transform;
  transition: transform var(--fd, 650ms) cubic-bezier(.45, .05, .25, 1), opacity calc(var(--fd, 650ms) * .4) ease; }
.rf-fly.rain .rf-e { transition: transform var(--rd, 330ms) cubic-bezier(.3, 1.45, .5, 1), opacity var(--rd, 330ms) ease; }
.rf-e svg { display: block; width: 30px; height: 20px; filter: drop-shadow(0 2px 3px rgba(17, 24, 22, .16)); }
.rf-e rect { fill: #fff; stroke: #a7b1ac; stroke-width: 1.3; transition: fill .3s, stroke .3s; }
.rf-e path { fill: none; stroke: #a7b1ac; stroke-width: 1.3; stroke-linejoin: round; transition: stroke .3s; }
.rf-e.t rect { fill: var(--cs); stroke: var(--c); }
.rf-e.t path { stroke: var(--c); }

/* ---------- голосовое и обещания ---------- */
.rf-vh { display: flex; align-items: center; gap: 12px; }
.rf-mic { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.rf-mic .rf-ic { width: 20px; height: 20px; color: #fff; }
.rf-vh > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; }
.rf-vh b { font-size: 16px; }
.rf-wv { display: flex; align-items: center; gap: 3px; height: 26px; margin-left: 6px; }
.rf-wv i { width: 3px; border-radius: 2px; background: var(--brand); opacity: .5; }

.rf-qs { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 200px; min-height: 104px; }
.rf-q { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 5px 12px 5px 6px; border-radius: 10px; background: var(--page); font-size: 15px; line-height: 1.35; }
.rf-q q { font-style: italic; min-width: 0; }
.rf-q em { flex: none; font-style: normal; font-size: 13.5px; color: var(--ci); font-weight: 650; white-space: nowrap; }
.rf-q em::before { content: "→ "; color: var(--muted); font-weight: 500; }
.rf-qn { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-size: 13px; font-weight: 750;
  display: grid; place-items: center; }
.t-me .rf-qn, .rf-q.t-me .rf-qn { background: var(--brand-ink); }
.rf-q.t-me em { color: var(--brand-ink); }
.rf-qs .rf-stamp { right: 8px; top: 50%; bottom: auto; margin: -28px 0 0; }

.rf-week { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.rf-col { min-width: 0; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; }
.rf-col:first-child { border-left: 0; }
.rf-col.wk { border-left: 2px dashed #d3d9d6; }
.rf-ch { padding: 7px 9px 6px; border-bottom: 1px solid var(--line-2); background: #fafbfa; display: flex; flex-direction: column; line-height: 1.2; }
.rf-ch b { font-size: 13.5px; }
.rf-ch span { font-size: 13px; color: var(--muted); }
.rf-col.now .rf-ch { background: var(--brand-soft); box-shadow: inset 0 -2px 0 var(--brand); }
.rf-col.now .rf-ch b { color: var(--brand-ink); }
.rf-col.od .rf-ch { background: var(--bad-soft); }
.rf-col.od .rf-ch b { color: var(--bad-ink); }
.rf-cb { flex: 1; padding: 7px; display: flex; flex-direction: column; gap: 7px; min-height: 124px; }
.rf-tk { position: relative; border-radius: 10px; padding: 7px 8px 7px; background: var(--cs); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  border-left: 3px solid var(--c); }
.rf-tk1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rf-tk1 b { font-size: 13.5px; min-width: 0; line-height: 1.25; }
.rf-tk .rf-qn { width: 20px; height: 20px; }
.rf-tk2 { font-size: 14px; font-weight: 600; line-height: 1.3; margin-top: 5px; overflow-wrap: break-word; }
.rf-tk3 { margin-top: 5px; display: flex; align-items: flex-start; gap: 4px; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.rf-tk3 .rf-ic { width: 14px; height: 14px; margin-top: 1px; }
.rf-tk.ev { background: var(--brand); border-color: var(--brand); color: #fff; }
.rf-tk.ev .rf-qn { background: #fff; color: var(--brand); }
.rf-tk.ev .rf-tk3 { color: rgba(255, 255, 255, .86); }
.rf-tt { font-size: 15px; font-variant-numeric: tabular-nums; }
.rf-tkx { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 1px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good-ink);
  font-size: 13px; font-weight: 650; line-height: 20px; }
.rf-tkx .rf-ic { width: 13px; height: 13px; }

.rf-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--brand-line); background: #fff; }
.rf-ctl-h { margin-right: 4px; }
.rf-cn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.rf-cn .rf-ic { color: var(--brand); }
.rf-ar { position: relative; width: 22px; height: 2px; background: #c9d0cd; flex: none; }
.rf-ar::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: #c9d0cd; border-right: 0; }

/* ---------- переписка слева ---------- */
.rf-ib { min-width: 250px; }
.rf-ib-h { display: flex; align-items: center; gap: 10px; }
.rf-ib-h b { font-size: 34px; line-height: 1; color: var(--brand); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rf-ib-h span { font-size: 14px; line-height: 1.25; color: var(--ink-2); }
.rf-ib-r { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.rf-ib-r span { padding: 4px 9px; border-radius: 8px; background: var(--page); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.rf-ib-r b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 2px; }
.rf-mb b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.rf-mb b .rf-ic { width: 15px; height: 15px; color: var(--brand); }
.rf-mb span { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.w-msg.in .w-b.rf-sent { white-space: normal; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.rf-dc small { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.rf-dc small .rf-ic { width: 13px; height: 13px; color: var(--brand); }
.rf-dc p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.42; }

/* миниатюры сетки: всё в конечном виде, конвертов нет */
.w-th-in .rf-stamp { transform: rotate(var(--rot)); }

/* режим проверки (?qa=1): без переходов и анимаций, чтобы любой кадр был чётким */
.rf-qa .rf *, .rf-qa .rf *::before, .rf-qa .rf *::after, .rf-qa .rf-fly *, .rf-qa .w-msg, .rf-qa .w-note, .rf-qa .w-result,
.rf-qa .w-st, .rf-qa .w-st i, .rf-qa .w-pill, .rf-qa .w-card { transition: none !important; animation: none !important; }

/* ---------- результат уже 860 px (ноутбук 1280): карточки дней плотнее ---------- */
@container (max-width: 860px) {
  .rf-cb { padding: 5px; gap: 5px; }
  .rf-ch { padding: 6px 7px 5px; }
  .rf-ch b { font-size: 13px; }
  .rf-tk { padding: 6px 6px 6px; }
  .rf-tk1 { gap: 4px; }
  .rf-tk .rf-qn { width: 19px; height: 19px; }
  .rf-tk1 b { font-size: 13px; }
  .rf-tk2 { font-size: 13px; }
  /* печать плашки обещаний правее и ниже, мимо «напомню за 3 часа» */
  .rf-prom .rf-stamp { right: -4px; bottom: -12px; padding: 4px 11px; }
  .rf-prom .rf-stamp b { font-size: 14px; letter-spacing: .05em; }
  /* цитаты голосового и обещаний не уходят под печать справа */
  .rf-qs { padding-right: 216px; }
  .rf-qs .rf-stamp { right: -8px; }
  /* кружки «кому поручить» не заходят на стопку конвертов */
  .p-hand .rf-stack { margin-right: 24px; }
  .rf-avs { right: 4px; }
  .rf-avs i { width: 23px; height: 23px; }
}

/* ---------- узкий результат: телефон ---------- */
@container (max-width: 700px) {
  .rf-top { flex-direction: column; align-items: flex-start; }
  .rf-cats { margin-left: 0; }
  .rf-body { grid-template-columns: minmax(0, 1fr); }
  .rf-n { font-size: 32px; }
  .rf-qs { padding-right: 0; min-height: 0; }
  .rf-qs .rf-stamp { position: static; align-self: flex-end; margin: 4px 4px 0 0; }
  .rf-fh { flex-wrap: wrap; }
  .rf-fh b { white-space: nowrap; }
  .rf-prom .rf-stamp { position: static; align-self: flex-end; margin: 4px 2px 2px 0; }
  .rf-avs { display: none; }
  .p-hand .rf-stack { margin-right: 0; }
  .rf-q { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; row-gap: 2px; align-items: start; width: 100%; }
  .rf-q em { grid-column: 2; }
  .rf-wv { display: none; }
  .rf-week { grid-template-columns: minmax(0, 1fr); }
  .rf-col { flex-direction: row; border-left: 0; border-top: 1px solid var(--line-2); }
  .rf-col:first-child { border-top: 0; }
  .rf-col.wk { border-left: 0; border-top: 2px dashed #d3d9d6; }
  .rf-col:not(.has):not(.now):not(.od) { display: none; }
  .rf-ch { flex: none; width: 122px; border-bottom: 0; border-right: 1px solid var(--line-2); }
  .rf-col.now .rf-ch { box-shadow: inset -2px 0 0 var(--brand); }
  .rf-cb { min-height: 0; }
  .rf-ar { display: none; }
  .rf-ctl { flex-direction: column; align-items: flex-start; }
  .rf-cn { white-space: normal; }
}

/* подсветка цитаты и дня, куда встаёт её карточка */
.rf-hl { animation: rf-hl 1.3s var(--ease); }
@keyframes rf-hl { 0%, 35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 85%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.rf-col.rf-hl { animation-name: rf-hlc; }
@keyframes rf-hlc { 0%, 35% { background: var(--accent-soft); } 100% { background: transparent; } }

/* превью 1200×630: зелёная плашка целиком за краем кадра, не обрезанной полосой */
.w-og .rf { margin-bottom: 46px; }
/* в миниатюрах печать ниже, под значком карточки сетки */
.w-th-in .rf-qs .rf-stamp { top: auto; bottom: -4px; margin: 0; }
