:root {
  --v2-bg: #f6f7f9;
  --v2-surface: #ffffff;
  --v2-surface-2: #fbfbfc;
  --v2-text: #18191d;
  --v2-muted: #70757f;
  --v2-faint: #9a9fa8;
  --v2-line: #e6e7eb;
  --v2-line-soft: #f0f1f3;
  --v2-primary: #4f46e5;
  --v2-primary-dark: #4338ca;
  --v2-primary-soft: #eeecff;
  --v2-accent: #4f46e5;
  --v2-red: #d92d20;
  --v2-red-soft: #fef3f2;
  --v2-amber: #b54708;
  --v2-amber-soft: #fffaeb;
  --v2-green: #067647;
  --v2-green-soft: #ecfdf3;
  --v2-radius: 12px;
  --v2-radius-sm: 8px;
  --v2-shadow: 0 1px 2px rgba(20, 21, 26, .05), 0 8px 24px -16px rgba(20, 21, 26, .18);
}

body.app-body {
  background: var(--v2-bg);
  color: var(--v2-text);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(100%, 1240px);
  max-width: 1240px;
  padding: 30px 34px 64px;
}

.app-header {
  background: rgba(255, 255, 255, .82);
  border-bottom-color: var(--v2-line);
  backdrop-filter: blur(14px);
}

.sidebar {
  background: #fbfbfc;
  border-right-color: var(--v2-line);
}

.nav-item {
  border-radius: 9px;
}

.nav-item.active {
  background: var(--v2-primary-soft);
  color: var(--v2-primary-dark);
}

.btn {
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.btn-primary {
  background: var(--v2-primary);
  border-color: var(--v2-primary);
  box-shadow: 0 1px 2px rgba(79, 70, 229, .22);
}

.btn-primary:hover {
  background: var(--v2-primary-dark);
  border-color: var(--v2-primary-dark);
}

.card,
.stat {
  border-color: var(--v2-line);
  border-radius: var(--v2-radius);
  box-shadow: none;
}

.card {
  background: var(--v2-surface);
}

.card h2,
.card-head h2 {
  letter-spacing: -.02em;
}

.tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--v2-line);
  border-radius: 10px;
  background: var(--v2-surface);
}

.tab-link {
  border-radius: 7px;
  padding: 7px 12px;
}

.tab-link.active {
  background: var(--v2-primary-soft);
  color: var(--v2-primary-dark);
}

.project-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin: 2px 0 20px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.hero-title {
  margin: 7px 0 12px;
  color: var(--v2-text);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.12;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--v2-muted);
  font-size: 12px;
  white-space: nowrap;
}

