.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ───────────── Login ───────────── */
.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}
.login-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  pointer-events: none;
}
.login-glow.a {
  background: #4f8cff;
  top: -180px;
  left: -120px;
}
.login-glow.b {
  background: #22d3ee;
  bottom: -220px;
  left: 30%;
  opacity: 0.18;
}
.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 64px clamp(32px, 6vw, 96px);
}
.login-art {
  width: min(420px, 100%);
}
.login-edge {
  fill: none;
  stroke: rgba(79, 140, 255, 0.45);
  stroke-width: 2;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw 1.2s var(--ease) forwards;
}
.login-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.6s var(--ease) forwards;
}
.login-halo {
  fill: rgba(79, 140, 255, 0.12);
  animation: pulse 2.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.login-visual h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 12px 28px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-features .icon {
  color: var(--accent-2);
}
.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-form {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 32px;
  border-radius: 24px;
  background: rgba(15, 20, 31, 0.72);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.login-form.shake {
  animation: shake 0.4s;
}
.login-head {
  text-align: center;
  margin-bottom: 10px;
}
.login-head img {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
}
.login-head h1 {
  font-size: 22px;
  font-weight: 650;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus-within {
  border-color: rgba(79, 140, 255, 0.6);
  box-shadow: var(--ring);
  color: var(--accent);
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
}
.field-action {
  color: var(--text-3);
}
.field-action:hover {
  color: var(--text);
}
.login-error {
  min-height: 18px;
  font-size: var(--fs-sm);
  color: var(--c-issue);
}
.login .btn-block {
  height: 46px;
}

@media (max-width: 900px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-visual {
    display: none;
  }
}

/* ───────────── Home ───────────── */
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.eyebrow {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: 4px;
  text-transform: capitalize;
}
.page-hero h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.4px;
}
.hero-chips {
  display: flex;
  gap: 8px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--gap);
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(400px 160px at 0% 0%, color-mix(in srgb, var(--tone) 14%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tone) 45%, transparent);
}
.project-card-head {
  display: flex;
  gap: 18px;
  align-items: center;
}
.project-card-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.project-card-title h3 {
  font-size: 18px;
  font-weight: 650;
}
.project-card-title p {
  font-size: var(--fs-sm);
}
.project-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
}
.project-card-stats div {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-top: 2px solid var(--tone);
}
.project-card-stats b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.project-card-stats span {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.project-card-foot small {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-xs);
}

.attention {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attention a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  transition: background 0.15s;
}
.attention a:hover {
  background: var(--surface-2);
}
.attention .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
  flex-shrink: 0;
}
.attention .mono {
  font-size: var(--fs-xs);
  flex-shrink: 0;
}
.attention-title {
  flex: 1;
  min-width: 0;
}
.attention .more {
  padding: 6px 10px;
  font-size: var(--fs-xs);
}

/* ───────────── Timeline ───────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--border-strong), transparent);
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
}
.timeline-marker {
  position: relative;
  z-index: 1;
  padding-top: 2px;
}
.timeline-marker .avatar {
  box-shadow: 0 0 0 4px var(--surface);
}
.timeline-body {
  flex: 1;
  min-width: 0;
}
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}
.timeline-text {
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.6;
}
.timeline-text a {
  color: var(--accent-2);
}
.timeline-text code {
  font-size: 0.85em;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--surface-3);
}
.timeline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.timeline-chips .ticket-chip {
  max-width: 280px;
}
.timeline.compact .timeline-item {
  padding-bottom: 12px;
}
.timeline.compact .timeline-text {
  -webkit-line-clamp: 2;
}
.timeline-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-group {
  padding: 18px 20px 4px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.timeline-date {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs);
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: capitalize;
}

/* ───────────── Project ───────────── */
.project-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 0;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 200px at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.project-head-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.project-head-text {
  flex: 1;
  min-width: 220px;
}
.project-head h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.project-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 4px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.project-head-kpis {
  display: flex;
  gap: 8px;
}
.project-head-kpis div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-bottom: 2px solid var(--kpi);
}
.project-head-kpis strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.project-head-kpis span {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 -4px;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--tone);
}
.tab.active .icon {
  color: var(--tone);
}
.phase-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tone) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.phase-line .icon {
  color: var(--tone);
  margin-top: 2px;
}

