/* 06-finance.css — part 06/10 of the ordered bp bundle (the former single bp.css,
   split by surface; the content is UNREORDERED). ORDER IS LOAD-BEARING: cascade ties
   resolve by document order, so hosts must link 01→10 in exactly this sequence —
   CssHygieneTests pins both the list and the order in both hosts. */

/* ── Финансы (/finance) — Редизайн раздела Финансы.dc.html (вариант 1a) ───────────────────────────
   One page, no tabs: «Приём оплаты на сайте» (two ordered setup steps) → «Что вы продаёте» →
   «Платежи», re-ordered money-first once everything is configured. rp-fin-toolbar/-panel survive as
   the page-header/panel shell (also used by /ai-credits). The payments-tab classes below
   (summary card, Месяц/Квартал/Год segment, status dropdown, the desktop table
   grid 100px 1.3fr 1.2fr 110px 130px 24px + its ≤640px card view) are unchanged apart from the
   widened status column, which keeps «Возврат 12 000 ₽» on one line.
   Amounts use tabular-nums. All colours via var(--…) tokens (dark mode flips for free). */
.rp-fin-toolbar { display: flex; align-items: center; margin-bottom: 4px; }
.rp-fin-panel { padding-top: 4px; }

/* the page itself: a single vertical stack of section cards */
.rp-fin-flow {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* «Приём оплаты работает» — page-header pill of the fully-configured state */
.rp-fin-okpill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--success-muted);
  color: var(--success-muted-foreground);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
/* «Это деньги ваших учеников…» — the tenant↔platform money lives elsewhere */
.rp-fin-remind { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted-foreground); }

/* ── Setup card «Приём оплаты на сайте» (states A/B) ──────────────────────────────────────────────
   Two steps in a strict order: requisites publish the site's legal documents, and no payment provider
   passes moderation without them — so step 2 renders locked until step 1 is done, and the whole card
   disappears once both are. Reuses .rp-card + .rp-card-header for the shell. */
.rp-fin-setup { overflow: hidden; }
.rp-fin-setup-headtext { flex: 1; min-width: 0; }
.rp-fin-setup-title { margin: 0; font-size: 15px; font-weight: 600; }
.rp-fin-setup-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted-foreground); }
.rp-fin-setup-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--warning-muted);
  color: var(--warning-muted-foreground);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.rp-fin-setup-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rp-fin-setup-pill-short { display: none; }

.rp-fin-setup-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}
/* state B: the step-2 instructions get the wider column, «не хочу подключать» the narrower one */
.rp-fin-setup-body--b { grid-template-columns: 1.15fr 1fr; gap: 24px; }

.rp-fin-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
}
.rp-fin-step--active { border: 1.5px solid var(--primary); box-shadow: var(--shadow-sm); }
.rp-fin-step--locked { background: var(--muted); }
/* state B's step 2 is plain column content, not a bordered card */
.rp-fin-step--bare { border: 0; border-radius: 0; padding: 0; background: transparent; gap: 12px; }

.rp-fin-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-fin-step-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.rp-fin-step-num--muted {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}
.rp-fin-step-title { font-size: 15px; font-weight: 700; }
.rp-fin-step-title--muted { color: var(--muted-foreground); }
.rp-fin-step-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 11.5px;
  font-weight: 600;
}
.rp-fin-step-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--foreground); }
.rp-fin-step-text--muted { color: var(--muted-foreground); }
.rp-fin-step-hint { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted-foreground); }
.rp-fin-step-grow { flex: 1; }
.rp-fin-step-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rp-fin-step-eta { font-size: 12.5px; color: var(--muted-foreground); }
.rp-fin-step-link { font-size: 13px; font-weight: 600; }
/* the locked step-2 CTA: present but inert, so the order stays legible */
.rp-fin-step-btn--off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted-foreground);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.7;
  cursor: not-allowed;
}

