/* „Wymaga uwagi” na pulpicie właściciela (assets/js/owner-attention.js). Kolory z motywu strony (--txt, --muted, --brd,
   --ok, --danger), więc tryb „skin” (assets/rfp/skin.css) przebarwia sekcję sam. Bursztyn nie jest w motywie – stała. */
.rfa {
  --rfa-high: var(--danger, #ff5c7a);
  --rfa-medium: #ffb65c;
  --rfa-low: var(--muted, #a0a6b9);
  --rfa-ok: var(--ok, #3bd19b);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rfa-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: -6px;
}

.rfa-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rfa-count {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--brd);
  color: var(--txt);
  white-space: nowrap;
}
.rfa-count::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: currentColor;
}
.rfa-count--high { color: var(--rfa-high); border-color: color-mix(in srgb, var(--rfa-high) 40%, transparent); }
.rfa-count--medium { color: var(--rfa-medium); border-color: color-mix(in srgb, var(--rfa-medium) 40%, transparent); }
.rfa-count--low { color: var(--rfa-low); }

.rfa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfa-item {
  position: relative;
  padding: 12px 14px 10px 16px;
  border: 1px solid var(--brd);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}
.rfa-item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--rfa-low);
}
.rfa-item--high::before { background: var(--rfa-high); }
.rfa-item--medium::before { background: var(--rfa-medium); }
.rfa-item.is-snoozed { opacity: .65; }

.rfa-item__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rfa-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--rfa-low);
}
.rfa-dot--high { background: var(--rfa-high); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rfa-high) 22%, transparent); }
.rfa-dot--medium { background: var(--rfa-medium); }

.rfa-item__head {
  flex: 1 1 auto;
  min-width: 0;
}

.rfa-item__title {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--txt);
  overflow-wrap: anywhere;
}

.rfa-item__meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.rfa-item__money {
  flex: none;
  text-align: right;
  max-width: 45%;
}
.rfa-item__money b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rfa-item__money small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

.rfa-item__detail {
  margin: 8px 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.rfa-item__also {
  margin: 10px 0 0 18px;
  padding-top: 8px;
  border-top: 1px dashed var(--brd);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rfa-also__label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rfa-also {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--txt);
}
.rfa-also .rfa-dot { margin-top: 5px; width: 6px; height: 6px; box-shadow: none; }
.rfa-also p {
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.rfa-also__money { color: var(--muted); font-weight: 600; white-space: nowrap; }

.rfa-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 12px;
}

.rfa-act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  box-sizing: border-box;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--txt) 18%, transparent);
  background: transparent;
  color: var(--txt);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rfa-act:hover,
.rfa-act:focus-visible {
  background: rgba(255, 255, 255, .06);
  border-color: color-mix(in srgb, var(--txt) 30%, transparent);
  outline: none;
}
.rfa-act--quiet {
  border-color: transparent;
  color: var(--muted);
  margin-left: auto;
}
.rfa-act:focus-visible,
.rfa-more:focus-visible,
.rfa-hidden-toggle:focus-visible {
  outline: 2px solid var(--acc, #7c5cff);
  outline-offset: 2px;
}
.rfa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Karta w siatce „Analizy wydajności” nie rozciąga się do wysokości rankingu. */
#perfInsightsCard { align-self: start; }

.rfa-more,
.rfa-hidden-toggle {
  appearance: none;
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--brd);
  background: transparent;
  color: var(--txt);
  cursor: pointer;
}
.rfa-hidden-toggle {
  align-self: flex-start;
  border-color: transparent;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rfa-more:hover { background: rgba(255, 255, 255, .05); }

.rfa-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--txt);
  padding: 10px 2px;
}
.rfa-empty__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--rfa-ok);
  background: color-mix(in srgb, var(--rfa-ok) 16%, transparent);
}
.rfa-empty--error { color: var(--muted); }
.rfa-empty--info .rfa-empty__icon {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  font-style: italic;
  font-family: Georgia, serif;
}

.rfa-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--brd);
  font-size: 11.5px;
  color: var(--muted);
}
.rfa-checks__label { color: var(--muted); }
.rfa-check { white-space: nowrap; }
.rfa-check i {
  font-style: normal;
  font-weight: 700;
  margin-right: 4px;
}
.rfa-check--ok i { color: var(--rfa-ok); }
.rfa-check--alert i { color: var(--rfa-medium); }
.rfa-check--no_data i { color: var(--muted); }
.rfa-check em { font-style: normal; white-space: normal; }

.rfa-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rfa-skeleton i {
  display: block;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  background-size: 200% 100%;
  animation: rfa-shimmer 1.4s ease-in-out infinite;
}
@keyframes rfa-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rfa-skeleton i { animation: none; } }

@media (max-width: 480px) {
  .rfa-item__top { flex-wrap: wrap; }
  .rfa-item__money { max-width: none; flex: 1 0 100%; width: auto; text-align: left; padding-left: 18px; box-sizing: border-box; }
  .rfa-item__money b, .rfa-item__money small { display: inline; }
  .rfa-item__money small { margin-left: 6px; }
}

/* Telefon (warstwa aplikacji assets/rfp): karta bez ramki, etykieta „Wymaga uwagi” nad sekcją, komórki jak reszta ekranu. */
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa { gap: 8px; font-family: var(--rfp-font, inherit); }
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-sub { margin: 0 4px; }
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-item {
  background: var(--rfp-cell, #151a29);
  border: 0;
  border-radius: 14px;
}
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-empty {
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--rfp-cell, #151a29);
  color: var(--rfp-text, var(--txt));
}
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-checks { border-top: 0; padding: 4px 4px 0; }
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-act {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
}
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-item__actions { margin-left: 0; }
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-item__detail,
html.rfp-shell[data-rfp-page=dashboard] #perfInsightsCard .rfa-item__also { margin-left: 0; }
/* Panel nie zależy już od rankingu: błąd rankingu na telefonie (data-rfp-od-failed) nie może go chować. */
html.rfp-shell[data-rfp-page=dashboard][data-rfp-od-failed][data-rfp-od-insights=list] #perfInsightsCard,
html.rfp-shell[data-rfp-page=dashboard][data-rfp-od-failed][data-rfp-od-insights=ok] #perfInsightsCard { display: block !important; }
/* :is(#…) podnosi specyficzność do poziomu reguły warstwy telefonu (ona też używa :is z #perfInsightsCard) */
html.rfp-shell[data-rfp-page=dashboard][data-rfp-od-failed]:is([data-rfp-od-insights=list], [data-rfp-od-insights=ok]) :is([data-rfp-od=insights-label], #rfAttentionNone) { display: flex !important; }