/* Pipeline */
.pipeline {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.pipeline-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.pipeline-stage:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tone) 50%, transparent);
}
.pipeline-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 8px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
}
.pipeline-stage strong {
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pipeline-stage span {
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.pipeline-bar {
  width: 100%;
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.pipeline-bar i {
  display: block;
  height: 100%;
  background: var(--tone);
  border-radius: 4px;
}
.pipeline-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  color: var(--text-3);
}
.pipeline-link span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}
.pipeline-link .icon {
  position: relative;
  background: var(--bg);
  border-radius: 50%;
}
.pipeline-blocked {
  position: absolute;
  right: 12px;
  top: -10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, var(--bg));
}

/* Roadmap */
.roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 0;
  overflow-x: auto;
}
.roadmap li {
  position: relative;
  padding: 0 14px 0 0;
}
.roadmap li::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 30px;
  right: 0;
  height: 2px;
  background: var(--surface-3);
}
.roadmap li:last-child::before {
  display: none;
}
.roadmap li.done::before {
  background: var(--tone);
}
.roadmap-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 2px solid var(--surface-3);
  margin-bottom: 10px;
}
.roadmap li.done .roadmap-dot {
  color: #fff;
  background: var(--tone);
  border-color: var(--tone);
}
.roadmap li.current .roadmap-dot {
  color: var(--tone);
  border-color: var(--tone);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 18%, transparent);
}
.roadmap p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.5;
}
.roadmap li.done p,
.roadmap li.current p {
  color: var(--text-2);
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.focus-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.focus-row .ticket-chip {
  flex: 1;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-cloud > span {
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(79, 140, 255, calc(0.05 + var(--w) * 0.2));
  border: 1px solid rgba(79, 140, 255, calc(0.08 + var(--w) * 0.3));
  font-size: calc(11px + var(--w) * 4px);
}
.tag-cloud .tag {
  color: var(--text-2);
}

/* Board */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.board-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(15, 20, 31, 0.6);
  border: 1px solid var(--border);
  border-top: 2px solid var(--tone);
}
.board-col header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
}
.board-col h3 {
  flex: 1;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.board-col .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}
.board-col .count {
  font-size: var(--fs-xs);
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--text-2);
}
.board-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-empty {
  display: grid;
  place-items: center;
  height: 70px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
}