/* numbered «как подключить Robokassa» list — flex rows, not <ol> markers */
.rp-fin-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rp-fin-steps-li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; }
.rp-fin-steps-num {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--secondary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* «Реквизиты заполнены» confirmation strip under the setup header (state B) */
.rp-fin-done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--success-muted);
  color: var(--success-muted-foreground);
}
.rp-fin-done-ico {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rp-fin-done-txt { flex: 1; min-width: 0; }
.rp-fin-done-title { font-size: 13.5px; font-weight: 700; }
.rp-fin-done-links { font-size: 12.5px; }
.rp-fin-done-links a { color: inherit; text-decoration: underline; }
.rp-fin-done-edit {
  height: 32px;
  padding: 0 12px;
  /* the strip's own green, faded — inherits the tone instead of hardcoding a second one */
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rp-fin-done-edit:hover { background: color-mix(in srgb, currentColor 8%, transparent); }

/* «Не хочу подключать сервис» — the honest opt-out beside step 2 */
.rp-fin-skip {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rp-fin-skip-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.rp-fin-skip-ico { display: inline-flex; color: var(--muted-foreground); }
.rp-fin-skip-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted-foreground); }
.rp-fin-skip-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rp-fin-skip-btn:hover { background: var(--secondary); }

/* ── «Что вы продаёте» card ───────────────────────────────────────────────────────────────────────
   Empty (no packages) → two dashed invitation tiles; otherwise the packages table followed by either
   the course rows or a one-line «курсов пока нет» hint. Reuses .rp-card/.rp-card-header. */
.rp-fin-sell { overflow: hidden; }
.rp-fin-sell-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; }
.rp-fin-sell-tile {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.rp-fin-sell-tile-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rp-fin-sell-tile-title { font-size: 15px; font-weight: 600; }
.rp-fin-sell-tile-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted-foreground); }
.rp-fin-sell-tile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.rp-fin-sell-tile-link:hover { background: var(--secondary); color: var(--foreground); text-decoration: none; }
/* honest footer when nothing is published yet: a course is priced in its own editor, not here */
.rp-fin-sell-coursehint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--background);
}
.rp-fin-sell-coursehint-ico { display: inline-flex; color: var(--muted-foreground); }
.rp-fin-sell-coursehint-txt { flex: 1; font-size: 13px; color: var(--muted-foreground); }
.rp-fin-sell-coursehint-link { font-size: 12.5px; font-weight: 600; }

/* ── Thin «приём оплаты работает» status bar (state C) ────────────────────────────────────────────
   The only setup surface left once everything is configured — and the single way back into the
   gateway dialog (which also carries the on/off switch). */
.rp-fin-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.rp-fin-statusbar-ico { display: inline-flex; flex-shrink: 0; color: var(--muted-foreground); }
.rp-fin-statusbar-txt { flex: 1; min-width: 0; font-size: 13px; color: var(--muted-foreground); }
.rp-fin-statusbar-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}
.rp-fin-statusbar-link:hover { text-decoration: underline; }

/* ── Финансы modals — «Реквизиты и документы» + «Платёжный сервис» ────────────────────────────────
   The page keeps the instruction and the status; the forms live here. A 560px shell with full-bleed
   header/footer bands: `padding: 0` overrides BbDialogContent's own padding (bp.css is un-layered
   and later in document order than every utility source — blueprint-pitfalls.md П-20) and
   the bands re-add it. The fields themselves reuse rp-gw-field/-label/-input/-hint/-row2 verbatim —
   that chrome is already the 42px/12.5px-label geometry both dialogs specify. */
.rp-fin-dlg { max-width: 560px; padding: 0; }
.rp-fin-dlg-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.rp-fin-dlg-headtext { flex: 1; min-width: 0; }
.rp-fin-dlg-title { margin: 0; font-size: 17px; font-weight: 700; }
.rp-fin-dlg-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted-foreground); }
.rp-fin-dlg-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rp-fin-dlg-close:hover { background: var(--secondary); color: var(--foreground); }
.rp-fin-dlg-body { padding: 20px 22px; display: grid; gap: 14px; }
/* the gateway form is long (provider segment + credentials + two <details>) — scroll it, not the page */
.rp-fin-dlg-body--scroll { max-height: min(68vh, 620px); overflow-y: auto; }
.rp-fin-dlg-body--scroll .rp-gw-fields { margin-bottom: 0; }
.rp-fin-dlg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--background);
}
.rp-fin-dlg-foot-note { font-size: 12.5px; color: var(--muted-foreground); }

/* «Вы работаете как» — two tiles instead of a select: two options, both worth reading at a glance */
.rp-fin-legal-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-fin-legal-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.rp-fin-legal-tile-ico { display: inline-flex; flex-shrink: 0; color: var(--muted-foreground); }
.rp-fin-legal-tile--on {
  border: 1.5px solid var(--primary);
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
}
.rp-fin-legal-tile--on .rp-fin-legal-tile-ico { color: currentColor; }

