/* Редизайн кабінету «Термінал» (IFMT-6925, інкремент 2): «Головна», «Виплати», фільтр «Точка».
   Джерело — еталон prototype v7.10, assets/app.css (money, payout, ledger, delta, chart, attention, noops, op-list,
   firstrun, steps, progress, payout-summary, payouts-table). Фільтр «Точка» (ptf) — у shell.css. Класи ті самі, що в еталоні;
   область дії — .rd, rem — еталон × 1,6 (корінь кабінету 10px), як у components.css. */

/* ——— Заголовок сторінки: місце для фільтра «Точка» ——— */
.rd .page-head p.greet { margin-top: 0; font-size: var(--t-3xl); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.rd .page-tools { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
@media (max-width: 640px) {
  .rd .page-tools { width: 100%; }
}

/* ——— Верхній ряд головної: «Валовий дохід» і «Очікуйте зарахування» на subgrid ——— */
.rd .section { margin-top: var(--s-7); }
.rd .money { display: grid; grid-template-columns: var(--home-cols); grid-template-rows: repeat(5, auto) 1fr; column-gap: var(--s-5); }
.rd .money > .money-today, .rd .money > .payout { grid-row: span 6; display: grid; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.rd .money-failed { margin-top: var(--s-5); }
.rd .money-today, .rd .payout, .rd .ps-main { container-type: inline-size; }
.rd .money-today { padding: var(--s-6); background: var(--canvas); border-radius: var(--r-l); }
.rd .money-label { font-size: var(--t-l); font-weight: 400; color: var(--ink-2); }
.rd .money-value { font-size: min(clamp(3.2rem, 4vw, var(--t-money)), 10cqi); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 1rem 0 1.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd .money-value .cur { font-size: .5em; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-left: .6rem; }
.rd .money-meta { display: flex; gap: .6rem 2rem; flex-wrap: wrap; color: var(--ink-2); font-size: var(--t-l); line-height: 1.5; }
.rd .money-meta strong { font-weight: 700; }
/* v7.9 п. 7: підпис під сумою — один шрифт і один колір; рядки — окремими блоками, без «·»-ланцюжків */
.rd .money-sub { margin-top: .6rem; font-size: var(--t-s); line-height: 1.5; color: var(--ink-3); }
.rd .money-line { display: block; }
.rd .money-line + .money-line { margin-top: .2rem; }
.rd .money-compare { margin-top: 1.4rem; }

.rd .payout { padding: var(--s-6); border-radius: var(--r-l); background: var(--brand-deep); color: var(--deep-text); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.rd .payout .money-label, .rd .payout .money-sub { color: var(--deep-muted); }
.rd .payout .money-value { color: var(--deep-text); }
.rd .payout .money-value .cur { color: var(--deep-muted); }
.rd .payout-when { display: flex; align-items: center; gap: 1rem; font-size: var(--t-l); font-weight: 500; line-height: 1.5; }
.rd .payout-when .pulse { width: 1rem; height: 1rem; border-radius: 50%; background: var(--deep-accent); }
.rd .payout-acc { color: var(--deep-muted); font-size: var(--t-s); margin-top: .4rem; }
.rd .payout-toggle { margin-top: auto; padding-top: var(--s-5); }
.rd .money .payout-toggle { margin-top: 0; }
.rd .payout-toggle button { --bg: rgba(255,255,255,.1); --fg: #fff; --bd: rgba(255,255,255,.22); }
.rd .payout-toggle button:hover { --bg: rgba(255,255,255,.18); }
.rd .payout :focus-visible { box-shadow: 0 0 0 3px var(--brand-deep), 0 0 0 5px var(--deep-accent); }
.rd .payout a { color: #CFE8BE; }
.rd .ledger { overflow: hidden; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.rd .ledger.open { grid-template-rows: 1fr; }
.rd .ledger > div { min-height: 0; }
.rd .ledger dl { margin: var(--s-4) 0 0; display: grid; grid-template-columns: 1fr auto; gap: .8rem 1.6rem; font-size: var(--t-m); }
.rd .ledger dt { color: var(--deep-muted); }
.rd .ledger dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rd .ledger .total { border-top: 1px solid rgba(255,255,255,.22); padding-top: .8rem; font-weight: 700; color: var(--deep-text); }
.rd .ledger-note, .rd .ledger-more { margin-top: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .rd .ledger { transition: none; } }

/* ——— «Потребує уваги» і «Точки без оплат» ——— */
.rd .attention { display: grid; grid-template-columns: var(--home-cols); gap: var(--s-5); margin-top: var(--s-5); }
.rd .attn-sec { margin-top: var(--s-6); }
.rd .attn-sec .section-head { margin-bottom: 0; }
.rd .attn-sec h2, .rd .noops h2 { font-size: var(--t-l); }
.rd .attn-more { margin-top: var(--s-3); font-size: var(--t-s); }
.rd .noops-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rd .noops-list li { display: flex; align-items: center; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.rd .noops-list a { color: var(--ink); font-weight: 500; }
.rd .noops-why { display: flex; align-items: center; gap: .6rem; font-size: var(--t-s); font-weight: 500; color: var(--ink-2); margin-top: .2rem; }
.rd .ph-steps { padding-left: 2rem; margin: 0 0 1rem; color: var(--ink-2); }
.rd .ph-steps li + li { margin-top: .4rem; }

/* ——— Графік ——— */
.rd .chart { padding: var(--s-5) 0 0; border-top: 1px solid var(--line); }
.rd .chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.rd .chart-body { position: relative; }
.rd .chart-body[role="group"] { border-radius: var(--r-s); }
.rd .chart-body[role="group"]:focus-visible { box-shadow: var(--focus); }
.rd .chart-svg { display: block; width: 100%; height: 180px; overflow: visible; }
.rd .chart-svg > :not(.bar-hit) { pointer-events: none; }
.rd .chart-svg .bar { fill: var(--bar); stroke: var(--action); stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill .15s; }
.rd .chart-svg .bar.today { fill: var(--brand); }
.rd .chart-svg .bar.is-on { fill: var(--action); }
.rd .chart-svg .bar-hit { fill: transparent; cursor: default; }
.rd .chart-svg .bar-hit:hover + .bar { fill: var(--action); }
.rd .chart-svg .axis { font-size: 1.2rem; fill: var(--ink-3); font-family: var(--font); }
.rd .chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.rd .chart-tip { position: absolute; pointer-events: none; background: var(--tip-bg); color: var(--tip-fg); padding: .8rem 1rem; border-radius: var(--r-s); font-size: var(--t-s); white-space: normal; width: max-content; max-width: 100%; transform: translate(-50%, -100%); box-shadow: var(--shadow-1); }
.rd .chart-tip.tip-left { transform: translate(calc(-100% + 16px), -100%); }
.rd .chart-tip.tip-right { transform: translate(-16px, -100%); }

/* ——— Останні оплати ——— */
.rd .op-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rd .op-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.4rem; align-items: center; padding: 1.2rem .4rem; border-bottom: 1px solid var(--line); }
.rd .op-list li:last-child { border-bottom: 0; }
.rd .op-ico { width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--canvas); color: var(--ink-2); }
.rd .op-ico.ok { background: var(--brand-soft); color: var(--action); }
.rd .op-ico.bad { background: var(--danger-soft); color: var(--danger); }
.rd .op-main { min-width: 0; }
.rd .op-main strong { font-weight: 500; }
.rd .op-main .op-open { color: var(--ink); text-decoration: none; font-weight: 500; }
.rd .op-main .op-open:hover { color: var(--action); text-decoration: underline; }
.rd .op-main .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ——— Перший запуск ——— */
.rd .firstrun { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-5); }
.rd .firstrun-single { grid-template-columns: minmax(0, 1fr); max-width: 82rem; }
.rd .fr-lead { margin-top: .6rem; }
.rd .fr-photo { margin-top: 1.6rem; }
.rd .fr-points { list-style: none; margin: .8rem 0 0; padding: 0; }
.rd .fr-points li { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.rd .fr-points strong { font-weight: 500; }
.rd .fr-points p { margin: .2rem 0 .8rem; }
.rd .fr-points .badge + p { margin-top: .6rem; }
.rd .steps { list-style: none; margin: .8rem 0 0; padding: 0; }
.rd .steps li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 1.6rem; align-items: center; padding: 1.8rem 0; border-bottom: 1px solid var(--line); }
.rd .steps li:last-child { border-bottom: 0; }
.rd .step-mark { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line-strong); color: var(--ink-3); font-size: var(--t-s); }
.rd .steps li.done .step-mark { background: var(--brand); border-color: var(--brand); color: #fff; }
.rd .steps li.current .step-mark { border-color: var(--action); color: var(--action); }
.rd .steps li.done .step-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.rd .step-title { font-weight: 500; }
.rd .progress { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; margin: var(--s-3) 0 var(--s-2); }
.rd .progress > span { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 3px; transform-origin: left; transition: transform .6s var(--ease); }
.rd #fr-h:focus { outline: none; }

/* ——— «Виплати» ——— */
.rd .payout-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4) var(--s-7); align-items: flex-end; margin-bottom: var(--s-5); }
.rd .ps-main { flex: 1 1 32rem; min-width: 0; }
.rd .ps-side { flex: 0 1 auto; min-width: 0; text-align: right; }
.rd .ps-label { font-size: var(--t-l); font-weight: 400; color: var(--ink-2); }
.rd .ps-value { font-size: var(--t-money); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 1rem 0 .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd .ps-main .ps-value { font-size: min(clamp(3.2rem, 4vw, var(--t-money)), 10cqi); }
.rd .ps-value .cur { font-size: .5em; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-left: .6rem; }
.rd .ps-sub { font-size: var(--t-s); color: var(--ink-3); }
.rd .ps-side .ps-label { font-size: var(--t-s); color: var(--ink-3); }
.rd .ps-side .ps-value { font-size: var(--t-2xl); letter-spacing: -.02em; margin: .4rem 0; }
.rd .po-h { font-size: var(--t-xl); margin: var(--s-5) 0 var(--s-3); }
.rd .po-h:first-of-type { margin-top: 0; }
.rd .po-inst-text { margin-bottom: .8rem; }
.rd .po-day { color: var(--ink); text-decoration: none; font-weight: 500; }
.rd .po-day:hover { color: var(--action); text-decoration: underline; text-underline-offset: 3px; }
.rd .po-foot { margin-top: var(--s-3); }
.rd .payouts-table .col-payout { font-weight: 700; color: var(--ink); }
.rd .payouts-table th.col-payout { color: var(--ok-text); }
.rd .payouts-table th { white-space: normal; }
.rd .live-tag { display: flex; align-items: center; gap: .4rem; font-size: var(--t-xs); color: var(--ink-2); font-weight: 500; margin-top: .2rem; }
.rd .live-tag .icon { color: var(--info); }
.rd td.num .cell-sub, .rd td.num .live-tag { white-space: normal; }

/* ——— Адаптив ——— */
@media (max-width: 1100px) {
  .rd .money, .rd .firstrun, .rd .attention { grid-template-columns: minmax(0, 1fr); }
  .rd .attention { gap: var(--s-3); }
  .rd .money { grid-template-rows: none; row-gap: var(--s-5); }
  .rd .money > .money-today, .rd .money > .payout { grid-row: auto; display: flex; flex-direction: column; }
}
@media (max-width: 640px) {
  .rd .money-today, .rd .payout { padding: var(--s-5); }
  .rd .op-list li { padding: 1.2rem 1.4rem; }
  .rd .ps-side { text-align: left; }
  .rd .ps-value { white-space: normal; }
  .rd table.responsive.payouts-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s-3); row-gap: .6rem; padding: 1.2rem 0; }
  .rd table.responsive.payouts-table tbody td { width: auto; min-width: 0; }
  .rd table.responsive.payouts-table tbody td:first-child, .rd table.responsive.payouts-table td:last-child { grid-column: 1 / -1; }
  .rd table.responsive.payouts-table td.col-payout { grid-column: 1 / 2; font-size: var(--t-l); }
  .rd table.responsive.payouts-table .badge { white-space: normal; }
  /* Кроки першого запуску: кнопка («Встановити застосунок») — під текстом кроку, а не третьою колонкою, що виходила за 320 px */
  .rd .firstrun .steps li { grid-template-columns: 3.6rem minmax(0, 1fr); row-gap: 1rem; }
  .rd .firstrun .steps li > :nth-child(3) { grid-column: 2; justify-self: start; }
}