/* Tickets table */
.table-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.data-table th {
  position: sticky;
  top: 0;
  padding: 12px 14px;
  text-align: left;
  font-weight: 500;
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th .icon {
  display: inline-block;
  vertical-align: -2px;
  margin-left: 4px;
}
.data-table th.sorted {
  color: var(--text);
}
.data-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.data-table tbody tr:hover {
  background: var(--surface-2);
}
.cell-id {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cell-id .mono {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.cell-title {
  width: 100%;
  max-width: 0;
  white-space: normal !important;
}
.cell-owner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}

/* Graph */
.graph-stage {
  position: relative;
  height: calc(100vh - 330px);
  min-height: 460px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at center, rgba(79, 140, 255, 0.05), transparent 70%),
    radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.graph-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.graph-svg.dragging {
  cursor: grabbing;
}
.graph-edge {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1.2;
  transition: stroke 0.15s, opacity 0.15s;
}
.graph-node {
  cursor: pointer;
  transition: opacity 0.15s;
}
.graph-node circle:nth-child(2) {
  stroke-width: 2.5;
}
.graph-halo {
  opacity: 0;
  transition: opacity 0.15s;
}
.graph-node:hover .graph-halo,
.graph-node:focus .graph-halo {
  opacity: 0.25;
}
.graph-node.is-done {
  opacity: 0.5;
}
.graph-node text {
  font: 500 10px var(--mono);
  fill: var(--text-2);
  pointer-events: none;
  transition: opacity 0.15s;
}
.graph-node.is-done text {
  opacity: 0;
}
.graph-node:hover text,
.graph-svg.has-focus .graph-node.near text {
  opacity: 1;
}
.graph-svg.has-focus .graph-node:not(.near) {
  opacity: 0.12;
}
.graph-svg.has-focus .graph-edge:not(.near) {
  opacity: 0.08;
}
.graph-edge.near {
  stroke: var(--accent-2);
  stroke-width: 2;
}
.graph-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.graph-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(20, 26, 39, 0.85);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.graph-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.graph-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.graph-legend i.ring-done {
  background: var(--text-3);
  opacity: 0.5;
}
.hint {
  font-size: var(--fs-xs);
}

/* Flow: tickets as balls falling through in-progress and review into Done */
.flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap);
  align-items: start;
}
.flow-stage {
  --wait: var(--c-review);
  --file: var(--c-blocked);
  --pulse: var(--accent-2);
  --crit: var(--c-p2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 100%, rgba(79, 140, 255, 0.08), transparent 60%),
    radial-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.flow-svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}