@media (max-width: 640px) {
  .rp-fin-flow { gap: 16px; }
  .rp-fin-setup-pill-full { display: none; }
  .rp-fin-setup-pill-short { display: inline; }
  .rp-fin-setup-pill { padding: 4px 10px; font-size: 11.5px; font-weight: 700; }

  /* steps stack as full-bleed blocks separated by hairlines — no nested cards on a 390px screen */
  .rp-fin-setup-body,
  .rp-fin-setup-body--b { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .rp-fin-step {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 16px;
  }
  .rp-fin-step--active { border: 0; border-bottom: 1px solid var(--border); box-shadow: none; }
  .rp-fin-step--bare { padding: 16px; }
  .rp-fin-setup-body > :last-child { border-bottom: 0; }
  .rp-fin-step-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .rp-fin-step .rp-btn-submit,
  .rp-fin-step-btn--off { width: 100%; height: 46px; font-size: 15px; }
  .rp-fin-step-eta { text-align: center; }

  .rp-fin-skip { border: 0; border-radius: 0; padding: 16px; }
  .rp-fin-skip-btn { height: 44px; font-size: 14.5px; }

  .rp-fin-sell-body { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .rp-fin-sell-tile { padding: 16px; }
  .rp-fin-sell-tile .rp-fin-price-addbtn,
  .rp-fin-sell-tile-link { width: 100%; height: 44px; justify-content: center; font-size: 14.5px; }
  /* the section-header action drops below the title and takes the row — a 36px button in a header
     is under the 44px hit-target floor, and this audience taps it with a thumb */
  .rp-fin-sell .rp-card-header { flex-wrap: wrap; }
  .rp-fin-sell .rp-card-header-action { flex: 1 0 100%; }
  .rp-fin-sell .rp-card-header .rp-fin-price-addbtn {
    width: 100%;
    height: 44px;
    justify-content: center;
    font-size: 14.5px;
  }
  /* same floor for «Изменить» in the requisites-done strip */
  .rp-fin-done-edit { height: 44px; padding: 0 14px; }

  .rp-fin-statusbar { align-items: flex-start; flex-wrap: wrap; }
  /* «Настройки приёма» is a text link by design, but in the configured state it is the ONLY way back
     into the gateway settings (and its on/off switch) — so on touch it gets a real hit target. */
  .rp-fin-statusbar-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
  }

  .rp-fin-dlg-head { padding: 16px 16px 12px; }
  .rp-fin-dlg-body { padding: 16px; }
  .rp-fin-dlg-foot { padding: 14px 16px; }
  .rp-fin-dlg-foot .rp-btn-submit { width: 100%; height: 46px; }
  .rp-fin-legal-tile { height: 44px; }
}

/* summary row: card · spacer · period segment · status filter */
.rp-fin-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.rp-fin-spacer { flex: 1; }

.rp-fin-sumcard {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 20px;
}
.rp-fin-sumcard-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rp-fin-sumcard-row { display: flex; align-items: baseline; gap: 8px; }
.rp-fin-sumcard-amount {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rp-fin-sumcard-count { font-size: 12.5px; font-weight: 600; color: var(--success-muted-foreground); }
/* «Ожидает оплаты» card — same geometry, warning tone on the count */
.rp-fin-sumcard-count--warn { color: var(--warning-muted-foreground); }

.rp-fin-periods {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--muted);
  border-radius: var(--radius-md);
}
.rp-fin-period {
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-fin-period--active {
  font-weight: 600;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

.rp-fin-filterbox { position: relative; display: inline-flex; align-items: center; }
.rp-fin-filter-ico {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  color: var(--muted-foreground);
  pointer-events: none;
}
.rp-fin-filter {
  height: 34px;
  padding: 0 12px 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

/* payments table (desktop) */
.rp-fin-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-fin-thead,
.rp-fin-row {
  display: grid;
  /* The status column is sized to the WIDEST chip, not the common one: a refund chip carries an amount
     («Возврат 120 000 ₽» ≈ 151px measured), and .rp-chip is nowrap + flex-shrink:0, so an undersized
     column doesn't clip — the chip overflows into the chevron. 130px (the handoff's value) fits the
     text but leaves a five-figure refund touching the «›». */
  grid-template-columns: 100px 1.3fr 1.2fr 110px 156px 24px;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-fin-thead {
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.rp-fin-row { text-decoration: none; color: var(--foreground); }
.rp-fin-row:last-child { border-bottom: 0; }
a.rp-fin-row:hover { background: var(--secondary); }
.rp-fin-date { font-size: 13px; color: var(--muted-foreground); }
.rp-fin-payer { min-width: 0; }
.rp-fin-payer-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-fin-payer-sub { display: block; font-size: 12px; color: var(--muted-foreground); }
.rp-fin-item { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-fin-amount { font-size: 13.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rp-fin-chev { color: var(--muted-foreground); text-align: right; }

/* payments cards (mobile) */
.rp-fin-cards { display: none; flex-direction: column; gap: 9px; }
.rp-fin-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 13px 15px;
  text-decoration: none;
  color: var(--foreground);
}
.rp-fin-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.rp-fin-card-payer {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-fin-card-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-fin-card-mid { display: flex; align-items: center; gap: 8px; }
.rp-fin-card-item {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-fin-card-meta { font-size: 11.5px; color: var(--muted-foreground); margin-top: 3px; }

.rp-fin-none { padding: 24px 4px; font-size: 13px; color: var(--muted-foreground); }
.rp-fin-note { font-size: 12px; color: var(--muted-foreground); margin: 12px 2px 0; }

@media (max-width: 640px) {
  .rp-fin-table { display: none; }
  .rp-fin-cards { display: flex; }
  .rp-fin-sumcard { width: 100%; order: 2; }
  .rp-fin-summary { gap: 8px; }
}

/* «Что вы продаёте» price list (LOCKED-12/П-9 grid spec lived on the retired «Прайс» section
   banner; the live rules are rp-fin-price-table/-switch below plus this add button). */
.rp-fin-price-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rp-fin-price-addbtn:hover { opacity: 0.92; }

/* packages table (desktop) */
.rp-fin-price-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-fin-price-thead,
.rp-fin-price-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 100px 100px 110px 70px 40px;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-fin-price-thead {
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.rp-fin-price-row:last-child { border-bottom: 0; }
.rp-fin-price-name { font-size: 13.5px; font-weight: 600; }
.rp-fin-price-mix { font-size: 13px; color: var(--muted-foreground); }
.rp-fin-price-term { font-size: 13px; color: var(--muted-foreground); }

.rp-fin-price-vis {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--muted);
  color: var(--muted-foreground);
}
.rp-fin-price-vis--accent { background: var(--accent); color: var(--accent-foreground); }

/* hand-rolled 36×21 switch — see file-header note + П-9 */
/* .rp-fin-price-switch geometry is in the canonical toggle block (global controls section). */

.rp-fin-price-edit {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rp-fin-price-edit:hover { color: var(--foreground); }

/* courses-products table (desktop, no header row) */
.rp-fin-price-coursetable {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.rp-fin-price-courserow {
  display: grid;
  grid-template-columns: 1.6fr 1fr 100px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.rp-fin-price-courserow:last-child { border-bottom: 0; }
.rp-fin-price-courselink { font-size: 12.5px; font-weight: 600; color: var(--primary); text-decoration: none; text-align: right; }
.rp-fin-price-courselink:hover { text-decoration: underline; }
.rp-fin-price-coursenote { font-size: 12.5px; color: var(--muted-foreground); }

/* Inside the «Что вы продаёте» card the tables ARE the card body: drop their own border/radius, match
   the card's 20px gutters, and separate the (tinted) course rows from the packages with a top hairline
   — the packages table's own :last-child rule has already removed its closing one. */
.rp-fin-sell .rp-fin-price-table,
.rp-fin-sell .rp-fin-price-coursetable { border: 0; border-radius: 0; }
.rp-fin-sell .rp-fin-price-thead,
.rp-fin-sell .rp-fin-price-row,
.rp-fin-sell .rp-fin-price-courserow { padding-left: 20px; padding-right: 20px; }
.rp-fin-sell .rp-fin-price-coursetable { border-top: 1px solid var(--border); }
.rp-fin-sell .rp-fin-price-courserow {
  grid-template-columns: 1.6fr 1fr 100px 210px 110px;
  background: var(--background);
}
.rp-fin-sell .rp-fin-sell-coursehint { border-top: 1px solid var(--border); }
.rp-fin-sell .rp-fin-price-cards { padding: 16px; }

/* mobile cards (≤640px) — shared by packages AND courses-products; no toggle/pencil (LOCKED-12) */
.rp-fin-price-cards { display: none; flex-direction: column; gap: 9px; }
.rp-fin-price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 13px 15px;
}
.rp-fin-price-card-top { display: flex; align-items: center; gap: 8px; }
.rp-fin-price-card-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-fin-price-card-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-fin-price-card-meta { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.rp-fin-price-card-mid { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.rp-fin-price-card-mid .rp-fin-price-card-meta { flex: 1; margin-top: 0; }

@media (max-width: 640px) {
  .rp-fin-price-table,
  .rp-fin-price-coursetable { display: none; }
  .rp-fin-price-cards { display: flex; }
}

/* PackageDialog (Финансы → Прайс «Новый пакет»/«Пакет «{имя}»») audience multi-select — reuses
   rp-covw-dlg* chrome (head/close/fields/err/submit) verbatim; only the checkbox-style roster picker
   below is new (rp-fin-pkg-*). */
.rp-fin-pkg-audlist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.rp-fin-pkg-audrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.rp-fin-pkg-audrow:hover { background: var(--secondary); }
.rp-fin-pkg-audrow--picked { background: var(--accent); color: var(--accent-foreground); }
.rp-fin-pkg-audcheck {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rp-fin-pkg-audrow--picked .rp-fin-pkg-audcheck { border-color: var(--accent-foreground); }
.rp-fin-pkg-audname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Финансы «Приём оплат» tab — wave 5 Task 4, Финансы.dc.html §Приём оплат ──────────────────────
   GatewayPanel's connect form (ported from the retired /finance/gateway page): a max-width 560px column
   with the intro copy, the green «Подключено» banner (rp-gw-banner, --off when reception is disabled),
   the Robokassa/ЮКасса segment toggle (rp-gw-seg) + 54-ФЗ recommendation caption, the provider fields
   (rp-gw-fields / -row2 two-up rows / -field / -label / -input / -hint), the «Партнёрский API возвратов»
   details disclosure (rp-gw-details) and the submit row (rp-gw-actions). ≤640px: single column, inputs
   42-44px, buttons full-width (mockup mobile). All colours via var(--…) tokens. */
.rp-gw { max-width: 560px; }

.rp-gw-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  background: var(--success-muted);
  color: var(--success-muted-foreground);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.rp-gw-banner-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--success);
  color: var(--success-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rp-gw-banner--off { border-color: var(--border); background: var(--muted); color: var(--muted-foreground); }
.rp-gw-banner--off .rp-gw-banner-ico { background: var(--muted-foreground); color: var(--card); }
.rp-gw-banner-txt { flex: 1; min-width: 0; }
.rp-gw-banner-title { font-size: 13.5px; font-weight: 700; }
.rp-gw-banner-sub { font-size: 12.5px; }
.rp-gw-banner-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--success) 45%, var(--border));
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.rp-gw-banner-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.rp-gw-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--muted);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}
.rp-gw-seg-tab {
  padding: 7px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.rp-gw-seg-tab--active { font-weight: 600; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); }

.rp-gw-reco { font-size: 12px; color: var(--success-muted-foreground); font-weight: 600; margin-bottom: 16px; }

.rp-gw-fields { display: grid; gap: 14px; margin-bottom: 18px; }
.rp-gw-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rp-gw-field { display: block; }
.rp-gw-field--half { max-width: 262px; }
.rp-gw-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.rp-gw-input {
  height: 42px;
  font: inherit;
  font-size: 13.5px;
}
select.rp-gw-input { padding: 0 10px; cursor: pointer; }
.rp-gw-hint { display: block; font-size: 11.5px; color: var(--muted-foreground); margin-top: 4px; }
.rp-gw-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.rp-gw-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.rp-gw-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
}
.rp-gw-details > summary { cursor: pointer; font-weight: 600; color: var(--muted-foreground); }
.rp-gw-details-body { display: grid; gap: 14px; padding-top: 12px; }

.rp-gw-actions { display: flex; gap: 10px; }

@media (max-width: 640px) {
  .rp-gw { max-width: none; }
  .rp-gw-banner { flex-wrap: wrap; }
  .rp-gw-banner-btn { width: 100%; height: 44px; }
  .rp-gw-row2 { grid-template-columns: 1fr; }
  .rp-gw-field--half { max-width: none; }
  .rp-gw-input { height: 44px; font-size: 14px; }
  .rp-gw-actions { flex-direction: column; }
  .rp-gw-actions .rp-btn-submit { width: 100%; height: 44px; }
}

/* ── Финансы «Подписка» tab — wave 5 Task 4, Финансы.dc.html §Подписка ────────────────────────────
   SubscriptionPanel (ported from the retired /finance/subscription page): the status pill (rp-sub-pill,
   tone --ok/--warn/--danger from the shared subscription vocabulary, П-6) + «Оплачено до …» line
   (rp-sub-status/-paid), the 3-plan grid (rp-sub-plans, max-width 880px) with per-plan cards
   (rp-sub-plan, --current gets the primary border + «Текущий» badge), the ✓/✗ feature list from the real
   PlatformPlanLimits (rp-sub-feats/-feat(--off)/-feat-ico), the CTA (rp-sub-plan-cta --primary «Продлить»
   / --outline «Перейти на план» / --free disabled) and the promo field (rp-sub-promo, reuses rp-gw-field).
   ≤640px: single column, feature list hidden, status boxed, CTAs full-width (mockup mobile). */
.rp-sub-result { margin-bottom: 20px; }
.rp-sub-status { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
/* honest one-liner under a degraded status pill (UX-audit wave 4) */
.rp-sub-status-note {
  margin: -12px 0 20px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.rp-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.rp-sub-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rp-sub-pill--ok { background: var(--success-muted); color: var(--success-muted-foreground); }
.rp-sub-pill--warn { background: var(--warning-muted); color: var(--warning-muted-foreground); }
.rp-sub-pill--danger { background: var(--destructive-muted); color: var(--destructive-muted-foreground); }
.rp-sub-paid { font-size: 13px; color: var(--muted-foreground); }

.rp-sub-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 880px; }
.rp-sub-plan {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.rp-sub-plan--current { border-color: var(--primary); }
.rp-sub-plan-head { display: flex; align-items: center; gap: 8px; }
.rp-sub-plan-name { font-size: 15.5px; font-weight: 700; }
.rp-sub-plan-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 10.5px;
  font-weight: 700;
}
.rp-sub-plan-price { margin: 8px 0 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.rp-sub-plan-per { font-size: 12.5px; color: var(--muted-foreground); font-weight: 500; }

/* Billing-cycle toggle on the subscription panel (monthly / annual). */
.rp-sub-cycle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    margin-bottom: 16px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.rp-sub-cycle-opt {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted-foreground);
    font: inherit;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.rp-sub-cycle-opt--on {
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-xs);
}
.rp-sub-cycle-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}
.rp-sub-plan-benefit {
    margin-top: 4px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.rp-sub-feats { display: flex; flex-direction: column; }
.rp-sub-feat { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; color: var(--foreground); }
.rp-sub-feat--off { color: var(--muted-foreground); }
.rp-sub-feat-ico { width: 14px; height: 14px; display: inline-flex; flex-shrink: 0; }

.rp-sub-plan-grow { flex: 1; }
.rp-sub-plan-cta {
  margin-top: 14px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rp-sub-plan-cta--primary { background: var(--primary); color: var(--primary-foreground); }
.rp-sub-plan-cta--outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.rp-sub-plan-cta--free { background: transparent; color: var(--muted-foreground); border: 1px solid var(--border); cursor: not-allowed; }
.rp-sub-plan-cta:disabled { opacity: 0.7; cursor: not-allowed; }

.rp-sub-promo { margin-top: 18px; max-width: 340px; }

@media (max-width: 640px) {
  .rp-sub-plans { grid-template-columns: 1fr; }
  .rp-sub-feats { display: none; }
  .rp-sub-status {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
  }
  .rp-sub-plan-cta { width: 100%; height: 38px; }
  .rp-sub-promo { max-width: none; }
}

/* ── Финансы «ИИ-кредиты» tab — wave 5 Task 5, Финансы.dc.html §ИИ-кредиты ─────────────────────────
   AiCreditsPanel (ported from the retired /finance/ai-credits page): the balance+promo-redeem two-card
   row (rp-ai-top/-card/-card-label, rp-ai-avail/-avail-num/-avail-meta/-avail-note, rp-ai-promo-title/
   -promo-row/-promo-btn — the redeem input reuses rp-gw-input), the discount-code field for a pack
   purchase (rp-ai-discount, a distinct mechanism from the redeem box above — a percent code applied at
   checkout, carried over from the retired page's _discountCode — reuses rp-gw-field/-label), the pack
   grid (rp-ai-packs/-pack/-pack-name/-pack-credits/-pack-bottom/-pack-price/-pack-buy) + its ≤640px row
   list (rp-ai-packs-m/-pack-row/-pack-row-info/-pack-row-name/-pack-row-credits/-pack-row-price/
   -pack-row-buy), and the history (rp-ai-history*; the old
   rp-ai-history-section hide-at-≤640px wrapper is retired — the history tab renders on mobile too; rp-ai-history/-history-row/
   -history-date/-history-kind/-history-delta(--plus) — grid 130px 1fr 80px, no header row). */
.rp-ai-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 880px; margin-bottom: 24px; }
.rp-ai-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 20px; }
.rp-ai-card-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.rp-ai-avail { display: flex; align-items: baseline; gap: 8px; }
.rp-ai-avail-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.rp-ai-avail-meta { font-size: 13px; color: var(--muted-foreground); }
.rp-ai-avail-note { font-size: 12.5px; color: var(--muted-foreground); margin-top: 6px; }

.rp-ai-promo-title { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.rp-ai-promo-sub { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 8px; }
.rp-ai-promo-row { display: flex; gap: 8px; }
.rp-ai-promo-btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rp-ai-promo-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.rp-ai-discount { margin: 12px 0 16px; max-width: 340px; }

.rp-ai-section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }

.rp-ai-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; margin-bottom: 24px; }
.rp-ai-pack { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 18px; }
.rp-ai-pack-name { font-size: 14px; font-weight: 700; }
/* The gap before price+«Купить» lives on -bottom's own margin-top, not on -credits' margin-bottom,
   because -credits is conditionally rendered (Task 10: hidden when the pack's name already states its
   credit count) — sourcing the gap from the row that's ALWAYS present keeps the card's vertical rhythm
   identical whether the subtitle renders or not, instead of relying on sibling margin-collapse. */
.rp-ai-pack-credits { font-size: 13px; color: var(--muted-foreground); margin: 2px 0 0; }
.rp-ai-pack-bottom { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rp-ai-pack-price { font-size: 17px; font-weight: 700; }
.rp-ai-pack-buy {
  margin-left: auto;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.rp-ai-pack-buy:disabled { opacity: 0.7; cursor: not-allowed; }

.rp-ai-packs-m { display: none; flex-direction: column; gap: 9px; margin-bottom: 24px; }
.rp-ai-pack-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 13px 15px;
}
.rp-ai-pack-row-info { flex: 1; min-width: 0; }
.rp-ai-pack-row-name { font-size: 13.5px; font-weight: 600; }
.rp-ai-pack-row-credits { font-size: 12px; color: var(--muted-foreground); }
.rp-ai-pack-row-price { font-size: 14px; font-weight: 700; }
.rp-ai-pack-row-buy {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.rp-ai-pack-row-buy:disabled { opacity: 0.7; cursor: not-allowed; }

.rp-ai-history { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; max-width: 680px; }
.rp-ai-history-row { display: grid; grid-template-columns: 130px 1fr 80px; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.rp-ai-history-row:last-child { border-bottom: 0; }
.rp-ai-history-date { font-size: 12.5px; color: var(--muted-foreground); }
.rp-ai-history-kind { font-size: 13px; }
.rp-ai-history-delta { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--foreground); }
.rp-ai-history-delta--plus { color: var(--success-muted-foreground); }
.rp-ai-history-empty { padding: 24px 4px; font-size: 13px; color: var(--muted-foreground); }

@media (max-width: 640px) {
  .rp-ai-top { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
  .rp-ai-card { padding: 16px; }
  .rp-ai-card-label { font-size: 11px; }
  .rp-ai-avail-num { font-size: 26px; }
  .rp-ai-avail-note { font-size: 12px; }
  .rp-ai-promo-title { font-size: 12.5px; }
  .rp-ai-discount { max-width: none; }
  .rp-ai-section-title { font-size: 13.5px; }
  .rp-ai-packs { display: none; }
  .rp-ai-packs-m { display: flex; }
}

/* ── Task 6 (wave 5): /payments/{id} + /receipts/{id} (Платёж и чек.dc.html) ────────────────────────
   Two entity pages sharing one column wrapper. All colours/radii/shadows via tokens. Requisites stay
   two-column on mobile (brief); cards go full-width (the wrapper is already single-column in the shell). */
.rp-pmt { max-width: 640px; margin: 0 auto; }

/* Payment card */
.rp-pmt-card {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); box-shadow: var(--shadow-lg); padding: 28px; overflow: hidden;
}
.rp-pmt-crumb {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); text-decoration: none;
}
.rp-pmt-crumb:hover { color: var(--foreground); }
.rp-pmt-head { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 22px; }
.rp-pmt-head-main { flex: 1; min-width: 0; }
.rp-pmt-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 2px; }
.rp-pmt-ulid { font-size: 13px; color: var(--muted-foreground); font-family: var(--font-mono); }

/* Requisites table */
.rp-pmt-rows { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; }
.rp-pmt-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.rp-pmt-row--last { border-bottom: 0; }
.rp-pmt-rows .rp-pmt-row:last-child { border-bottom: 0; }
.rp-pmt-k { color: var(--muted-foreground); }
.rp-pmt-v { font-weight: 500; }
.rp-pmt-v--strong { font-weight: 600; }

/* Refund action */
.rp-pmt-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.rp-pmt-refund-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1.5px solid var(--destructive); border-radius: var(--radius-md);
  background: transparent; color: var(--destructive);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rp-pmt-refund-btn:hover { background: var(--destructive-muted, var(--muted)); }

/* Refunds table */
.rp-pmt-refunds-title { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.rp-pmt-rf-table { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.rp-pmt-rf-thead, .rp-pmt-rf-row {
  display: grid; grid-template-columns: 90px 90px 1fr 120px; gap: 10px; align-items: center;
}
.rp-pmt-rf-thead {
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rp-pmt-rf-row { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rp-pmt-rf-row:last-child { border-bottom: 0; }
.rp-pmt-rf-amount { font-weight: 600; }
.rp-pmt-rf-date { color: var(--muted-foreground); }

/* Refund dialog (reuses rp-covw-dlg head/close chrome + rp-sched-dlg-label/-input) */
.rp-pmt-rf-dlg { max-width: 400px; }
.rp-pmt-rf-desc { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.55; margin: 0 0 16px; }
.rp-pmt-rf-fields { display: grid; gap: 12px; }
.rp-pmt-rf-hint { font-size: 12px; color: var(--muted-foreground); margin: 8px 0 0; }
.rp-pmt-rf-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.rp-pmt-rf-cancel {
  height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: transparent; color: var(--foreground); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rp-pmt-rf-cancel:hover { background: var(--secondary); }
.rp-pmt-rf-submit {
  height: 36px; padding: 0 16px; border: 0; border-radius: var(--radius-md);
  background: var(--destructive); color: var(--destructive-foreground);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rp-pmt-rf-submit:disabled { opacity: 0.6; cursor: default; }

/* Receipt card */
.rp-pmt-rcpt-card {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); box-shadow: var(--shadow-lg); padding: 28px;
}
.rp-pmt-rcpt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.rp-pmt-rcpt-badge {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-foreground);
  display: inline-flex; align-items: center; justify-content: center;
}
.rp-pmt-rcpt-title { font-size: 19px; font-weight: 700; margin: 0; }
.rp-pmt-rcpt-sub { font-size: 12.5px; color: var(--muted-foreground); }
.rp-pmt-rcpt-table {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 6px 16px; margin-bottom: 18px;
}
.rp-pmt-rcpt-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px;
}
.rp-pmt-rcpt-k { color: var(--muted-foreground); }
.rp-pmt-rcpt-leader { flex: 1; border-bottom: 1px dotted var(--border); transform: translateY(-4px); }
.rp-pmt-rcpt-v { font-weight: 500; text-align: right; }
.rp-pmt-rcpt-v--strong { font-weight: 600; }
.rp-pmt-rcpt-total { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; font-size: 15px; }
.rp-pmt-rcpt-total-k { font-weight: 700; }
.rp-pmt-rcpt-spacer { flex: 1; }
.rp-pmt-rcpt-total-v { font-weight: 700; font-size: 18px; }
.rp-pmt-rcpt-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px; padding: 0 18px;
  border: 1.5px solid var(--primary); border-radius: var(--radius-md);
  background: transparent; color: var(--primary);
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rp-pmt-rcpt-pdf:hover { background: var(--accent); }
.rp-pmt-rcpt-note { font-size: 12px; color: var(--muted-foreground); line-height: 1.55; margin: 14px 0 0; }

/* ── /book resume page (SP3 Task 7) — reuses the rp-pmt/rp-pmt-rcpt-* receipt-card look above; only
   the CTA row below the price table (a single action link/button, or two for the anonymous case) is
   page-specific. */
.rp-book-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

@media (max-width: 600px) {
  .rp-pmt-card, .rp-pmt-rcpt-card { padding: 20px; }
  .rp-pmt-title { font-size: 20px; }
  /* Requisites stay two-column (brief) — just tighten the label column on narrow screens. */
  .rp-pmt-row { grid-template-columns: 116px 1fr; }
}

/* ── RequestSlotCard (SP2 Task 4) — slot summary + optional comment + submit, shared by the /request
   resumer (inline, above) and the /my-lessons RequestSlotDialog (Task 5). Lives inside the same
   rp-pmt-rcpt-card the CTA row below sits in on /book, so it only needs its own internal spacing. */
.rp-reqcard { display: flex; flex-direction: column; gap: 12px; }
.rp-reqcard-title { font-size: 15.5px; font-weight: 600; }
.rp-reqcard-sub { font-size: 13px; color: var(--muted-foreground); }
.rp-reqcard-comment {
  width: 100%; min-height: 72px; resize: vertical;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--background); color: var(--foreground);
  font: inherit; font-size: 13.5px; line-height: 1.5;
}
.rp-reqcard-comment:focus { outline: none; border-color: var(--primary); }
.rp-reqcard-comment::placeholder { color: var(--muted-foreground); }