.meta-chip strong {
  color: var(--v2-text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.persona {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--v2-primary-soft);
  color: var(--v2-primary-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.persona.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.persona.xs {
  width: 23px;
  height: 23px;
  font-size: 9px;
}

.persona.more {
  background: #ededf1;
  color: var(--v2-muted);
}

.persona.tone-1 { background: #eef2ff; color: #4338ca; }
.persona.tone-2 { background: #ecfdf3; color: #067647; }
.persona.tone-3 { background: #fff7e6; color: #b54708; }
.persona.tone-4 { background: #fdf2fa; color: #c11574; }
.persona.tone-5 { background: #f0f9ff; color: #026aa2; }

.avatar-stack {
  display: inline-flex;
  align-items: center;
  padding-left: 5px;
}

.avatar-stack .persona + .persona {
  margin-left: -7px;
  box-shadow: 0 0 0 2px #fff;
}

.pulse {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) repeat(4, minmax(112px, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow);
}

.pulse-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 22px;
  border-right: 1px solid var(--v2-line);
  background: linear-gradient(135deg, #fbfbff 0%, #fff 72%);
}

.pulse-label {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.pulse-number {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 3px 0 8px;
}

.pulse-number strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1;
}

.pulse-number small {
  color: var(--v2-muted);
  font-size: 14px;
  font-weight: 600;
}

.pulse-bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf1;
}

.pulse-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.pulse-foot {
  margin-top: 7px;
  color: var(--v2-muted);
  font-size: 11px;
}

.pulse-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 16px 18px;
  border-right: 1px solid var(--v2-line-soft);
}

.pulse-item:last-child {
  border-right: 0;
}

.pulse-item > span {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
}

.pulse-item > strong {
  overflow: hidden;
  color: var(--v2-text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-item > small {
  color: var(--v2-faint);
  font-size: 11px;
}

.pulse-item .is-alert {
  color: var(--v2-red);
}

.pulse-next > strong {
  font-size: 13px;
  letter-spacing: -.01em;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  align-items: start;
  gap: 18px;
}

.work-main,
.work-rail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 13px;
}

.panel-head h2 {
  margin: 0;
  color: var(--v2-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--v2-faint);
  font-size: 11px;
}

.panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 700;
}

.focus-panel {
  border-color: #f2d5cf;
  background: linear-gradient(180deg, #fffdfc 0%, #fff 62%);
}

.focus-list {
  display: grid;
  padding: 0 8px 8px;
}

.focus-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 10px;
  border-radius: 9px;
}

.focus-item + .focus-item {
  border-top: 1px solid var(--v2-line-soft);
  border-radius: 0 0 9px 9px;
}

.focus-item:hover {
  background: #fffafa;
}

.focus-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--v2-amber);
  box-shadow: 0 0 0 3px var(--v2-amber-soft);
}

.focus-dot.is-risk {
  background: #f79009;
  box-shadow: 0 0 0 3px #fffaeb;
}

.focus-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.focus-main a,
.focus-main strong {
  overflow: hidden;
  color: var(--v2-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-main a:hover {
  color: var(--v2-primary-dark);
}

.focus-main small {
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--v2-red-soft);
  color: var(--v2-red);
  font-size: 10px;
  font-weight: 700;
}

.focus-tag.is-risk {
  background: var(--v2-amber-soft);
  color: var(--v2-amber);
}

.focus-empty {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 8px;
  padding: 15px 12px;
  border-radius: 9px;
  background: var(--v2-green-soft);
}

.focus-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d1fadf;
  color: var(--v2-green);
  font-weight: 800;
}

.focus-empty strong,
.focus-empty small {
  display: block;
}

.focus-empty strong {
  font-size: 12px;
}

.focus-empty small {
  margin-top: 2px;
  color: var(--v2-muted);
  font-size: 11px;
}

.panel-more {
  display: block;
  padding: 0 18px 14px;
  color: var(--v2-primary-dark);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.task-panel .panel-head {
  align-items: center;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-task-list {
  display: grid;
  padding: 0 8px 8px;
}

.mini-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.mini-task + .mini-task {
  border-top: 1px solid var(--v2-line-soft);
  border-radius: 0 0 9px 9px;
}

.mini-task:hover {
  background: var(--v2-surface-2);
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4c8d0;
}

.status-dot.is-doing { background: #7f56d9; box-shadow: 0 0 0 3px #f4ebff; }
.status-dot.is-blocked { background: var(--v2-red); box-shadow: 0 0 0 3px var(--v2-red-soft); }
.status-dot.is-done { background: #12b76a; box-shadow: 0 0 0 3px var(--v2-green-soft); }
.status-dot.is-canceled { background: #d0d5dd; }

.mini-task-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.mini-task-main strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-task-main small {
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-task-date {
  flex: 0 0 auto;
  color: var(--v2-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.mini-task-date.is-overdue {
  color: var(--v2-red);
  font-weight: 650;
}

.rail-card .panel-head {
  padding-bottom: 10px;
}

.next-milestone {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 18px 18px;
}

.next-milestone strong {
  font-size: 13px;
}

.next-milestone span {
  color: var(--v2-primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.next-milestone small {
  color: var(--v2-faint);
  font-size: 11px;
}

.member-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.member-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.member-line > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.member-line strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-line small {
  color: var(--v2-faint);
  font-size: 10px;
}

.rail-links {
  display: grid;
  gap: 7px;
  padding: 2px 4px;
}

.rail-links a {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.rail-links a:hover {
  color: var(--v2-primary-dark);
}

.more-panel {
  margin-top: 22px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
}

.more-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.more-panel > summary::-webkit-details-marker {
  display: none;
}

.more-panel > summary strong,
.more-panel > summary small {
  display: block;
}

.more-panel > summary strong {
  font-size: 13px;
}

.more-panel > summary small {
  margin-top: 3px;
  color: var(--v2-muted);
  font-size: 11px;
}

.more-caret {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
}

.more-panel[open] .more-caret {
  color: var(--v2-primary-dark);
}

.more-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--v2-line-soft);
}

.more-body > .tabs {
  margin: 14px 0;
}

.more-body .card {
  box-shadow: none;
}

.portfolio-head {
  margin: 2px 0 18px;
}

.portfolio-head .hero-title {
  margin-bottom: 6px;
}

.portfolio-head p {
  margin: 0;
  font-size: 12px;
}

.portfolio-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow);
}

.portfolio-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border-right: 1px solid var(--v2-line-soft);
}

.portfolio-metric:last-child {
  border-right: 0;
}

.portfolio-metric > span {
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
}

.portfolio-metric > strong {
  color: var(--v2-text);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.portfolio-metric > small {
  color: var(--v2-faint);
  font-size: 10px;
}

.portfolio-metric .is-alert {
  color: var(--v2-red);
}

.toolbar {
  margin-bottom: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 390px));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: 0 1px 2px rgba(20, 21, 26, .04);
}

.project-card:hover {
  border-color: #d9dbe2;
  box-shadow: var(--v2-shadow);
}

.pc-head,
.pc-code,
.pc-health,
.pc-progress-head,
.pc-foot {
  display: flex;
  align-items: center;
}

.pc-head {
  justify-content: space-between;
  gap: 12px;
}

.pc-code {
  gap: 7px;
}

.pc-code .mono {
  color: var(--v2-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.pc-health {
  gap: 6px;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 600;
}

.pc-title {
  margin: 14px 0 5px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.pc-title a {
  color: var(--v2-text);
  text-decoration: none;
}

.pc-title a:hover {
  color: var(--v2-primary-dark);
}

.pc-sub {
  margin: 0;
  color: var(--v2-muted);
  font-size: 11px;
}

.pc-progress {
  margin: 18px 0 15px;
}

.pc-progress-head {
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 600;
}

.pc-progress .progress {
  height: 6px;
  border-radius: 999px;
  background: #ececf1;
}

.pc-progress .progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.pc-facts {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 12px;
  border-radius: 9px;
  background: var(--v2-surface-2);
}

.pc-facts > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.pc-facts span {
  color: var(--v2-faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pc-facts strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-facts small {
  color: var(--v2-muted);
  font-size: 10px;
}

.pc-facts .is-alert {
  color: var(--v2-red);
}

.pc-foot {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--v2-line-soft);
}

.pc-link {
  flex: 0 0 auto;
  color: var(--v2-primary-dark);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.pc-link::after {
  content: " →";
}

@media (max-width: 1000px) {
  .portfolio-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portfolio-metric:nth-child(3) {
    border-right: 0;
  }

  .portfolio-metric:nth-child(n + 4) {
    border-top: 1px solid var(--v2-line-soft);
  }

  .pulse {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, 1fr);
  }

  .pulse-item:nth-child(4) {
    border-right: 0;
  }

  .pulse-item:nth-child(n + 4) {
    border-top: 1px solid var(--v2-line-soft);
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .work-rail {
    grid-template-columns: 1fr 1fr;
  }

  .rail-links {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 20px 16px 48px;
  }

  .project-hero {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions {
    flex-wrap: wrap;
    padding-top: 0;
  }

  .portfolio-strip {
    grid-template-columns: 1fr 1fr;
  }

  .portfolio-metric:nth-child(3) {
    border-right: 1px solid var(--v2-line-soft);
  }

  .portfolio-metric:nth-child(2n) {
    border-right: 0;
  }

  .portfolio-metric:nth-child(n + 3) {
    border-top: 1px solid var(--v2-line-soft);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .pulse {
    grid-template-columns: 1fr 1fr;
  }

  .pulse-main {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--v2-line);
  }

  .pulse-item {
    border-top: 1px solid var(--v2-line-soft);
  }

  .work-rail {
    grid-template-columns: 1fr;
  }
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 16px;
  color: var(--v2-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.page-topbar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -4px 0 16px;
}

.page-topbar .breadcrumbs {
  margin: 0;
}

.back-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border-color: var(--v2-line);
  background: var(--v2-surface);
}

.back-btn:hover {
  background: var(--v2-surface-2);
  border-color: var(--v2-line);
  color: var(--v2-text);
}

.breadcrumbs a {
  color: var(--v2-muted);
  font-weight: 500;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--v2-primary-dark);
}

.crumb-sep {
  color: #c4c8d0;
}

.crumb-current {
  overflow: hidden;
  max-width: 42ch;
  color: var(--v2-text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body {
  font-size: 15px;
  line-height: 1.55;
}

.small {
  font-size: 13px;
}

.nav-item {
  font-size: 14.5px;
}

.app-header-eyebrow {
  font-size: 11px;
}

.app-header-title strong {
  font-size: 15px;
}

.badge {
  padding: 3px 8px;
  font-size: 12px;
}

.tab-link {
  font-size: 14px;
}

.btn-sm {
  font-size: 13.5px;
}

.field > span {
  font-size: 12.5px;
}

.eyebrow {
  font-size: 12px;
}

.meta-chip {
  font-size: 13px;
}

.pulse-label {
  font-size: 12px;
}

.pulse-number strong {
  font-size: 36px;
}

.pulse-number small {
  font-size: 15px;
}

.pulse-foot {
  font-size: 12px;
}

.pulse-item > span {
  font-size: 12px;
}

.pulse-item > strong {
  font-size: 22px;
}

.pulse-item > small {
  font-size: 12px;
}

.pulse-next > strong {
  font-size: 14px;
}

.panel-head h2 {
  font-size: 16px;
}

.panel-head p {
  font-size: 12.5px;
}

.panel-count {
  font-size: 12px;
}

.focus-main a,
.focus-main strong {
  font-size: 14px;
  line-height: 1.4;
}

.focus-main small {
  font-size: 12.5px;
  line-height: 1.45;
}

.focus-tag {
  padding: 3px 8px;
  font-size: 11px;
}

.focus-empty strong {
  font-size: 13.5px;
}

.focus-empty small {
  font-size: 12px;
}

.panel-more {
  font-size: 12.5px;
}

.mini-task {
  padding: 11px 10px;
}

.mini-task-main strong {
  font-size: 14px;
  line-height: 1.4;
}

.mini-task-main small {
  font-size: 12.5px;
  line-height: 1.4;
}

.mini-task-date {
  font-size: 12.5px;
}

.next-milestone strong {
  font-size: 14.5px;
}

.next-milestone span {
  font-size: 13px;
}

.next-milestone small {
  font-size: 12px;
}

.member-line strong {
  font-size: 13.5px;
}

.member-line small {
  font-size: 11.5px;
}

.rail-links a {
  font-size: 12.5px;
}

.more-panel > summary strong {
  font-size: 14.5px;
}

.more-panel > summary small {
  font-size: 12.5px;
}

.more-caret {
  font-size: 12px;
}

.portfolio-head p {
  font-size: 13px;
}

.portfolio-metric > span {
  font-size: 12px;
}

.portfolio-metric > strong {
  font-size: 27px;
}

.portfolio-metric > small {
  font-size: 11.5px;
}

.pc-code .mono {
  font-size: 11px;
}

.pc-health {
  font-size: 11.5px;
}

.pc-title {
  font-size: 20px;
}

.pc-sub {
  font-size: 12.5px;
}

.pc-progress-head {
  font-size: 11.5px;
}

.pc-facts span {
  font-size: 10.5px;
}

.pc-facts strong {
  font-size: 13.5px;
}

.pc-facts small {
  font-size: 11.5px;
}

.pc-link {
  font-size: 12.5px;
}

.drill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin: 2px 0 20px;
}

.drill-head .hero-title {
  margin: 7px 0 12px;
}

.stage-list {
  display: grid;
  padding: 0 8px 8px;
}

.stage-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 110px 44px 18px;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.stage-row + .stage-row {
  border-top: 1px solid var(--v2-line-soft);
}

.stage-row:hover {
  background: var(--v2-surface-2);
}

.stage-index {
  color: var(--v2-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.stage-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.stage-main strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-main small {
  color: var(--v2-muted);
  font-size: 12px;
}

.stage-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf1;
}

.stage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.stage-percent {
  color: var(--v2-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stage-arrow {
  color: var(--v2-faint);
  font-size: 14px;
}

.milestone-section {
  margin-top: 2px;
}

.milestone-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 2px 14px;
}

.milestone-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--v2-primary-soft);
  color: var(--v2-primary);
}

.milestone-section-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.milestone-section-head h2 {
  margin: 0;
  color: var(--v2-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.milestone-section-head p {
  margin: 2px 0 0;
  color: var(--v2-muted);
  font-size: 12.5px;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.milestone-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: visible;
  color: inherit;
  text-decoration: none;
}

.milestone-card:hover {
  border-color: #d9dbe2;
  box-shadow: var(--v2-shadow);
}

.milestone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.milestone-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.milestone-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--v2-primary-soft);
  color: var(--v2-primary-dark);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.milestone-glyph {
  color: var(--v2-primary);
  font-size: 10px;
  vertical-align: middle;
}

.milestone-date {
  color: var(--v2-muted);
  font-size: 12px;
}

.milestone-date.is-alert {
  color: var(--v2-red);
}

.milestone-card h2 {
  margin: 14px 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.25;
}

.milestone-card p {
  margin: 0 0 14px;
  color: var(--v2-muted);
  font-size: 12.5px;
}

.milestone-card .progress {
  height: 6px;
  border-radius: 999px;
  background: #ececf1;
}

.milestone-card .progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.milestone-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.drill-empty {
  padding: 18px;
}

.drill-empty p {
  margin: 0 0 10px;
  color: var(--v2-muted);
  font-size: 13px;
}

.task-drill-list {
  display: grid;
  padding: 0 8px 8px;
}

.task-drill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px 11px calc(10px + var(--depth, 0) * 22px);
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.task-drill-row + .task-drill-row {
  border-top: 1px solid var(--v2-line-soft);
}

.task-drill-row:hover {
  background: var(--v2-surface-2);
}

.task-drill-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.task-drill-main strong {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-drill-main small {
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-drill-date {
  flex: 0 0 auto;
  color: var(--v2-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .drill-head {
    flex-direction: column;
    gap: 10px;
  }

  .stage-row {
    grid-template-columns: 28px minmax(0, 1fr) 72px 18px;
  }

  .stage-percent {
    display: none;
  }

  .milestone-grid {
    grid-template-columns: 1fr;
  }
}

/* Project workspace sidebar */
.project-switcher {
  margin: 0 12px 14px;
  padding: 12px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface-2);
}

.back-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--v2-muted);
  font-size: 12.5px;
  text-decoration: none;
}

.back-all:hover {
  color: var(--v2-ink);
}

.back-all svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.project-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.project-code {
  color: var(--v2-accent);
  font-family: var(--v2-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-identity strong {
  overflow: hidden;
  color: var(--v2-ink);
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-status {
  color: var(--v2-muted);
  font-size: 12px;
}

.project-nav {
  margin-top: 0;
}

/* Stage and milestone management */
.manage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.manage-head h1 {
  margin: 2px 0 4px;
  font-size: 24px;
  line-height: 1.2;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manage-card {
  padding: 18px;
}

.manage-card + .manage-card {
  margin-top: 12px;
}

.manage-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.manage-card-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.manage-card-title h2 {
  margin: 0;
  font-size: 17px;
}

.manage-card-title p {
  margin: 0;
  color: var(--v2-muted);
  font-size: 12.5px;
}

.manage-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.manage-card-body {
  margin-top: 12px;
}

.manage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--v2-muted);
  font-size: 12.5px;
}

.task-board {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: stretch;
}

.task-board-main {
  min-width: 0;
}

.stage-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  border-right: 1px solid var(--v2-line);
  background: var(--v2-surface-2);
}

.stage-rail-label {
  padding: 0 8px 8px;
  color: var(--v2-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stage-rail .seg-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  color: var(--v2-text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.stage-rail .seg-btn:hover {
  background: #eff0f4;
}

.stage-rail .seg-btn.active {
  background: var(--v2-primary-soft);
  border-left-color: var(--v2-primary);
  color: var(--v2-primary-dark);
  font-weight: 700;
}

.stage-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.stage-rail .seg-btn.active .stage-count {
  background: var(--v2-primary);
  color: #fff;
}

.subtask-toggle {
  border: none;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--v2-primary-dark);
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.subtask-toggle:hover {
  background: #e2e8ff;
}

.task-drill-link {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-drill-link:hover {
  color: var(--v2-primary);
}

.task-drill-row[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .task-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-rail {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--v2-line);
  }

  .stage-rail-label {
    display: none;
  }

  .stage-rail .seg-btn {
    width: auto;
    border-left-width: 1px;
  }

  .stage-rail .seg-btn.active {
    border-color: var(--v2-primary);
  }
}

.project-task-list .task-drill-row {
  align-items: center;
}

.project-task-milestone {
  flex: 0 0 auto;
  max-width: 180px;
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .manage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .manage-card-head {
    flex-direction: column;
  }

  .project-task-milestone {
    display: none;
  }
}

.milestone-admin {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--v2-line-soft);
}

.milestone-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-surface-2);
  color: var(--v2-ink);
  font-size: 12.5px;
  text-decoration: none;
}

.milestone-chip:hover {
  border-color: var(--v2-accent);
}

.milestone-chip small {
  color: var(--v2-muted);
  font-size: 11.5px;
}

/* Risk page */
.risk-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--v2-line-soft);
  border-radius: var(--v2-radius);
  background: var(--v2-surface-2);
}

.risk-main {
  min-width: 0;
}

.risk-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.risk-title strong {
  font-size: 14px;
}

.risk-item .manage-card-actions {
  flex: 0 0 auto;
}

/* Weekly updates page */
.update-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.update-list .update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-list article p:last-child {
  margin-bottom: 0;
}

/* Rail add button */
.rail-add {
  margin: 0 0 10px;
}

@media (max-width: 720px) {
  .risk-item {
    flex-direction: column;
  }
}

/* Modal dialog */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 12px;
  box-shadow: 0 24px 60px -18px rgba(16, 24, 40, 0.5);
  background: var(--v2-surface);
  color: var(--v2-ink);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--v2-line-soft);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 18px 20px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.modal .popover-form {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.modal-confirm {
  width: min(420px, calc(100vw - 32px));
}

.confirm-message {
  margin: 0;
  color: var(--v2-text);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-danger {
  border-color: #d92d20;
  background: #d92d20;
  color: #fff;
}

.btn-danger:hover {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.modal-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--v2-line-soft);
}

.modal-danger strong {
  display: block;
  font-size: 13.5px;
  color: var(--v2-text);
}

.modal-danger p {
  margin: 4px 0 0;
}

.form-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  border-color: #fecaca;
}

.form-danger h2 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #b42318;
}

.form-danger p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* Dropdown menu */
.menu-wrap {
  position: relative;
  display: inline-flex;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--v2-line);
  border-radius: 10px;
  background: var(--v2-surface);
  box-shadow: 0 16px 32px -16px rgba(16, 24, 40, 0.35);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--v2-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  opacity: .8;
}

.menu-item:hover {
  background: var(--v2-surface-2);
}

.menu-item.is-danger {
  color: #b42318;
}

.menu-item.is-danger .menu-icon {
  opacity: 1;
}

.menu-item.is-danger:hover {
  background: #fef3f2;
}

/* Confirm dialog option */
.confirm-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--v2-line);
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--v2-text);
}

.confirm-option input {
  margin-top: 2px;
}

/* Read-only task form */
.readonly-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Stage + milestone timeline */
.stage-timeline {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: 0;
  padding: 22px 24px;
  overflow: visible;
  scroll-margin-top: 18px;
}

.stage-timeline + .stage-timeline {
  margin-top: 14px;
}

.stage-timeline-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 26px;
  border-right: 1px solid var(--v2-line-soft);
}

.stage-timeline-kicker {
  color: var(--v2-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stage-timeline-side h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.stage-timeline-meta {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
}

.stage-timeline-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.stage-timeline-meta dt {
  color: var(--v2-muted);
}

.stage-timeline-meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.stage-timeline-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-top: auto;
  padding-top: 8px;
}

.stage-timeline-actions > .menu-wrap > .btn {
  width: 100%;
}

.stage-timeline-actions > .btn,
.stage-timeline-actions > .menu-wrap > .btn {
  justify-content: flex-start;
}

.stage-timeline-actions .stage-add-icon {
  stroke-width: 1.3;
}

.stage-timeline-main {
  min-width: 0;
  padding-left: 28px;
}

.stage-timeline-unfiled .stage-timeline-kicker {
  color: var(--v2-accent);
}

.milestone-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.milestone-timeline::before,
.milestone-timeline::after {
  content: '';
  position: absolute;
  left: 6px;
  width: 3px;
  border-radius: 999px;
}

.milestone-timeline::before {
  top: 12px;
  bottom: 12px;
  background: #e6e8ef;
}

.milestone-timeline::after {
  top: 12px;
  height: var(--rail, 0%);
  max-height: calc(100% - 24px);
  background: linear-gradient(180deg, #6366f1, var(--v2-primary));
}

.milestone-timeline-item {
  position: relative;
  padding-left: 28px;
}

.milestone-timeline-node {
  position: absolute;
  left: 1px;
  top: 16px;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: var(--v2-surface);
}

.milestone-timeline-item.is-achieved .milestone-timeline-node {
  border-color: var(--v2-primary);
  background: var(--v2-primary);
}

.milestone-timeline-item.is-doing .milestone-timeline-node {
  border-color: var(--v2-primary);
}

.milestone-timeline-item.is-overdue .milestone-timeline-node {
  border-color: #f04438;
}

.milestone-timeline-item.is-overdue.is-achieved .milestone-timeline-node {
  background: var(--v2-primary);
  border-color: var(--v2-primary);
}

.milestone-timeline-card {
  display: block;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--v2-line);
  border-radius: 12px;
  background: var(--v2-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.milestone-timeline-card:hover {
  border-color: #d9dbe2;
  box-shadow: var(--v2-shadow);
  text-decoration: none;
}

.milestone-timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.milestone-timeline-seq {
  color: var(--v2-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.milestone-timeline-date {
  margin-left: auto;
  color: var(--v2-muted);
  font-size: 12px;
}

.milestone-timeline-date.is-alert {
  color: #d92d20;
  font-weight: 600;
}

.milestone-timeline-card h3 {
  margin: 7px 0 4px;
  font-size: 15px;
  line-height: 1.35;
}

.milestone-timeline-card p {
  margin: 0;
  color: var(--v2-muted);
  font-size: 12.5px;
}

.milestone-timeline-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
}

.milestone-timeline-pct {
  color: var(--v2-text);
  font-weight: 700;
}

.milestone-timeline-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--v2-primary);
  font-weight: 600;
}

.milestone-timeline-cta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.milestone-timeline-empty {
  padding: 20px 18px;
  border: 1px dashed var(--v2-line);
  border-radius: 10px;
  text-align: center;
}

.milestone-timeline-empty p {
  margin: 0 0 4px;
  color: var(--v2-muted);
}

@media (max-width: 900px) {
  .stage-timeline {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .stage-timeline-side {
    padding-right: 0;
    padding-bottom: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--v2-line-soft);
  }

  .stage-timeline-main {
    padding-left: 0;
  }

  .stage-timeline-actions {
    margin-top: 2px;
  }
}

@media (max-width: 720px) {
  .stage-timeline {
    padding: 18px;
  }
}

.btn-icon,
.icon-btn svg,
.menu-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

.btn-xs .btn-icon {
  width: 14px;
  height: 14px;
}

/* 任务行：优先级/置顶徽标 + 行内操作菜单 */
.task-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-row-meta .badge {
  padding: 1px 6px;
  font-size: 11px;
}

.task-row-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.task-row-menu .menu-trigger {
  width: 26px;
  height: 26px;
  font-size: 17px;
  line-height: 1;
  color: var(--v2-muted);
  border-radius: 7px;
}

.task-row-menu .menu-trigger:hover {
  background: var(--v2-surface-2);
  color: var(--v2-text);
}

.task-row-menu .menu {
  top: calc(100% + 4px);
  min-width: 140px;
}

.task-drill-row .task-row-menu .menu {
  right: 0;
}

/* 优先级：中文等级 + 颜色（P0-P3 代号不直接展示） */
.prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.prio::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.prio-p0 { color: #b42318; }
.prio-p1 { color: #b54708; }
.prio-p2 { color: #1d4ed8; }
.prio-p3 { color: #667085; }

/* 菜单里的表单必须独占一行，否则「置顶」和「删除」会并排 */
.menu form {
  display: block;
  margin: 0;
}

.menu form .menu-item {
  width: 100%;
}

.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--v2-line-soft);
}

.task-row-menu .menu {
  min-width: 158px;
  padding: 5px;
}

.task-row-menu .menu-item {
  gap: 9px;
  padding: 7px 10px;
}

.task-row-menu .menu-item .menu-icon {
  opacity: .75;
}

/* 面板标题右侧的操作区（展开全部等） */
.panel-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* 看板标题右侧的操作区 */
.portfolio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portfolio-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

@media (max-width: 720px) {
  .portfolio-head {
    flex-direction: column;
  }
}