.flow-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: sticky;
  top: 0;
}
.flow-counts {
  font-size: var(--fs-sm);
}
.flow-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
}
.flow-toggle {
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.flow-toggle:hover {
  color: var(--text);
}
.flow-toggle.active {
  color: var(--accent);
  border-color: rgba(79, 140, 255, 0.4);
  background: var(--accent-soft);
}

/* Machine */
.flow-lane {
  font: 600 12px var(--font);
  fill: var(--text-2);
}
.flow-tier {
  font: 600 12px var(--font);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  fill: var(--text-3);
}
.flow-tube {
  fill: rgba(148, 163, 184, 0.04);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}
.flow-gloss {
  stroke: rgba(148, 163, 184, 0.12);
  stroke-width: 3;
  stroke-linecap: round;
}
.flow-hatch {
  fill: var(--surface-3);
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 0.5s var(--ease), fill 0.3s;
}
.flow-hatch.open {
  fill: var(--accent);
  animation: flow-blink 1.8s ease-in-out infinite;
}
.flow-band {
  fill: rgba(148, 163, 184, 0.035);
  stroke: var(--border);
}
.flow-cup {
  fill: var(--bg-elev);
  stroke: var(--border-strong);
  stroke-dasharray: 3 4;
}
.flow-belt {
  fill: var(--bg-elev);
  stroke: var(--border-strong);
}
.flow-belt-line {
  stroke: var(--border-strong);
  stroke-width: 2;
  stroke-dasharray: 2 10;
  animation: flow-belt 1.2s linear infinite;
}
.flow-train {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  animation: flow-dash 0.8s linear infinite, flow-glow 2.4s ease-in-out infinite;
}
.flow-car {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.flow-pipe {
  fill: var(--bg-elev);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}
.flow-hole {
  fill: var(--bg);
  stroke: var(--border-strong);
}
.flow-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}
.flow-ring.r1 {
  stroke-dasharray: 14 10;
  opacity: 0.55;
  animation: flow-ring 4s linear infinite;
}
.flow-ring.r2 {
  stroke: var(--accent-2);
  stroke-dasharray: 6 12;
  opacity: 0.45;
  animation: flow-ring 3s linear infinite reverse;
}
.flow-ring.r3 {
  opacity: 0.18;
}
.flow-hole-n {
  font: 700 30px var(--font);
  fill: var(--text);
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
  transform-origin: center;
  transform-box: fill-box;
}
.flow-hole-n.bump {
  animation: flow-count 0.8s ease-out;
}
.flow-hole-l {
  font: 600 9.5px var(--font);
  letter-spacing: 3px;
  fill: var(--c-done);
  text-anchor: middle;
}
.flow-plus {
  font: 700 17px var(--font);
  fill: var(--c-done);
  text-anchor: middle;
}
.flow-tray {
  fill: var(--surface-2);
  stroke: var(--border);
}
.flow-tray-t {
  font: 500 11.5px var(--font);
  fill: var(--text-3);
}
.flow-tray-lock rect {
  fill: var(--c-blocked);
}
.flow-tray-lock path {
  fill: none;
  stroke: var(--c-blocked);
  stroke-width: 1.8;
}

/* Balls */
.flow-svg .ball {
  cursor: pointer;
  outline: none;
  transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.5s;
}
.ball .inner {
  transition: filter 0.3s, opacity 0.3s;
}
.ball .body {
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1;
}
.ball .lbl {
  font: 600 9px var(--mono);
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2px;
}
.ball .halo,
.ball .ring,
.ball .crit,
.ball .sel,
.ball .hov,
.ball .spin {
  fill: none;
  opacity: 0;
}
.ball .halo,
.ball .ring,
.ball .spin {
  transform-origin: center;
  transform-box: fill-box;
}
.ball .halo {
  stroke: var(--accent);
  stroke-width: 2;
}
.ball .ring {
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
}
.ball .crit {
  stroke: var(--crit);
  stroke-width: 2.4;
}
.ball .sel {
  stroke: var(--text);
  stroke-width: 1.8;
}
.ball .hov {
  stroke: var(--text-2);
  stroke-width: 1.2;
}
.ball .spin {
  stroke: var(--c-done);
  stroke-width: 1.4;
  stroke-dasharray: 2 5;
  animation: spin 4s linear infinite;
}
.ball .lock,
.ball .files,
.ball .stuckx,
.ball .qa-ok {
  display: none;
}
.ball .qa-ok circle {
  fill: var(--c-done);
  stroke: var(--surface);
  stroke-width: 1;
}
.ball .qa-ok path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ball.qa-batch .ring {
  opacity: 0.8;
  stroke: var(--text-3);
}
.ball.qa-pending .spin {
  opacity: 1;
  stroke: var(--accent);
}
.ball.qa-fail .ring {
  opacity: 1;
  stroke: var(--c-blocked);
  stroke-width: 2;
  stroke-dasharray: none;
  animation: flow-blink 1.2s ease-in-out infinite;
}
.ball.qa-passed .qa-ok {
  display: block;
}
.ball .lock rect {
  fill: var(--wait);
  stroke: var(--surface);
  stroke-width: 1;
}
.ball .lock path {
  fill: none;
  stroke: var(--wait);
  stroke-width: 1.8;
}
.ball .lock.bump {
  animation: flow-shake 0.6s var(--ease);
}
.ball .shaped {
  display: none;
}
.show-files .ball .has-shape .round {
  display: none;
}
.show-files .ball .has-shape .shaped {
  display: inline;
}
.ball .shaped .body {
  stroke-width: 3;
  stroke-linejoin: round;
}
.ball .shaped .edge {
  fill: none;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.ball .files rect {
  stroke: var(--surface);
  stroke-width: 1;
}
.ball .stuckx {
  fill: none;
  stroke: var(--c-blocked);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.ball:hover .hov,
.ball:focus-visible .hov {
  opacity: 0.6;
}
.ball.s-next .halo {
  animation: flow-glow 1.8s ease-in-out infinite;
}
.ball.s-ready .ring {
  opacity: 1;
  animation: spin 6s linear infinite;
}
.ball.s-blocked .inner {
  filter: saturate(0.35);
  opacity: 0.7;
}
.ball.s-blocked .lock {
  display: block;
}
.ball.s-working .spin {
  opacity: 1;
}
.ball.s-stuck .inner {
  filter: grayscale(1);
  opacity: 0.6;
}
.ball.s-stuck .stuckx {
  display: block;
}
.ball.is-crit .crit,
.ball.is-sel .sel {
  opacity: 1;
}
.ball.flash .halo {
  stroke: var(--accent-2);
  animation: flow-glow 0.9s ease-in-out 2;
}
.ball.sunk {
  opacity: 0;
  pointer-events: none;
}
.show-files .ball .files {
  display: block;
}
.flow-svg.focus .ball:not(.rel) .inner {
  opacity: 0.2;
}
.flow-svg.focus .ball.s-blocked.rel .inner {
  opacity: 0.9;
}

/* Lines and effects */
.flow-wait,
.flow-file,
.flow-teth,
.flow-pulse,
.flow-pulse-trail {
  fill: none;
}
.flow-wait {
  stroke: var(--wait);
  stroke-width: 1.8;
  stroke-dasharray: 4 6;
  opacity: 0.85;
  animation: flow-dash 1s linear infinite;
}
.flow-file {
  stroke: var(--file);
  stroke-width: 2;
  stroke-dasharray: 2 4;
  animation: flow-dash 0.6s linear infinite, flow-blink 1.2s ease-in-out infinite;
}
.flow-teth {
  stroke-width: 1.8;
}
.flow-teth.up {
  stroke: var(--wait);
}
.flow-teth.down {
  stroke: var(--accent);
}
.flow-teth.all {
  stroke: var(--text-3);
  stroke-width: 1;
  opacity: 0.35;
}
.flow-teth.crit {
  stroke: var(--crit);
  stroke-width: 2.4;
  opacity: 0.85;
}
.flow-pulse {
  stroke: var(--pulse);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--pulse));
}
.flow-pulse-trail {
  stroke: var(--pulse);
  stroke-width: 1.4;
  opacity: 0.25;
}
.flow-lockpop rect,
.flow-spark {
  fill: var(--wait);
}
.flow-lockpop path {
  fill: none;
  stroke: var(--wait);
  stroke-width: 1.8;
}
.ah-up path,
.ah-w path {
  fill: var(--wait);
}
.ah-down path {
  fill: var(--accent);
}
.ah-crit path {
  fill: var(--crit);
}
.ah-all path {
  fill: var(--text-3);
}
.ah-m path {
  fill: var(--file);
}
.fg-edge-0 {
  stroke: #a78bfa;
}
.fg-edge-1 {
  stroke: #14b8a6;
}
.fg-edge-2 {
  stroke: #ec4899;
}
.fg-edge-3 {
  stroke: #f97316;
}
.fg-edge-4 {
  stroke: #22d3ee;
}
.fg-edge-5 {
  stroke: #eab308;
}
.flow-demo .d-group {
  fill-opacity: 0.35;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.fg-0 {
  fill: #a78bfa;
  background: #a78bfa;
}
.fg-1 {
  fill: #14b8a6;
  background: #14b8a6;
}
.fg-2 {
  fill: #ec4899;
  background: #ec4899;
}
.fg-3 {
  fill: #f97316;
  background: #f97316;
}
.fg-4 {
  fill: #22d3ee;
  background: #22d3ee;
}
.fg-5 {
  fill: #eab308;
  background: #eab308;
}

/* Flow side panel */
.flow-sel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flow-sel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-sel-id {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}
.flow-sel-title {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.45;
}
.flow-sel-title:hover,
.flow-sel-id:hover {
  color: var(--accent);
}
.flow-rel {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.flow-rel-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
}
.flow-rel-icon.wait {
  --tone: var(--c-review);
}
.flow-rel-icon.unlock {
  --tone: var(--accent);
}
.flow-rel-icon.file {
  --tone: var(--c-blocked);
}
.flow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
  align-items: center;
}
.flow-chip {
  padding: 2px 8px;
  font: 500 11px var(--mono);
  cursor: pointer;
}
.flow-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.flow-chip.is-done {
  opacity: 0.5;
  text-decoration: line-through;
}
.flow-chip.is-done .icon {
  color: var(--c-done);
}
.flow-live {
  font-weight: 500;
  color: var(--c-done);
}
.flow-live small {
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0;
}
.flow-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.6s var(--ease) infinite;
}
.flow-live.off {
  color: var(--c-blocked);
}
.flow-live.off .flow-live-dot {
  animation: none;
}
.flow-lane.over {
  fill: var(--c-blocked);
}
.flow-cup.over {
  stroke: var(--c-blocked);
}
.flow-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.flow-feed li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  animation: fade-up 0.35s var(--ease);
}
.flow-feed-empty {
  gap: 8px;
}
.flow-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.flow-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.flow-legend hr {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2px 0;
}
.fg-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.flow-demo {
  flex-shrink: 0;
}
.flow-demo .d-halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transform-origin: center;
  transform-box: fill-box;
  animation: flow-glow 1.8s ease-in-out infinite;
}
.flow-demo .d-ready {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-dasharray: 2 2;
  transform-origin: center;
  transform-box: fill-box;
  animation: spin 3s linear infinite;
}
.flow-demo .d-work {
  fill: none;
  stroke: var(--c-done);
  stroke-width: 1.5;
  stroke-dasharray: 2 4;
  transform-origin: center;
  transform-box: fill-box;
  animation: spin 3s linear infinite;
}
.flow-demo .d-batch {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}
.flow-demo .d-train {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  animation: flow-dash 0.8s linear infinite;
}
.flow-demo .d-fail {
  fill: none;
  stroke: var(--c-blocked);
  stroke-width: 2;
  animation: flow-blink 1.2s ease-in-out infinite;
}
.flow-demo .d-ok circle {
  fill: var(--c-done);
}
.flow-demo .d-ok path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.flow-demo .d-crit {
  fill: none;
  stroke: var(--c-p2);
  stroke-width: 2;
}
.flow-demo .d-lock rect {
  fill: var(--c-review);
}
.flow-demo .d-lock path {
  fill: none;
  stroke: var(--c-review);
  stroke-width: 1.6;
}
.flow-demo .d-wait {
  stroke: var(--c-review);
  stroke-width: 2;
  stroke-dasharray: 4 5;
  animation: flow-dash 1s linear infinite;
}
.flow-demo .d-file {
  stroke: var(--c-blocked);
  stroke-width: 2;
  stroke-dasharray: 2 3;
  animation: flow-dash 0.6s linear infinite;
}
.flow-demo .d-pulse {
  stroke: var(--accent-2);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 6 40;
  animation: flow-pulse 1.6s ease-in infinite;
}

