/* ══ PI Planning — воронка ══ */
.pip-page { --pip-warm: #f59e0b; --pip-cool: #3f6ff2; max-width: 1480px; margin: 0 auto; position: relative; }
.pip-page::before { content: ''; position: absolute; inset: -28px -32px auto; height: 420px; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 15% 0%, rgba(245,158,11,.14), transparent 70%), radial-gradient(50% 70% at 85% 10%, rgba(124,58,237,.12), transparent 70%),
    repeating-linear-gradient(90deg, rgba(26,29,46,.035) 0 1px, transparent 1px 48px); }
.pip-page > * { position: relative; z-index: 1; }
.pip-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 0; color: var(--text3); }
.pip-loading-funnel { width: 64px; height: 56px; background: linear-gradient(180deg, var(--pip-warm, #f59e0b), #3f6ff2); clip-path: polygon(0 0, 100% 0, 62% 100%, 38% 100%); animation: pipPulse 1.2s ease-in-out infinite; }
@keyframes pipPulse { 50% { opacity: .45; transform: scaleY(.9); } }

.pip-hero { margin-bottom: 18px; }
.pip-hero-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pip-hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pip-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
.pip-title { font-family: 'Unbounded', sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.pip-title span { background: linear-gradient(90deg, #f59e0b, #e0559a 45%, #6d4ff0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pip-lead { color: var(--text2); max-width: 720px; margin-top: 8px; }
.pip-snap-select { padding: 6px 10px; font-size: 12px; max-width: 240px; }
.pip-snap-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.pip-pis { display: flex; gap: 8px; margin: 16px 0 12px; overflow-x: auto; padding-bottom: 2px; }
.pip-pi { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg2); font-family: inherit; cursor: pointer; white-space: nowrap; transition: border-color .15s, transform .15s, box-shadow .15s; }
.pip-pi b { font-size: 13px; }
.pip-pi span { font-size: 11px; color: var(--text3); }
.pip-pi:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pip-pi.active { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, linear-gradient(120deg, #f59e0b, #6d4ff0) border-box; border: 2px solid transparent; }
.pip-pi-add { justify-content: center; color: var(--purple); font-weight: 700; border-style: dashed; }

.pip-cadence { position: relative; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; }
.pip-iters { display: flex; gap: 4px; }
.pip-iter { min-width: 0; padding: 6px 8px; border-radius: var(--r-sm); background: var(--bg4); display: flex; flex-direction: column; font-size: 11px; color: var(--text3); }
.pip-iter b { font-size: 12px; color: var(--text); }
.pip-iter.ip { background: repeating-linear-gradient(135deg, #eef0ff 0 6px, #e4e6fb 6px 12px); }
.pip-iter.now { outline: 2px solid var(--purple); }
.pip-filters { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pip-seg { display: inline-flex; background: var(--bg4); border-radius: 999px; padding: 3px; }
.pip-seg button { border: none; background: none; padding: 6px 12px; border-radius: 999px; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text2); cursor: pointer; }
.pip-seg button.active { background: var(--bg2); color: var(--text); box-shadow: var(--shadow-sm); }
.pip-model { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', monospace; margin-left: auto; }


/* Ярус — срез воронки */
.pip-tier { width: var(--w); margin: 0 auto; background: var(--bg2); border-radius: var(--r-xl); box-shadow: var(--shadow); border: 1px solid var(--border); scroll-margin-top: 12px; overflow: hidden; }
.pip-reveal { opacity: 0; transform: translateY(24px) scale(.985); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.pip-reveal.in { opacity: 1; transform: none; }
.pip-rim { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, #fff), color-mix(in srgb, var(--c) 5%, #fff)); border-bottom: 1px solid color-mix(in srgb, var(--c) 25%, var(--border)); }
.pip-rim::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.pip-rim-no { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; flex: none; }
.pip-rim-text h2 { font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.pip-rim-text span { font-size: 12px; color: var(--text3); }
.pip-rim-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pip-stale { font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; padding: 3px 10px; border-radius: 999px; }
.pip-tier-body { padding: 16px 18px 18px; }
.pip-tier-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
.pip-empty-tier { padding: 18px; border: 1px dashed var(--border2); border-radius: var(--r-lg); color: var(--text3); text-align: center; font-size: 13px; }
.pip-small { font-size: 12px; margin-top: 6px; }

/* Перешеек между ярусами */
.pip-neck { position: relative; height: 112px; margin: 0 auto; width: 100%; }
.pip-neck-shape { position: absolute; inset: 0; margin: 0 auto; width: var(--top); clip-path: polygon(0 0, 100% 0, calc(50% + var(--ratio) * 50%) 100%, calc(50% - var(--ratio) * 50%) 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 22%, transparent), color-mix(in srgb, var(--c2) 22%, transparent)); overflow: hidden; }
.pip-dots { position: absolute; inset: 0; }
.pip-dots i { position: absolute; top: -6px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--c1); opacity: 0;
  animation: pipFlow 3.4s linear infinite; animation-delay: var(--d); }
.pip-dots i.drop { background: var(--text3); animation-name: pipDrop; }
@keyframes pipFlow { 0% { transform: translate(var(--x0), 0); opacity: 0; } 12% { opacity: .9; } 85% { opacity: .9; background: var(--c2); } 100% { transform: translate(var(--x1), 116px); opacity: 0; background: var(--c2); } }
@keyframes pipDrop { 0% { transform: translate(var(--x0), 0); opacity: 0; } 15% { opacity: .55; } 60% { opacity: .35; } 100% { transform: translate(var(--x1), 60px); opacity: 0; } }
.pip-neck-info { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; }
.pip-neck-info > * { pointer-events: auto; }
.pip-neck-count { font-size: 12px; color: var(--text2); background: rgba(255,255,255,.85); backdrop-filter: blur(4px); padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border); }
.pip-neck-count b { color: var(--text); }
.pip-neck-count em { font-style: normal; color: var(--text3); padding: 0 4px; }
.pip-go { border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: #fff; padding: 9px 18px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--c2) 35%, transparent); transition: transform .15s, box-shadow .15s; }
.pip-go span { display: inline-block; transition: transform .2s; }
.pip-go:hover { transform: translateY(-1px); } .pip-go:hover span { transform: translateY(3px); }
.pip-go:disabled { opacity: .6; cursor: wait; }
.pip-go.hot { animation: pipHot 1.6s ease-in-out infinite; }
@keyframes pipHot { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c2) 22%, transparent); } }
.pip-run { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; background: var(--bg2); border: 1px solid var(--border); padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.pip-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border2); border-top-color: var(--purple); animation: pipSpin .8s linear infinite; }
@keyframes pipSpin { to { transform: rotate(360deg); } }

/* Ярус 0 */
.pip-frame { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pip-frame-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px dashed #f5b14a; background: #fffaf0; color: #92400e; padding: 5px 12px; border-radius: 999px; font: 600 12px inherit; font-family: inherit; cursor: pointer; }
.pip-video-btn { display: inline-flex; gap: 8px; align-items: center; border: none; background: #1a1d2e; color: #fff; padding: 5px 14px 5px 5px; border-radius: 999px; font: 600 12px inherit; font-family: inherit; cursor: pointer; margin-left: auto; }
.pip-video-btn span { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #e0559a); display: grid; place-items: center; font-size: 10px; }
.pip-goals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pip-goal { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fffaf2); cursor: pointer; font-family: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pip-goal:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pip-goal.open { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.pip-goal-no { position: absolute; top: 10px; right: 12px; font-family: 'Unbounded', sans-serif; font-size: 20px; color: rgba(245,158,11,.35); font-weight: 700; }
.pip-goal-icon { font-size: 22px; } .pip-goal-icon.big { font-size: 34px; }
.pip-goal-title { font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--text); }
.pip-goal-kr { font-size: 11px; color: var(--text3); }
.pip-goal-detail { margin-top: 12px; padding: 16px; border-radius: var(--r-lg); background: #fffaf2; border: 1px solid #fde4b8; animation: pipOpen .35s ease; }
@keyframes pipOpen { from { opacity: 0; transform: translateY(-6px); } }
.pip-goal-detail-head { display: flex; gap: 14px; align-items: flex-start; }
.pip-goal-detail-head h3 { font-size: 16px; font-weight: 800; }
.pip-goal-detail-head p { color: var(--text2); font-size: 13px; margin-top: 4px; }
.pip-krs { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 6px; }
.pip-kr { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; background: var(--bg2); border-radius: var(--r); border: 1px solid var(--border); font-size: 13px; }
.pip-kr-kind { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; text-align: center; background: var(--bg4); color: var(--text2); }
.pip-kr.kind-result .pip-kr-kind { background: #dcfce7; color: #166534; }
.pip-kr.kind-output .pip-kr-kind { background: #e0e7ff; color: #3730a3; }
.pip-kr.kind-input .pip-kr-kind { background: #f3e8ff; color: #6b21a8; }
.pip-kr.kind-balance .pip-kr-kind { background: #fee2e2; color: #991b1b; }
.pip-kr-targets { display: flex; gap: 6px 12px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text2); }

/* Ярус 1 */
.pip-problems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pip-problem { display: grid; grid-template-columns: 28px minmax(0, 1fr) 84px; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg2); cursor: pointer; font-family: inherit; transition: border-color .15s, box-shadow .15s; animation: pipIn .45s ease both; animation-delay: calc(var(--i) * 40ms); }
@keyframes pipIn { from { opacity: 0; transform: translateY(8px); } }
.pip-problem:hover { border-color: #f97362; box-shadow: var(--shadow-sm); }
.pip-problem.unlinked { background: var(--bg3); } .pip-problem.unlinked .pip-problem-title { color: var(--text2); }
.pip-problem.pinned { border-style: dashed; border-color: #f97362; }
.pip-problem-rank { font-family: 'Unbounded', sans-serif; font-weight: 700; color: #f97362; font-size: 16px; text-align: center; }
.pip-problem-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pip-problem-title { font-weight: 700; font-size: 13px; color: var(--text); }
.pip-problem-meta { font-size: 11px; color: var(--text3); }
.pip-reach { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pip-reach b { font-size: 15px; }
.pip-reach i { display: block; width: 100%; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #f97362 var(--r), var(--bg4) var(--r)); }
.pip-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pip-gtag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #fff3dc; color: #92400e; border: 1px solid #fcd9a0; white-space: nowrap; }
.pip-gtag.suggested { background: transparent; border-style: dashed; color: var(--text3); }
.pip-gtag.none { background: var(--bg4); color: var(--text3); border-color: var(--border); font-weight: 600; }
.pip-plist { display: flex; flex-direction: column; }
.pip-plist-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pip-plist-row.in b { color: #c2410c; }
.pip-plist-act { display: flex; gap: 6px; align-items: center; flex: none; }
.pip-pdetail h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin: 16px 0 8px; }
.pip-pdetail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.pip-plinks { display: flex; flex-direction: column; gap: 6px; }
.pip-plink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--border); font-size: 13px; }
.pip-plink em { grid-column: 1; font-size: 12px; color: var(--text3); font-style: normal; }
.pip-plink button { grid-row: 1 / span 2; grid-column: 2; }
.pip-plink.on { background: #fff8eb; border-color: #fcd9a0; } .pip-plink.on span { font-weight: 700; }
.pip-plink.ai { border-style: dashed; border-color: #f5b14a; }
.pip-signals { display: flex; flex-direction: column; gap: 8px; }
.pip-signal { position: relative; margin: 0; padding: 10px 34px 10px 14px; border-left: 3px solid #f97362; background: var(--bg3); border-radius: 0 var(--r) var(--r) 0; font-size: 13px; }
.pip-signal cite { display: block; font-style: normal; font-size: 11px; color: var(--text3); margin-top: 4px; }
.pip-signal button { position: absolute; top: 4px; right: 4px; }
.pip-signal-add { margin-top: 10px; }

/* Ярус 2 */
.pip-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pip-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pip-col-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 2px solid #f6d3e5; }
.pip-col-head h3 { font-size: 15px; font-weight: 800; } .pip-col-head h3 span { color: #e0559a; }
.pip-col-head .btn { margin-left: auto; }
.pip-group { display: flex; flex-direction: column; gap: 8px; }
.pip-group-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text2); margin-top: 6px; display: flex; gap: 8px; align-items: baseline; }
.pip-group-title span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text3); }
.pip-card { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 30px 10px 10px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg2); animation: pipIn .4s ease both; }
.pip-card.manual { border-style: dashed; border-color: #e0559a; }
.pip-card.dropped { opacity: .6; background: var(--bg3); }
.pip-card-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pip-card-title { font-weight: 700; font-size: 13px; line-height: 1.35; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pip-card-title:hover { color: var(--purple); }
.pip-card-meta { font-size: 11px; color: var(--text3); }
.pip-card-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pip-card-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none; border-radius: 50%; background: transparent; color: var(--text3); cursor: pointer; font-size: 12px; }
.pip-card-x:hover { background: var(--bg4); color: var(--red); }
.pip-mini-select { font-size: 11px; padding: 3px 6px; max-width: 220px; }
.pip-wsjf, .pip-effect { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; border-radius: var(--r); background: linear-gradient(160deg, #fde7f2, #f3e8ff); color: #9d174d; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 16px; text-align: center; }
.pip-wsjf.none, .pip-effect.none { background: var(--bg4); color: var(--text3); font-family: inherit; font-size: 10px; font-weight: 600; }
.pip-effect small { font-family: 'Manrope', sans-serif; font-size: 9px; font-weight: 600; color: var(--text3); }
.pip-why { font-size: 12px; color: var(--text2); }
.pip-why summary { cursor: pointer; color: var(--text3); font-size: 11px; }
.pip-team-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); margin-right: 4px; }
.pip-addlist { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.pip-addrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pip-addrow > span:first-child { display: flex; align-items: center; gap: 8px; }
.pip-addrow .pip-wsjf { min-height: 28px; min-width: 40px; font-size: 12px; }

/* Ярус 3 */
.pip-mix { margin-bottom: 14px; }
.pip-mix-bar { position: relative; display: flex; height: 10px; border-radius: 5px; overflow: visible; background: var(--bg4); }
.pip-mix-bar i { display: block; height: 100%; } .pip-mix-bar i:first-child { border-radius: 5px 0 0 5px; } .pip-mix-bar i:last-child { border-radius: 0 5px 5px 0; }
.pip-mix-bar .outcome, .pip-type.outcome { background: #10b981; }
.pip-mix-bar .output, .pip-type.output { background: #6366f1; }
.pip-mix-bar .input, .pip-type.input { background: #a855f7; }
.pip-mix-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 1px; }
.pip-mix-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text2); }
.pip-mix-legend .outcome { color: #047857; font-weight: 700; } .pip-mix-legend .output { color: #4338ca; font-weight: 700; } .pip-mix-legend .input { color: #7e22ce; font-weight: 700; }
.pip-mix-goal { color: var(--text3); }
.pip-mix-warn { color: #b45309; font-weight: 700; }
.pip-mix.warn .pip-mix-bar { box-shadow: 0 0 0 2px #fcd34d; }
.pip-mix.is-empty { font-size: 12px; color: var(--text3); }
.pip-mix.compact { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; }
.pip-mix.compact .pip-mix-bar { height: 6px; flex: 1; min-width: 60px; }
.pip-mix-num { font-size: 10px; color: var(--text3); font-family: 'JetBrains Mono', monospace; }
.pip-objs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 10px; }
.pip-obj { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 10px; border-radius: var(--r-lg); background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid #10b981; cursor: default; animation: pipIn .4s ease both; }
.pip-obj[role=button] { cursor: pointer; } .pip-obj[role=button]:hover { box-shadow: var(--shadow-sm); border-color: var(--border2); }
.pip-obj.type-output { border-top-color: #6366f1; } .pip-obj.type-input { border-top-color: #a855f7; }
.pip-obj.uncommitted { border-style: dashed; background: var(--bg3); }
.pip-obj-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pip-type { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; padding: 2px 8px; border-radius: 999px; }
.pip-obj-unc { font-size: 10px; font-weight: 700; color: var(--text3); border: 1px dashed var(--border2); padding: 1px 6px; border-radius: 999px; }
.pip-bv { font-size: 10px; font-weight: 800; color: #92400e; background: #fef3c7; padding: 1px 6px; border-radius: 999px; }
.pip-origin { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--purple); background: var(--purple-light); padding: 1px 6px; border-radius: 999px; }
.pip-obj-title { font-weight: 700; font-size: 13px; line-height: 1.4; }
.pip-obj-metric { font-size: 12px; color: var(--text2); }
.pip-obj-foot { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pip-obj-parent { font-size: 10px; color: var(--text3); }
.pip-team-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 1px 8px 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 14%, #fff); color: color-mix(in srgb, var(--tc) 70%, #1a1d2e); }
.pip-team-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tc); }
.pip-obj.compact { padding: 8px; gap: 4px; border-top-width: 2px; }
.pip-obj.compact .pip-obj-title { font-size: 12px; font-weight: 600; }

/* Ярус 4 */
.pip-matrix-wrap { overflow-x: auto; }
.pip-matrix { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 1120px; table-layout: fixed; }
.pip-matrix thead th { font-size: 12px; font-weight: 800; text-align: left; color: var(--text2); padding: 0 4px; }
.pip-matrix thead th span { display: block; font-weight: 500; font-size: 11px; color: var(--text3); }
.pip-matrix thead th:first-child { width: 170px; }
.pip-matrix thead th.ip { color: #4f46e5; }
.pip-matrix tbody th { text-align: left; vertical-align: top; padding: 8px; background: var(--bg3); border-radius: var(--r); }
.pip-team-kind { display: block; font-size: 10px; color: var(--text3); margin-top: 2px; font-weight: 500; }
.pip-matrix td { vertical-align: top; background: var(--bg3); border-radius: var(--r); padding: 6px; display: table-cell; }
.pip-matrix td > .pip-obj { margin-bottom: 6px; }
.pip-matrix td.ip { background: repeating-linear-gradient(135deg, #f4f3ff 0 8px, #eeedfc 8px 16px); }
.pip-matrix tr.platform th { background: #f1f4f8; }
.pip-cell-add { width: 100%; border: 1px dashed var(--border2); background: transparent; color: var(--text3); border-radius: var(--r-sm); cursor: pointer; padding: 2px; font-size: 13px; opacity: .55; transition: opacity .15s; }
.pip-cell-add:hover { opacity: 1; color: var(--purple); border-color: var(--purple-mid); }

/* Ярус 5 */
.pip-teams { display: flex; flex-direction: column; gap: 14px; }
.pip-team { border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: var(--r-lg); padding: 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 6%, #fff), #fff 40%); }
.pip-team-head { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pip-team-head h3 { font-size: 14px; font-weight: 800; }
.pip-ns { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; max-width: 320px; }
.pip-ns em { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 70%, #1a1d2e); font-weight: 800; }
.pip-lims { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pip-lim { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--bg4); color: var(--text2); }
.pip-lim.over { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.pip-iters-row { display: grid; grid-template-columns: repeat(var(--n), minmax(150px, 1fr)); gap: 8px; overflow-x: auto; align-items: start; }
.pip-sprint { background: var(--bg3); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 90px; transition: background .15s, box-shadow .15s; }
.pip-sprint.ip { background: repeating-linear-gradient(135deg, #f4f3ff 0 8px, #eeedfc 8px 16px); }
.pip-sprint.over { box-shadow: inset 0 0 0 2px var(--purple); background: var(--purple-light); }
.pip-sprint-head { font-size: 11px; font-weight: 800; color: var(--text2); display: flex; justify-content: space-between; gap: 6px; }
.pip-sprint-head span { font-weight: 500; color: var(--text3); }
.pip-sprint-empty { font-size: 12px; color: var(--text3); text-align: center; }
.pip-item { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 12px; cursor: grab; }
.pip-item a { color: var(--text); text-decoration: none; font-weight: 600; } .pip-item a:hover { color: var(--purple); }
.pip-item small { font-size: 10px; color: var(--text3); }
.pip-item-type { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.pip-item.t-epic .pip-item-type { color: #c2410c; } .pip-item.t-feature .pip-item-type { color: #4338ca; } .pip-item.t-story .pip-item-type { color: #047857; }
.pip-item.t-ip { border-style: dashed; padding: 4px 8px; font-size: 11px; }
.pip-item.t-ip .pip-item-type { display: none; }
.pip-item-act { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; align-items: center; padding: 2px; border-radius: var(--r-sm); background: var(--bg2); box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: opacity .15s; }
.pip-item:hover .pip-item-act, .pip-item:focus-within .pip-item-act { pointer-events: auto; }
.pip-item:hover .pip-item-act, .pip-item:focus-within .pip-item-act { opacity: 1; }
.pip-item-act .pip-mini-select { max-width: 64px; }

/* Формы и модалки */
.pip-form { display: flex; flex-direction: column; gap: 10px; }
.pip-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text2); flex: 1; }
.pip-form input[type=text], .pip-form input[type=number], .pip-form input[type=date], .pip-form input[type=month], .pip-form select, .pip-form textarea { padding: 8px 10px; font-size: 13px; font-weight: 400; color: var(--text); }
.pip-form label.pmo-check { flex-direction: row; }
.pip-form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pip-form-row > input { flex: 1; padding: 8px 10px; font-size: 13px; }
.pip-form-sub { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); margin-top: 4px; }
.pip-form-flag { font-size: 12px; min-width: 120px; padding-bottom: 8px; }
.pip-danger { color: var(--red) !important; margin-right: auto; }
.pip-aud td input { width: 120px; }
.pip-teamlist { display: flex; flex-direction: column; gap: 6px; }
.pip-teamrow { display: grid; grid-template-columns: 220px 100px minmax(0, 1fr); gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: var(--r); background: var(--bg2); font-family: inherit; cursor: pointer; font-size: 13px; }
.pip-teamrow span, .pip-teamrow em { color: var(--text3); font-size: 12px; font-style: normal; }
.pip-empty { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding: 28px; margin-top: 16px; }
.pip-empty-icon { font-size: 34px; }
.pip-principles h1 { display: none; }
.pip-ro .pip-cell-add { display: none; }

@media (max-width: 1100px) {
  .pip-goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pip-title { font-size: 22px; }
  .pip-tier { width: 100%; border-radius: var(--r-lg); }
  .pip-neck { height: 90px; }
  .pip-neck-shape { width: 100%; }
  .pip-goals, .pip-problems, .pip-cols { grid-template-columns: 1fr; }
  .pip-goal { flex-direction: row; align-items: center; }
  .pip-goal-no { position: static; font-size: 14px; }
  .pip-kr { grid-template-columns: 1fr auto; } .pip-kr-kind { justify-self: start; }
  .pip-rim-actions { margin-left: 0; width: 100%; }
  .pip-teamrow { grid-template-columns: 1fr; }
  .pip-lims { margin-left: 0; }
  .pip-iters { overflow-x: auto; } .pip-iter { min-width: 104px; }
  .pip-seg { overflow-x: auto; max-width: 100%; } .pip-seg button { white-space: nowrap; }
  .pip-hero-actions { margin-left: 0; }
  .pip-matrix { min-width: 900px; }
  .pip-item-act { position: static; opacity: 1; pointer-events: auto; box-shadow: none; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .pip-reveal { opacity: 1; transform: none; transition: none; }
  .pip-dots { display: none; }
  .pip-problem, .pip-card, .pip-obj, .pip-goal-detail { animation: none; }
  .pip-go.hot { animation: none; }
}

/* PI Planning ← озеро NL */
.pip-freshes { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pip-fresh { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; white-space: nowrap; }
.pip-fresh.stale { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.pip-fresh.err { box-shadow: inset 0 0 0 1px var(--red); }
.pip-fresh.none, .pip-fresh.off { background: var(--bg4); color: var(--text3); border-color: var(--border); }
.pip-reach small { font-size: 9px; color: var(--text3); text-align: right; line-height: 1.1; }
.pip-reach.lake b { color: #b4532a; }
.pip-fact { font-size: 11px; color: var(--text2); background: var(--bg3); border-radius: var(--r-sm); padding: 2px 8px; align-self: flex-start; }
.pip-fact.done { background: #ecfdf5; color: #047857; }
.pip-fact.none { color: var(--text3); }
.pip-aud-lake td small { display: block; font-size: 10px; color: var(--text3); white-space: nowrap; }
.pip-topic-filters label { min-width: 140px; }
.pip-topics { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); }
.pip-topic { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 220px) 70px 130px; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pip-topic:last-child { border-bottom: none; }
.pip-topic-name small { display: block; font-size: 11px; color: #b4532a; }
.pip-topic-ch { font-size: 11px; color: var(--text3); }
.pip-topic-n { text-align: right; }
.pip-topic-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.pip-topic-act input[type=text] { flex: 1; min-width: 260px; padding: 7px 10px; font-size: 13px; }
.pip-topic-act select { padding: 6px 8px; font-size: 12px; max-width: 260px; }
.pip-suggest { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 10px; margin-top: 8px; border: 1px dashed #f5b14a; border-radius: var(--r); background: #fffaf2; font-size: 13px; }
.pip-runs { display: flex; flex-direction: column; font-size: 12px; }
.pip-runrow { display: grid; grid-template-columns: 120px 160px 80px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pip-runrow .st-done { color: var(--green); } .pip-runrow .st-partial { color: #b45309; } .pip-runrow .st-error { color: var(--red); } .pip-runrow .st-running { color: var(--purple); }
.pip-lake-tables { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; font-size: 12px; margin-top: 6px; }
@media (max-width: 760px) {
  .pip-topic { grid-template-columns: 22px minmax(0, 1fr) 60px; }
  .pip-topic-ch, .pip-topic select, .pip-topic .pip-gtag { grid-column: 2 / -1; }
  .pip-runrow { grid-template-columns: 1fr 1fr; }
}
