/* TeamFit · Командное взаимодействие — карточки ролей, колесо, командный отчёт.
   Анимации только поверх готового статичного кадра: при печати/PDF всё останавливается,
   карточка остаётся завершённой (правило: анимация = украшение, не носитель смысла). */

.tf-card {
  --rc: #7C5CFC;
  position: relative;
  border-radius: 22px;
  padding: 22px 22px 18px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--rc) 88%, #fff 12%) 0%, transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--rc) 82%, #101828 18%) 0%, color-mix(in srgb, var(--rc) 55%, #101828 45%) 100%);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--rc) 70%, transparent);
}
.tf-card + .tf-card { margin-top: 16px; }
.tf-card::after { /* зерно-текстура */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(160deg, transparent 40%, #000 100%);
}
.tf-card-head { display: flex; gap: 18px; align-items: flex-start; position: relative; z-index: 1; }
.tf-emblem { flex: 0 0 96px; width: 96px; height: 96px; }
.tf-emblem svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tf-card h3 { margin: 2px 0 2px; font-size: 24px; letter-spacing: .2px; }
.tf-card .tf-quad { font-size: 12px; opacity: .82; text-transform: uppercase; letter-spacing: .08em; }
.tf-card .tf-hero { margin: 8px 0 0; font-size: 15px; line-height: 1.45; font-weight: 600; max-width: 46ch; }
.tf-card-body { position: relative; z-index: 1; margin-top: 16px; display: grid; gap: 10px; }
.tf-row { display: grid; grid-template-columns: 118px 1fr; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.tf-row b { font-weight: 700; opacity: .92; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.tf-row span { opacity: .97; }
.tf-row.tf-risk { background: rgba(16,24,40,.28); border-radius: 12px; padding: 10px 12px; margin: 0 -12px; }
.tf-card .tf-disclaimer { margin-top: 12px; font-size: 11.5px; opacity: .75; position: relative; z-index: 1; }

/* мини-карточка поддерживающей роли */
.tf-card.tf-mini { padding: 16px 18px 14px; }
.tf-card.tf-mini .tf-emblem { flex-basis: 56px; width: 56px; height: 56px; }
.tf-card.tf-mini h3 { font-size: 18px; }

/* ------- эмблемы: общие правила анимации (только transform/opacity) ------- */
.tf-anim .tf-spin   { transform-origin: center; transform-box: fill-box; animation: tf-rot 14s linear infinite; }
.tf-anim .tf-orbit  { transform-origin: center; transform-box: fill-box; animation: tf-rot 9s linear infinite; }
.tf-anim .tf-spark  { animation: tf-spark 2.6s ease-in-out infinite; }
.tf-anim .tf-spark.d2 { animation-delay: .9s; } .tf-anim .tf-spark.d3 { animation-delay: 1.7s; }
.tf-anim .tf-scan   { animation: tf-scan 3.2s ease-in-out infinite; }
.tf-anim .tf-pulse  { transform-origin: center; transform-box: fill-box; animation: tf-pulse 2.8s ease-in-out infinite; }
.tf-anim .tf-pulse.d2 { animation-delay: 1.4s; }
.tf-anim .tf-flow   { stroke-dasharray: 5 7; animation: tf-flow 2.4s linear infinite; }
.tf-anim .tf-glow   { animation: tf-glow 3s ease-in-out infinite; }
.tf-anim .tf-build1 { animation: tf-pop 3.6s ease-in-out infinite; }
.tf-anim .tf-build2 { animation: tf-pop 3.6s ease-in-out .6s infinite; }
.tf-anim .tf-build3 { animation: tf-pop 3.6s ease-in-out 1.2s infinite; }
.tf-anim .tf-move   { animation: tf-move 3s ease-in-out infinite; }
.tf-anim .tf-sweep  { transform-origin: center; transform-box: fill-box; animation: tf-rot 4.5s linear infinite; }
.tf-anim .tf-tick   { animation: tf-tick 2.2s ease-in-out infinite; }

@keyframes tf-rot   { to { transform: rotate(360deg); } }
@keyframes tf-spark { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes tf-scan  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(34px); } }
@keyframes tf-pulse { 0%,100% { transform: scale(.55); opacity: .55; } 60% { transform: scale(1.05); opacity: 0; } }
@keyframes tf-flow  { to { stroke-dashoffset: -24; } }
@keyframes tf-glow  { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes tf-pop   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tf-move  { 0%,100% { transform: translateX(0); } 50% { transform: translateX(7px); } }
@keyframes tf-tick  { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ------- колесо ролей (личный отчёт) ------- */
.tf-wheel-wrap { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 24px; align-items: center; }
.tf-wheel-wrap svg { width: 100%; height: auto; }
.tf-wheel-legend { display: grid; gap: 6px; }
.tf-wl { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.tf-wl i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.tf-wl b { min-width: 108px; }
.tf-wl .tf-zone { margin-left: auto; font-size: 12px; color: var(--ink3); }
.tf-wl.tf-lead { font-weight: 700; }
.tf-wl.tf-lead .tf-zone { color: var(--ink); }

/* ------- шкалы восприятия (зоны) ------- */
.tf-scale-row { display: grid; grid-template-columns: 170px 1fr 96px; gap: 12px; align-items: center; margin-bottom: 10px; }
.tf-scale-row .tf-track { position: relative; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--bad-soft) 0 42%, var(--warn-soft) 42% 68%, var(--ok-soft) 68% 100%); }
.tf-scale-row .tf-track.inv { background: linear-gradient(90deg, var(--ok-soft) 0 42%, var(--warn-soft) 42% 62%, var(--bad-soft) 62% 100%); }
.tf-scale-row .tf-track.h1z { background: linear-gradient(90deg, var(--bad-soft) 0 30%, var(--ok-soft) 30% 62%, var(--warn-soft) 62% 80%, var(--bad-soft) 80% 100%); }
.tf-scale-row .tf-dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transform: translate(-50%, -50%); transition: left .8s cubic-bezier(.2,.8,.2,1); }
.tf-badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-align: center; }
.tf-badge.green { background: var(--ok-soft); color: #1e7b4f; }
.tf-badge.amber { background: var(--warn-soft); color: #9a6a12; }
.tf-badge.red { background: var(--bad-soft); color: #b23b31; }

/* ------- командный отчёт: карта людей ------- */
.tf-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.tf-person { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.tf-person .tf-p-name { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.tf-person .tf-p-role { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 14px; margin: 2px 4px 2px 0; }
.tf-person .tf-p-role.sup { opacity: .8; font-weight: 500; }
.tf-person .tf-p-meta { font-size: 11px; color: var(--ink3); margin-top: 5px; }
.tf-person .tf-p-flag { font-size: 11px; color: #b23b31; margin-top: 4px; }

/* карта покрытия: мини-эмблемы по колесу */
.tf-cover { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tf-cover-cell { border-radius: 14px; padding: 10px; text-align: center; border: 1.5px solid var(--line); background: #fff; }
.tf-cover-cell .tf-emblem { width: 44px; height: 44px; flex: none; margin: 0 auto 6px; }
.tf-cover-cell b { display: block; font-size: 12.5px; }
.tf-cover-cell .tf-cnt { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.tf-cover-cell.tf-def { border-color: #b23b31; background: var(--bad-soft); }
.tf-cover-cell.tf-exc { border-color: #9a6a12; background: var(--warn-soft); }
.tf-cover-cell.tf-def .tf-cnt { color: #b23b31; font-weight: 700; }

.tf-junction { border-left: 4px solid #9a6a12; background: var(--warn-soft); border-radius: 0 12px 12px 0; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; }
.tf-junction.active { border-color: #b23b31; background: var(--bad-soft); }
.tf-sceplenie { border: 1.5px solid #b23b31; background: var(--bad-soft); border-radius: 14px; padding: 14px 16px; }
.tf-sceplenie.ok { border-color: var(--line); background: #fff; }

/* стыки-бейджи в личном отчёте */
.tf-chip { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 14px; background: var(--wash); margin: 2px 4px 2px 0; }

@media (max-width: 760px) {
  .tf-wheel-wrap { grid-template-columns: 1fr; }
  .tf-scale-row { grid-template-columns: 1fr; gap: 5px; }
  .tf-cover { grid-template-columns: repeat(2, 1fr); }
  .tf-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ------- печать / PDF: всё статично, кадр завершён ------- */
@media print {
  .tf-anim *, .tf-anim *::before, .tf-anim *::after { animation: none !important; transition: none !important; }
  .tf-anim .tf-pulse { opacity: 0; }
  .tf-anim .tf-scan { transform: translateY(17px); }
  .tf-card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tf-card::after { opacity: .25; }
  .tf-scale-row .tf-dot { transition: none; }
  .tf-cover-cell { break-inside: avoid; }
  .tf-person { break-inside: avoid; }
}