@keyframes flow-belt {
  to {
    stroke-dashoffset: -12;
  }
}
@keyframes flow-dash {
  to {
    stroke-dashoffset: -10;
  }
}
@keyframes flow-ring {
  to {
    stroke-dashoffset: -96;
  }
}
@keyframes flow-blink {
  50% {
    opacity: 0.35;
  }
}
@keyframes flow-glow {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}
@keyframes flow-count {
  20% {
    fill: var(--c-done);
  }
}
@keyframes flow-shake {
  30% {
    transform: translateY(-3px) rotate(-14deg);
  }
  60% {
    transform: rotate(10deg);
  }
}
@keyframes flow-pulse {
  from {
    stroke-dashoffset: 6;
  }
  to {
    stroke-dashoffset: -40;
  }
}

@media (max-width: 1180px) {
  .flow-layout {
    grid-template-columns: 1fr;
  }
  .flow-side {
    position: static;
  }
}

/* Wiki */
.tab-wiki .tab-body.wiki {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 210px;
  gap: var(--gap);
  align-items: start;
}
.wiki-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 140px);
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.wiki-side .search-box {
  min-width: 0;
}
.tree {
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.tree-folder-head,
.tree-file {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.tree-folder-head:hover,
.tree-file:hover {
  background: var(--surface-2);
  color: var(--text);
}
.tree-folder-head span {
  flex: 1;
}
.tree-folder-head small {
  font-size: 10.5px;
  color: var(--text-3);
}
.tree-folder-head .icon:nth-child(2) {
  color: #f5c46b;
}
.tree-caret {
  transition: transform 0.15s;
  color: var(--text-3);
}
.tree-folder-head.open .tree-caret {
  transform: rotate(90deg);
}
.tree-file {
  color: var(--text-3);
}
.tree-file.active {
  background: var(--accent-soft);
  color: var(--text);
}
.tree-file.active .icon {
  color: var(--accent);
}
.tree-empty {
  padding: 10px;
  font-size: var(--fs-sm);
}
.wiki-reader {
  min-width: 0;
  padding: 28px 36px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.doc-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.doc-path {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.doc-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.doc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-sm);
}
.backlinks {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.backlinks h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: 10px;
}
.backlinks > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.backlinks .chip:hover {
  color: var(--text);
}
.wiki-toc {
  position: sticky;
  top: 0;
}

@media (max-width: 1280px) {
  .tab-wiki .tab-body.wiki {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .wiki-toc {
    display: none;
  }
}
@media (max-width: 900px) {
  .tab-wiki .tab-body.wiki {
    grid-template-columns: 1fr;
  }
  .wiki-side {
    position: static;
    max-height: 320px;
  }
  .wiki-reader {
    padding: 20px;
  }
  .pipeline {
    flex-wrap: wrap;
    gap: 10px;
  }
  .pipeline-link {
    display: none;
  }
  .pipeline-stage {
    flex: 1 1 40%;
  }
  .project-head-kpis {
    width: 100%;
  }
  .project-head-kpis div {
    flex: 1;
    min-width: 0;
  }
}

/* ───────────── Ticket ───────────── */
.ticket-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.back-link:hover {
  color: var(--text);
}
.ticket-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ticket-hero-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  flex-shrink: 0;
}
.ticket-hero-id {
  font-size: var(--fs-sm);
  color: var(--tone);
}
.ticket-hero h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.ticket-hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ticket-strip {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}
.ticket-ac {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 14px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.ticket-ac strong {
  display: block;
  font-size: var(--fs-sm);
}
.ticket-ac .dim {
  font-size: var(--fs-xs);
}
.ticket-ac .ring-label strong {
  font-size: 13px;
}
.meta-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  min-width: 280px;
}
.meta-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.meta-item .icon {
  color: var(--text-3);
}
.meta-item strong {
  font-weight: 500;
  text-align: right;
  min-width: 0;
}
.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--gap);
  align-items: start;
}
.ticket-doc {
  padding: 26px 32px;
}
.ticket-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.relation-svg {
  width: 100%;
  max-width: 300px;
  margin: 0 auto 8px;
  overflow: visible;
}
.rel-orbit {
  fill: none;
  stroke: var(--border-strong);
  stroke-dasharray: 3 5;
}
.rel-edge {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1.4;
}
.rel-edge.incoming {
  stroke-dasharray: 4 4;
}
.rel-node {
  cursor: pointer;
}
.rel-node circle {
  stroke-width: 2.5;
  transition: transform 0.15s;
}
.rel-node:hover circle {
  transform: scale(1.25);
}
.rel-node.center {
  cursor: default;
}
.rel-node.center circle {
  stroke-width: 4;
  filter: drop-shadow(0 0 12px var(--tone));
}
.rel-node.is-done {
  opacity: 0.6;
}
.rel-node text {
  font: 500 9.5px var(--mono);
  fill: var(--text-2);
  pointer-events: none;
}
.rel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rel-row .ticket-chip {
  flex: 1;
}

@media (max-width: 1100px) {
  .ticket-layout {
    grid-template-columns: 1fr;
  }
  .ticket-side {
    position: static;
  }
  .ticket-doc {
    padding: 20px;
  }
}
