
      * {
        box-sizing: border-box;
      }
      html,
      body {
        margin: 0;
        height: 100%;
        font-family: Arial, sans-serif;
        background: #f8fafc;
        color: #0f172a;
      }
      .toolbar {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        gap: 8px;
        padding: 9px 12px;
        background: #fff;
        border-bottom: 1px solid #cbd5e1;
      }
      button {
        padding: 7px 10px;
        border: 1px solid #94a3b8;
        border-radius: 6px;
        background: #fff;
        font-weight: 700;
        cursor: pointer;
      }
      #viewport {
        height: calc(100vh - 51px);
        overflow: auto;
      }
      #canvas {
        position: relative;
        width: 3278px;
        min-height: 2475px;
        background: white;
      }
      #edges {
        position: absolute;
        inset: 0;
        width: 3278px;
        height: 2475px;
        z-index: 2;
        pointer-events: none;
        overflow: visible;
      }
      .card {
        position: absolute;
        z-index: 5;
        background: white;
        border: 1.4px solid #94a3b8;
        border-radius: 7px;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
      }
      .card-title {
        height: 38px;
        color: white;
        font-weight: 700;
        font-size: 14px;
        padding: 10px 12px;
      }
      .tasks-head {
        height: 30px;
        background: #f8fafc;
        border-top: 1px solid #cbd5e1;
        border-bottom: 1px solid #cbd5e1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        font-weight: 700;
        cursor: pointer;
      }
      .tasks-head em {
        font-style: normal;
        color: #64748b;
      }
      .task-row {
        min-height: 34px;
        display: grid;
        grid-template-columns: 12px 1fr auto;
        gap: 8px;
        align-items: start;
        padding: 8px 10px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 11px;
      }
      .rag {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin-top: 3px;
      }
      .task-name {
        line-height: 1.3;
      }
      .date {
        color: #64748b;
        white-space: nowrap;
        font-size: 10px;
      }
      .inline-dep {
        display: grid;
        grid-template-columns: 16px 1fr;
        gap: 5px;
        padding: 5px 12px 5px 30px;
        background: #fff7f7;
        border-bottom: 1px solid #fecaca;
        color: #7f1d1d;
        font-size: 10px;
        line-height: 1.35;
      }
      .inline-dep .hook {
        font-weight: 700;
        color: #dc2626;
      }
      .dep-copy {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }
      .dep-status {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex: 0 0 auto;
      }
      .dep-code {
        font-weight: 700;
        color: #991b1b;
      }
      .card.collapsed .task-body {
        display: none;
      }
      .card.collapsed .chev {
        transform: rotate(-90deg);
      }
      .chev {
        display: inline-block;
      }
      .inline-dep,
      .task-row {
        position: relative;
      }
      .dep-anchor,
      .task-anchor {
        position: absolute;
        width: 1px;
        height: 1px;
        pointer-events: none;
      }
      .dep-anchor {
        right: -1px;
        top: 50%;
      }
      .task-anchor {
        left: -1px;
        top: 50%;
      }

      .dep-date {
        color: #64748b;
        font-size: 10px;
        font-style: italic;
      }
      .task-row {
        cursor: pointer;
      }

      .task-row {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start !important;
        text-align: left !important;
      }
      .task-name {
        text-align: left !important;
        flex: 1;
      }

      .task-row {
        text-align: left !important;
      }
      .task-name {
        text-align: left !important;
      }

      /* Dependency toggle component */
      .task-row {
        text-align: left !important;
      }
      .task-name {
        flex: 1;
        text-align: left !important;
      }
      .task-dependencies {
        display: block;
        margin-left: 20px;
      }
      .task-dependencies[hidden] {
        display: none !important;
      }
      .dep-toggle {
        appearance: none;
        border: 0;
        background: transparent;
        color: inherit;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 16px;
        width: 16px;
        min-width: 16px;
        margin-right: 6px;
        padding: 0;
        font: inherit;
        font-weight: 700;
        line-height: 1.2;
        user-select: none;
      }
      .dep-toggle:hover {
        opacity: 0.75;
      }
      .dep-toggle:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
      }

      /* Place dependency toggle after the task date */
      .task-row .date + .dep-toggle {
        margin-left: 6px;
        margin-right: 0;
      }

      /* Highest dependency date shown after the task date */
      .highest-dependency-date {
        margin-left: 6px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
      }
      .dep-date-ok {
        color: #2563eb;
      }
      .dep-date-late {
        color: #dc2626;
      }
      .highest-dependency-date + .dep-toggle {
        margin-left: 6px;
      }

      .latest-task-date {
        float: right;
        margin-right: 6px;
        color: #475569;
        font-size: 10px;
        font-weight: 700;
      }

      /* Tasks header layout: toggle at far left */
      .tasks-head {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
      }

      .tasks-head .chev {
        order: 0;
        flex: 0 0 auto;
        margin: 0;
      }

      .tasks-head > span:not(.chev):not(.latest-task-date) {
        order: 1;
      }

      .tasks-head .latest-task-date {
        order: 2;
        margin-left: auto;
        margin-right: 0;
        float: none;
      }

      .toolbar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
      }
      .legend-section {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .legend-title {
        font-weight: 700;
        font-size: 13px;
        color: #334155;
      }
      .legend-row {
        display: flex;
        flex-wrap: wrap;
        gap: 18px;
        align-items: center;
        padding: 8px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        background: #fff;
      }
      .toolbar-buttons {
        display: flex;
        gap: 8px;
      }

      /* Card width override */
      .card {
        width: 420px !important;
      }

      /* Align dependency arrow underneath the task risk indicator */
      .inline-dep {
        display: grid;
        grid-template-columns: 12px 1fr;
        gap: 8px;
        padding: 5px 10px;
        background: #fff7f7;
        border-bottom: 1px solid #fecaca;
        color: #7f1d1d;
        font-size: 10px;
        line-height: 1.35;
      }

      .inline-dep .hook {
        grid-column: 1;
        justify-self: center;
        align-self: start;
        font-weight: 700;
        color: #dc2626;
      }

      .inline-dep .dep-copy {
        grid-column: 2;
        min-width: 0;
      }

      /* Correct dependency alignment:
   remove the container indent so the arrow aligns with the task risk dot */
      .task-dependencies {
        margin-left: 0 !important;
      }

      .inline-dep {
        grid-template-columns: 12px 1fr !important;
        column-gap: 8px !important;
        padding: 5px 10px !important;
      }

      .inline-dep .hook {
        grid-column: 1 !important;
        justify-self: center !important;
        margin: 0 !important;
      }

      .inline-dep .dep-copy {
        grid-column: 2 !important;
      }

      /* Interactive filters */
      .toolbar {
        align-items: stretch !important;
      }
      .filters-panel {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .filter-section {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .filter-title {
        font-size: 13px;
        font-weight: 700;
        color: #334155;
      }
      .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
      }
      .filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 8px;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        font-size: 12px;
        font-weight: 600;
      }
      .filter-chip.active {
        border-color: #64748b;
        box-shadow: inset 0 0 0 1px #64748b;
      }
      .filter-chip:not(.active) {
        opacity: 0.38;
      }
      .risk-dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        flex: 0 0 auto;
      }
      .status-block {
        width: 16px;
        height: 11px;
        border: 1px solid #bfdbfe;
        flex: 0 0 auto;
      }
      .filter-options {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
      }
      .option-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 600;
        color: #334155;
      }
      .task-row.filter-muted,
      .task-dependencies.filter-muted {
        opacity: 0.18;
      }
      .card.filter-muted {
        opacity: 0.28;
      }
      .card.filter-muted .card-title,
      .card.filter-muted .tasks-head {
        opacity: 0.72;
      }
      .task-row.filter-related {
        opacity: 0.55;
      }

      /* Embedded card explanation panel */
      .card-explanation-panel {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 1000;
        width: min(560px, calc(100vw - 28px));
        max-height: calc(100vh - 28px);
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border: 1px solid #94a3b8;
        border-radius: 10px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.2);
        overflow: hidden;
      }

      .card-explanation-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 12px;
        background: #f8fafc;
        border-bottom: 1px solid #cbd5e1;
        font-size: 13px;
        font-weight: 700;
        color: #0f172a;
      }

      .card-explanation-toggle {
        width: 26px;
        height: 26px;
        min-width: 26px;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 21px;
        line-height: 1;
      }

      .card-explanation-image {
        display: block;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 110px);
        object-fit: contain;
        background: white;
      }

      .card-explanation-download {
        display: block;
        padding: 8px 12px;
        border-top: 1px solid #e2e8f0;
        background: #ffffff;
        color: #2563eb;
        font-size: 12px;
        font-weight: 700;
        text-decoration: none;
      }

      .card-explanation-download:hover {
        text-decoration: underline;
      }

      .card-explanation-panel.collapsed {
        width: auto;
      }

      .card-explanation-panel.collapsed .card-explanation-image,
      .card-explanation-panel.collapsed .card-explanation-download {
        display: none;
      }

      .card-explanation-panel.collapsed .card-explanation-toggle {
        transform: rotate(45deg);
      }

      /* Increase explanation panel to ~200% of original */
      .card-explanation-panel {
        width: min(1120px, calc(100vw - 28px)) !important;
      }
      .card-explanation-image {
        max-height: calc(100vh - 60px) !important;
      }

      /* Make the download button 300px wide */
      .card-explanation-download {
        width: 300px !important;
        align-self: center;
        text-align: center;
        box-sizing: border-box;
      }

      /* Compact collapsed explanation panel */
      .card-explanation-panel.collapsed {
        width: 260px !important;
        max-width: 260px !important;
      }

      .dataset-updated {
        margin-top: 8px;
        font-size: 12px;
        font-weight: 600;
        color: #475569;
      }

      /* Reduce card width when collapsed */
      .card.collapsed {
        width: 250px !important;
        transition: width 0.2s ease;
      }
      .card {
        transition: width 0.2s ease;
      }

      #canvas {
        padding-top: 0 !important;
        margin-top: 0 !important;
      }

      /* Subtle ClickUp task links */
      .task-link {
        color: inherit;
        text-decoration: none;
        text-underline-offset: 3px;
        text-decoration-thickness: 1px;
        cursor: pointer;
      }
      .task-link:hover,
      .task-link:focus-visible {
        text-decoration: underline;
      }
      .task-link:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
        border-radius: 2px;
      }

      .filter-chip {
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
      }
      .filter-chip.active {
        border-color: #d1d5db !important;
        box-shadow: none !important;
      }
      .legend-row {
        border: 1px solid #e5e7eb !important;
      }

      /* Tasks inside each card are grouped in this order:
   Backlog, Needs discussion, Planned, In progress, UAT, Done, Blocked */

      /* Complete ClickUp task status palette */
      .task-status-group.status-intake .task-status-header {
        border-left: 3px solid #b7791f !important;
      }
      .task-status-group.status-parked .task-status-header {
        border-left: 3px solid #ec4899 !important;
      }
      .task-status-group.status-needs-discussion .task-status-header {
        border-left: 3px solid #0ea5a6 !important;
      }
      .task-status-group.status-needs-estimate .task-status-header {
        border-left: 3px solid #ea580c !important;
      }
      .task-status-group.status-backlog .task-status-header {
        border-left: 3px solid #64748b !important;
      }
      .task-status-group.status-planned .task-status-header {
        border-left: 3px solid #64748b !important;
      }
      .task-status-group.status-in-progress .task-status-header {
        border-left: 3px solid #1684d8 !important;
      }
      .task-status-group.status-review .task-status-header {
        border-left: 3px solid #5b4cf0 !important;
      }
      .task-status-group.status-uat .task-status-header {
        border-left: 3px solid #e99a00 !important;
      }
      .task-status-group.status-blocked .task-status-header {
        border-left: 3px solid #dc2626 !important;
      }
      .task-status-group.status-done .task-status-header {
        border-left: 3px solid #65c33d !important;
      }
      .task-status-group.status-rejected .task-status-header {
        border-left: 3px solid #dc2626 !important;
      }
      .task-status-group.status-cancelled .task-status-header {
        border-left: 3px solid #d9363e !important;
      }
      .task-status-group.status-closed .task-status-header {
        border-left: 3px solid #0a8f47 !important;
      }

      .status-block {
        border-width: 1px !important;
        border-style: solid !important;
      }

      .project-target-date {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 2px;
        font-size: 12px;
        font-weight: 700;
        color: #334155;
      }
      .project-target-date input {
        padding: 5px 8px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        background: #fff;
        color: #0f172a;
        font: inherit;
      }
      .card-title {
        height: auto !important;
        min-height: 58px;
        padding: 8px 12px !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        transition: background-color 0.18s ease;
      }
      .card-title-top,
      .card-title-bottom {
        display: flex;
        align-items: center;
      }
      .card-title-top {
        justify-content: space-between;
        gap: 10px;
      }
      .card-title-name {
        min-width: 0;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
      }
      .card-title-bottom {
        justify-content: flex-start;
        gap: 4px;
        font-size: 10px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.92);
      }
      .card-overall-risk {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex: 0 0 auto;
        padding: 3px 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.16);
        font-size: 9px;
        line-height: 1;
        letter-spacing: 0.04em;
      }
      .card-risk-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #9ca3af;
      }
      .card-overall-risk[data-risk="high"] .card-risk-dot {
        background: #fee2e2;
      }
      .card-overall-risk[data-risk="medium"] .card-risk-dot {
        background: #fde68a;
      }
      .card-overall-risk[data-risk="low"] .card-risk-dot {
        background: #bbf7d0;
      }
      .card-overall-risk[data-risk="not-set"] .card-risk-dot {
        background: #e5e7eb;
      }
      .card-schedule-value {
        padding: 2px 5px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.15);
      }
      .schedule-on-track {
        color: #ecfdf5;
      }
      .schedule-at-risk {
        color: #fef3c7;
      }
      .schedule-overdue {
        color: #fee2e2;
      }
      .schedule-not-set {
        color: #e5e7eb;
      }
      .card[data-overall-status="design"] .card-title {
        background: #0ea5a6 !important;
      }
      .card[data-overall-status="backlog"] .card-title {
        background: #64748b !important;
      }
      .card[data-overall-status="planned"] .card-title {
        background: #7c8798 !important;
      }
      .card[data-overall-status="in-progress"] .card-title {
        background: #1684d8 !important;
      }
      .card[data-overall-status="uat"] .card-title {
        background: #e99a00 !important;
      }
      .card[data-overall-status="blocked"] .card-title {
        background: #dc2626 !important;
      }
      .card[data-overall-status="done"] .card-title {
        background: #65c33d !important;
      }

      /* Refined card header indicators */
      .card-title-bottom {
        justify-content: flex-end !important;
        gap: 6px !important;
      }

      .card-schedule-label {
        color: rgba(255, 255, 255, 0.92) !important;
      }

      .card-schedule-value {
        min-width: 58px;
        text-align: center;
        padding: 3px 7px !important;
        border-radius: 999px !important;
        color: #fff !important;
        font-weight: 700 !important;
        background: #6b7280 !important;
      }

      .card-schedule-value.schedule-on-track {
        background: #16a34a !important;
        color: #fff !important;
      }

      .card-schedule-value.schedule-at-risk {
        background: #dc2626 !important;
        color: #fff !important;
      }

      .card-schedule-value.schedule-overdue {
        background: #eab308 !important;
        color: #1f2937 !important;
      }

      .card-schedule-value.schedule-not-set {
        background: #6b7280 !important;
        color: #fff !important;
      }

      .card-overall-risk {
        padding: 4px 8px !important;
        background: rgba(255, 255, 255, 0.18) !important;
        border: 1px solid rgba(255, 255, 255, 0.34);
        font-size: 9px !important;
        font-weight: 700 !important;
      }

      .card-risk-dot {
        width: 9px !important;
        height: 9px !important;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
      }

      .card-overall-risk[data-risk="high"] {
        background: #dc2626 !important;
        color: #fff !important;
      }
      .card-overall-risk[data-risk="high"] .card-risk-dot {
        background: #fee2e2 !important;
      }

      .card-overall-risk[data-risk="medium"] {
        background: #eab308 !important;
        color: #1f2937 !important;
      }
      .card-overall-risk[data-risk="medium"] .card-risk-dot {
        background: #fef3c7 !important;
      }

      .card-overall-risk[data-risk="low"] {
        background: #16a34a !important;
        color: #fff !important;
      }
      .card-overall-risk[data-risk="low"] .card-risk-dot {
        background: #dcfce7 !important;
      }

      .card-overall-risk[data-risk="not-set"] {
        background: #6b7280 !important;
        color: #fff !important;
      }
      .card-overall-risk[data-risk="not-set"] .card-risk-dot {
        background: #e5e7eb !important;
      }

      /* Schedule badges: subtle outline like risk indicator */
      .card-schedule-value {
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
      }

      .card-schedule-value.schedule-on-track {
        border-color: rgba(220, 252, 231, 0.75) !important;
      }

      .card-schedule-value.schedule-at-risk {
        border-color: rgba(254, 226, 226, 0.75) !important;
      }

      .card-schedule-value.schedule-overdue {
        border-color: rgba(254, 243, 199, 0.85) !important;
      }

      .card-schedule-value.schedule-not-set {
        border-color: rgba(229, 231, 235, 0.75) !important;
      }

      .card-risk-label {
        font-weight: 700;
        margin-right: 4px;
        opacity: 0.95;
      }

      .card-title-top {
        gap: 6px;
      }
      .card-risk-prefix {
        margin-left: auto;
        font-size: 10px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.92);
      }
      .card-overall-risk {
        margin-left: 0 !important;
      }

      /* Card relations layer */
      #cardRelationsSvg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 3;
        pointer-events: none;
        overflow: visible;
        display: none;
      }
      #cardRelationsSvg.visible {
        display: block;
      }
      .card-relation-path {
        fill: none;
        stroke: #334155;
        stroke-width: 2;
        vector-effect: non-scaling-stroke;
      }
      .card-relation-path.type-dependency {
        stroke-dasharray: 7 5;
      }
      .card-relation-path.type-supporting {
        stroke: #64748b;
        stroke-width: 1.5;
        stroke-dasharray: 2 5;
      }
      .card-relation-path.type-data {
        stroke: #2563eb;
        stroke-dasharray: 8 4;
      }
      .card-relation-label {
        font-family: Arial, sans-serif;
        font-size: 10px;
        fill: #334155;
        paint-order: stroke;
        stroke: #fff;
        stroke-width: 3px;
        stroke-linejoin: round;
      }
      .card-relations-status {
        min-height: 14px;
        font-size: 11px;
        color: #64748b;
      }
      .card-relations-status.error {
        color: #b91c1c;
        font-weight: 700;
      }

      /* Card relation mode: compact collapsed layout */
      .card-relations-status {
        margin-top: 2px;
      }
      #cardRelationsSvg {
        z-index: 4 !important;
      }
      .card {
        z-index: 5;
      }

      /* v20: Cancelled tasks use the same visual style as Blocked tasks.
   The only difference is that the task title/link is struck through. */
      .task-row[data-status="cancelled"] {
        background: #fee2e2 !important;
        color: #0f172a !important;
        opacity: 1 !important;
        filter: none !important;
      }

      .task-row[data-status="cancelled"] * {
        opacity: 1 !important;
        filter: none !important;
      }

      .task-row[data-status="cancelled"] .rag {
        background: #dc2626 !important;
      }

      .task-row[data-status="cancelled"] .task-name,
      .task-row[data-status="cancelled"] .task-link {
        color: #0f172a !important;
        text-decoration: line-through !important;
        font-weight: inherit !important;
      }

      .task-row[data-status="cancelled"] .date {
        color: #64748b !important;
        text-decoration: none !important;
        font-weight: inherit !important;
      }

      /* v21: recursive capability dependency date and hover explanation */
      .latest-task-date {
        white-space: nowrap;
      }

      .latest-task-date .dependency-critical-date {
        color: #dc2626;
        font-weight: 700;
        margin-left: 4px;
        cursor: help;
      }

      .capability-dependency-tooltip {
        position: fixed;
        z-index: 100000;
        display: none;
        max-width: 420px;
        padding: 12px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
        font-size: 13px;
        line-height: 1.45;
        pointer-events: none;
      }

      .capability-dependency-tooltip.visible {
        display: block;
      }

      .capability-dependency-tooltip strong {
        display: block;
        margin-bottom: 6px;
        font-size: 14px;
      }

      .capability-dependency-tooltip .tooltip-date {
        color: #dc2626;
        font-weight: 700;
      }

      .capability-dependency-tooltip .tooltip-path {
        margin-top: 8px;
        color: #334155;
      }

      .capability-dependency-tooltip .tooltip-path span {
        display: block;
      }

      .card[data-critical-dependency="true"] .latest-task-date {
        cursor: help;
      }

      /* v22: dependency date is derived from actual task dependencies, not card arrows */
      .latest-task-date .dependency-critical-date {
        pointer-events: auto !important;
        position: relative;
        z-index: 5;
        color: #dc2626 !important;
        font-weight: 700 !important;
        cursor: help !important;
      }

      .capability-dependency-tooltip {
        z-index: 2147483647 !important;
        pointer-events: none !important;
      }

      .capability-dependency-tooltip .tooltip-task {
        margin-top: 7px;
        padding-top: 7px;
        border-top: 1px solid #e2e8f0;
      }

      .capability-dependency-tooltip .tooltip-arrow {
        color: #64748b;
        font-weight: 700;
      }

      /* v23: capability-date hover based only on underlying card relations (type: links) */
      .latest-task-date .dependency-critical-date {
        pointer-events: auto !important;
        position: relative;
        z-index: 10;
        color: #dc2626 !important;
        font-weight: 700 !important;
        cursor: help !important;
      }

      .capability-dependency-tooltip {
        position: fixed;
        z-index: 2147483647 !important;
        display: none;
        max-width: 430px;
        padding: 12px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
        font-size: 13px;
        line-height: 1.45;
        pointer-events: none !important;
      }

      .capability-dependency-tooltip.visible {
        display: block;
      }

      .capability-dependency-tooltip strong {
        display: block;
        margin-bottom: 6px;
        font-size: 14px;
      }

      .capability-dependency-tooltip .tooltip-date {
        color: #dc2626;
        font-weight: 700;
      }

      .capability-dependency-tooltip .tooltip-path {
        margin-top: 9px;
        padding-top: 8px;
        border-top: 1px solid #e2e8f0;
      }

      .capability-dependency-tooltip .tooltip-path-step {
        margin-top: 5px;
      }

      .capability-dependency-tooltip .tooltip-arrow {
        color: #64748b;
        font-weight: 700;
      }

      /* v43: clearer dependency-date source hover. */
      .capability-dependency-tooltip {
        pointer-events: auto !important;
      }

      .capability-dependency-tooltip .tooltip-heading {
        display: block;
        margin-bottom: 10px;
        font-size: 16px;
        font-weight: 800;
        color: #1e293b;
      }

      .capability-dependency-tooltip .tooltip-summary {
        line-height: 1.55;
      }

      .capability-dependency-tooltip .tooltip-section-title {
        display: block;
        margin-bottom: 7px;
        font-size: 14px;
        font-weight: 800;
        color: #334155;
      }

      .capability-dependency-tooltip .tooltip-source-task {
        margin-top: 3px;
      }

      .capability-dependency-tooltip .tooltip-source-task a {
        color: #334155;
        text-decoration: none;
        text-underline-offset: 3px;
      }

      .capability-dependency-tooltip .tooltip-source-task a:hover,
      .capability-dependency-tooltip .tooltip-source-task a:focus-visible {
        color: #2563eb;
        text-decoration: underline;
      }

      .capability-dependency-tooltip .tooltip-reason {
        margin-top: 9px;
        color: #475569;
      }

      /* v24: schedule indicator also considers the effective dependency date */
      .card-schedule-value.schedule-at-risk {
        cursor: help;
      }

      /* v25: subtle overall card status in the lower-left of the header */
      .card-title-bottom {
        gap: 7px;
      }

      .card-status-indicator {
        margin-right: auto;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
        font-size: 10px;
        line-height: 1;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: rgba(255, 255, 255, 0.92);
        opacity: 0.88;
        white-space: nowrap;
      }

      .card-status-indicator::before {
        content: "";
        width: 6px;
        height: 6px;
        flex: 0 0 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
      }

      .card-status-indicator[data-status="blocked"] {
        cursor: help;
        opacity: 1;
      }

      .card-status-indicator[data-status="blocked"]::before {
        background: #ffffff;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
      }

      .card-status-indicator[data-status="done"]::before {
        background: #dcfce7;
      }
      .card-status-indicator[data-status="uat"]::before {
        background: #fef3c7;
      }
      .card-status-indicator[data-status="in-progress"]::before {
        background: #dbeafe;
      }
      .card-status-indicator[data-status="planned"]::before {
        background: #e2e8f0;
      }
      .card-status-indicator[data-status="backlog"]::before {
        background: #cbd5e1;
      }
      .card-status-indicator[data-status="design"]::before {
        background: #ccfbf1;
      }

      .card-blocked-tooltip {
        position: fixed;
        z-index: 2147483647;
        display: none;
        width: min(430px, calc(100vw - 24px));
        padding: 12px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
        font-size: 13px;
        line-height: 1.45;
        pointer-events: none;
      }

      .card-blocked-tooltip.visible {
        display: block;
      }

      .card-blocked-tooltip strong {
        display: block;
        margin-bottom: 7px;
        font-size: 14px;
      }

      .card-blocked-tooltip .blocked-task {
        padding: 8px 0;
        border-top: 1px solid #e2e8f0;
      }

      .card-blocked-tooltip .blocked-task:first-of-type {
        border-top: 0;
        padding-top: 2px;
      }

      .card-blocked-tooltip .blocked-task-name {
        color: #b91c1c;
        font-weight: 700;
      }

      .card-blocked-tooltip .blocked-dependency {
        margin-top: 5px;
        padding-left: 12px;
        color: #334155;
      }

      .card-blocked-tooltip .blocked-dependency::before {
        content: "↳ ";
        color: #dc2626;
        font-weight: 700;
      }

      .toolbar {
        position: relative !important;
      }
      .view-title {
        position: absolute;
        left: 50%;
        top: 18px;
        transform: translateX(-50%);
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        letter-spacing: 0.02em;
        pointer-events: none;
        z-index: 200;
      }

      /* =========================================================
   Refactored shared component rules
   ========================================================= */
      .toolbar {
        position: sticky !important;
        top: 0;
        z-index: 100;
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #cbd5e1;
      }

      .view-title {
        position: absolute;
        top: 14px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        letter-spacing: 0.02em;
        pointer-events: none;
      }

      .task-row {
        position: relative;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start !important;
        min-height: 34px;
        gap: 8px;
        padding: 8px 10px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 11px;
        text-align: left !important;
        cursor: pointer;
      }

      .task-name {
        flex: 1;
        min-width: 0;
        line-height: 1.3;
        text-align: left !important;
      }

      .task-status-group {
        border-bottom: 1px solid #e2e8f0;
      }

      .task-status-header {
        min-height: 30px;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0 10px !important;
        background: #475569 !important;
        color: #f8fafc !important;
        border-top: 1px solid #334155 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em !important;
      }

      .task-status-label {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex: 0 0 auto !important;
      }

      .task-status-title {
        margin: 0 !important;
        color: #f8fafc !important;
      }

      .task-status-toggle {
        position: static !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 16px !important;
        min-width: 16px !important;
        height: 16px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0;
        background: transparent;
        color: #cbd5e1 !important;
        font-size: 11px !important;
        line-height: 1 !important;
        transform: rotate(0deg) !important;
        transition: transform 0.15s ease;
      }

      .task-status-toggle:hover {
        color: #fff !important;
        background: #64748b !important;
      }

      .task-status-group.collapsed .task-status-content {
        display: none;
      }

      .task-status-group.collapsed .task-status-toggle {
        transform: rotate(-90deg) !important;
      }

      .card-explanation-panel {
        width: min(1120px, calc(100vw - 28px)) !important;
      }

      .card-explanation-image {
        max-height: calc(100vh - 60px) !important;
      }
    
      /* Capability Dashboard view */
      #capabilityDashboardView {
        position: absolute; inset: 0; display: none; width: 3000px; min-width: 3000px;
        height: 2100px; min-height: 2100px; background: #f8fafc; z-index: 20; padding: 24px;
      }
      #capabilityDashboardView.active { display: block; }
      body.capability-dashboard-mode #canvas > .card,
      body.capability-dashboard-mode #cardRelationsSvg { visibility: hidden !important; pointer-events: none !important; display: none !important; }
      .capdash-header { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; padding:18px 22px; background:#fff; border:1px solid #cbd5e1; border-radius:12px; }
      .capdash-header h1 { margin:0 0 6px; font-size:26px; color:#0f172a; }
      .capdash-header p { margin:0; color:#64748b; font-size:14px; }
      .capdash-arrow-rule { padding:10px 14px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; font-size:13px; color:#1e3a8a; }
      .capdash-grid { margin-top:18px; display:grid; grid-template-columns: 240px 1fr 1fr 1fr 350px; grid-template-rows:auto auto; gap:14px; align-items:stretch; }
      .capdash-repository-panel { grid-column:1; grid-row:1 / span 2; }
      .capdash-foundation { grid-column:2 / span 3; grid-row:1; }
      .capdash-view-workshop { grid-column:2; grid-row:2; }
      .capdash-view-campaign { grid-column:3; grid-row:2; }
      .capdash-view-frontend { grid-column:4; grid-row:2; }
      .capdash-side { grid-column:5; grid-row:1 / span 2; }
      .capdash-panel { position:relative; background:#fff; border:1px solid #cbd5e1; border-radius:12px; overflow:hidden; min-height:1240px; }
      .capdash-panel-title { padding:12px 14px; text-align:center; font-weight:700; font-size:14px; border-bottom:1px solid #cbd5e1; background:#eff6ff; color:#1e3a8a; }
      .capdash-panel-title.campaign { background:#f0fdf4; color:#166534; }
      .capdash-panel-title.frontend { background:#faf5ff; color:#6b21a8; }
      .capdash-repository { padding:12px; }
      .capdash-repository h3 { margin:0 0 8px; font-size:13px; color:#334155; }
      .capdash-repo-item { padding:8px 9px; border-bottom:1px solid #e2e8f0; font-size:12px; font-weight:600; }
      .capdash-canvas { position:relative; height:1180px; }
      .capdash-canvas svg { position:absolute; inset:0; width:100%; height:100%; z-index:1; overflow:visible; }
      .capdash-node { position:absolute; width:220px; min-height:154px; z-index:2; background:#fff; border:1px solid #94a3b8; border-radius:9px; box-shadow:0 2px 5px rgba(15,23,42,.10); overflow:visible; }
      .capdash-node .node-head { padding:9px 10px 8px; border-bottom:1px solid #e2e8f0; background:#f8fafc; border-radius:8px 8px 0 0; }
      .capdash-node .name { font-size:12px; font-weight:750; color:#0f172a; line-height:1.25; }
      .capdash-node .status-line { margin-top:5px; display:flex; align-items:center; gap:5px; font-size:10px; color:#475569; }
      .capdash-node .status-pill { display:inline-flex; align-items:center; gap:4px; padding:2px 6px; border-radius:999px; background:#e2e8f0; font-weight:700; text-transform:capitalize; }
      .capdash-node .dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex:0 0 auto; }
      .capdash-node .risk-high { background:#dc2626; } .capdash-node .risk-medium { background:#f59e0b; } .capdash-node .risk-low { background:#16a34a; } .capdash-node .risk-not-set { background:#9ca3af; }
      .capdash-node .node-health { display:grid; grid-template-columns:1fr 1fr; gap:5px 8px; padding:7px 10px; border-bottom:1px solid #e2e8f0; font-size:9.5px; }
      .capdash-node .node-health span { color:#64748b; }
      .capdash-node .node-health strong { display:block; margin-top:1px; color:#0f172a; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .capdash-node .schedule-at-risk-text, .capdash-node .schedule-overdue-text { color:#b91c1c !important; }
      .capdash-node .schedule-on-track-text { color:#15803d !important; }
      .capdash-node .dependency-late { color:#b91c1c !important; }
      .capdash-node .capdash-dependency-date {
        display: inline-block;
        cursor: help;
        text-decoration: underline dotted;
        text-underline-offset: 3px;
      }
      .capdash-node .capdash-dependency-date:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
        border-radius: 2px;
      }
      .capdash-node .node-impact { display:flex; justify-content:space-between; align-items:center; padding:6px 10px; font-size:9.5px; color:#475569; }
      .capdash-node .impact-counts { display:flex; gap:10px; font-weight:700; }
      .capdash-node .view-badges { display:flex; gap:3px; }
      .capdash-node .view-badge { width:17px; height:17px; border-radius:4px; display:grid; place-items:center; border:1px solid #cbd5e1; background:#f8fafc; color:#94a3b8; font-size:8px; font-weight:800; }
      .capdash-node .view-badge.active { background:#dbeafe; border-color:#93c5fd; color:#1d4ed8; }
      .capdash-node.goal { box-shadow:0 0 0 2px #2563eb inset, 0 2px 5px rgba(15,23,42,.10); }
      .capdash-node.goal::after { content:'GOAL'; position:absolute; top:6px; right:7px; font-size:8px; font-weight:800; color:#1d4ed8; background:#dbeafe; padding:2px 5px; border-radius:999px; }
      .capdash-foundation { background:#fffbeb; border:1px solid #fde68a; border-radius:12px; padding:12px; min-height:180px; }
      .capdash-foundation-title { text-align:center; font-size:13px; font-weight:700; color:#92400e; margin-bottom:10px; }
      .capdash-foundation-row { display:flex; justify-content:center; gap:14px; flex-wrap:wrap; }
      .capdash-foundation .capdash-node { position:relative; left:auto!important; top:auto!important; width:220px; }
      .capdash-side { padding:12px; }
      .capdash-health { text-align:center; padding:16px; border:1px solid #fed7aa; background:#fff7ed; border-radius:10px; }
      .capdash-health .score { font-size:42px; font-weight:700; color:#c2410c; }
      .capdash-kpi { margin-top:12px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
      .capdash-kpi div { padding:10px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; font-size:11px; }
      .capdash-kpi strong { display:block; font-size:20px; margin-top:3px; }
      .capdash-kpi .capdash-kpi-wide { grid-column:1 / -1; }
      .capdash-data-source { margin-top:12px; padding-top:10px; border-top:1px solid #e2e8f0; color:#64748b; font-size:11px; text-align:center; }
      .capdash-critical { margin-top:14px; }
      .capdash-critical h3 { font-size:13px; margin:0 0 8px; }
      .capdash-critical-item { padding:7px 8px; border:1px solid #e2e8f0; border-radius:7px; margin-bottom:5px; font-size:11px; font-weight:600; }
      .capdash-legend { margin-top:14px; font-size:11px; color:#475569; line-height:1.7; }
      .capdash-footer { margin-top:14px; display:grid; grid-template-columns:repeat(6,1fr); gap:10px; }
      .capdash-footer .metric { background:#fff; border:1px solid #cbd5e1; border-radius:10px; padding:12px; text-align:center; font-size:11px; }
      .capdash-footer .metric strong { display:block; font-size:22px; margin-top:4px; }
      .capdash-edge { fill:none; stroke:#334155; stroke-width:1.8; vector-effect:non-scaling-stroke; }
      .capdash-edge.support { stroke:#2563eb; stroke-dasharray:6 5; }
      .capdash-edge.uncertain { stroke:#64748b; stroke-dasharray:2 5; }
      .capdash-edge.links { stroke:#64748b; stroke-width:1.2; }
      body.capability-dashboard-mode #collapseAllBtn, body.capability-dashboard-mode #expandAllBtn, body.capability-dashboard-mode #realignCardsBtn { opacity:.45; cursor:not-allowed; }

      /* v7 tabs layout: max dashboard width 1800px and 60px card spacing */
      #capabilityDashboardView {
        width: 1800px !important;
        min-width: 1800px !important;
        height: 2450px !important;
        min-height: 2450px !important;
        padding: 24px 30px 40px !important;
      }
      #capabilityDashboardContent,
      .capdash-header {
        width: 100%;
        max-width: 1740px;
        margin-left: auto;
        margin-right: auto;
      }
      .capdash-grid {
        width: 100% !important;
        max-width: 1740px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        grid-template-columns: 220px minmax(0, 1fr) 300px !important;
        column-gap: 20px !important;
        row-gap: 20px !important;
      }
      .capdash-repository-panel { width: 220px; }
      .capdash-side { width: 300px; }
      .capdash-view-workshop,
      .capdash-view-campaign,
      .capdash-view-frontend {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 1420px !important;
      }
      .capdash-canvas {
        width: 100% !important;
        min-width: 0 !important;
        height: 1370px !important;
      }
      .capdash-foundation {
        width: 100% !important;
        min-height: 430px !important;
        padding: 18px 24px 24px !important;
      }
      .capdash-foundation-row {
        max-width: 860px;
        margin: 0 auto;
        display: grid !important;
        grid-template-columns: repeat(3, 220px);
        column-gap: 60px !important;
        row-gap: 60px !important;
        justify-content: center !important;
        align-items: start;
      }
      .capdash-foundation .capdash-node {
        width: 220px !important;
      }
      .capdash-tabs {
        max-width: 1740px;
        margin: 16px auto 14px !important;
      }



/* ===== Original style block boundary ===== */


.capdash-tabs{display:flex;gap:8px;margin:16px 0 14px;flex-wrap:wrap}
.capdash-tab{padding:9px 16px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#334155;cursor:pointer;font-weight:700}
.capdash-tab:hover{background:#f8fafc}
.capdash-tab.active{background:#2563eb;color:#fff;border-color:#2563eb}
.capdash-view-workshop,.capdash-view-campaign,.capdash-view-frontend{display:none!important}
.capdash-view-workshop.active,.capdash-view-campaign.active,.capdash-view-frontend.active{display:block!important}
.capdash-grid{grid-template-columns:240px minmax(1500px,1fr) 350px!important;grid-template-rows:auto auto!important;align-items:start!important}
.capdash-repository-panel{grid-column:1!important;grid-row:1 / span 2!important}
.capdash-foundation{grid-column:2!important;grid-row:1!important}
.capdash-view-workshop,.capdash-view-campaign,.capdash-view-frontend{grid-column:2!important;grid-row:2!important;min-height:1240px!important}
.capdash-side{grid-column:3!important;grid-row:1 / span 2!important}
.capdash-canvas{height:1180px!important;min-width:1500px!important}


/* ===== Original style block boundary ===== */


/* v4: compact 1800px dashboard layout */
#capabilityDashboardView {
  width: 1800px !important;
  min-width: 1800px !important;
  max-width: 1800px !important;
  padding: 24px 28px 40px !important;
}
#capabilityDashboardContent,
.capdash-header {
  width: 100% !important;
  max-width: 1744px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.capdash-header {
  align-items: flex-start !important;
  padding: 18px 22px 14px !important;
}
.capdash-header-copy { min-width: 0; }
.capdash-header .capdash-tabs {
  margin: 16px 0 0 !important;
  max-width: none !important;
}
.capdash-grid {
  display: grid !important;
  grid-template-columns: 220px 860px 300px !important;
  grid-template-rows: auto auto !important;
  column-gap: 16px !important;
  row-gap: 16px !important;
  justify-content: start !important;
  align-items: start !important;
  width: max-content !important;
  max-width: 100% !important;
  margin: 16px 0 0 !important;
}
.capdash-repository-panel {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  width: 220px !important;
}
.capdash-foundation {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 860px !important;
  min-width: 860px !important;
  min-height: 390px !important;
  padding: 16px 20px 20px !important;
}
.capdash-foundation-row {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, 220px) !important;
  column-gap: 60px !important;
  row-gap: 60px !important;
  justify-content: start !important;
  align-items: start !important;
}
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 860px !important;
  min-width: 860px !important;
  min-height: 1420px !important;
}
.capdash-canvas {
  width: 860px !important;
  min-width: 860px !important;
  height: 1370px !important;
}
.capdash-side {
  grid-column: 3 !important;
  grid-row: 1 / span 2 !important;
  width: 300px !important;
}


/* ===== Original style block boundary ===== */


/* v5: keep all capability cards and routed lines inside their panels */
.capdash-grid {
  grid-template-columns: 220px 1020px 300px !important;
}
.capdash-foundation {
  width: 1020px !important;
  min-width: 1020px !important;
}
.capdash-foundation-row {
  width: 860px !important;
  max-width: 860px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend {
  width: 1020px !important;
  min-width: 1020px !important;
  overflow: hidden !important;
}
.capdash-canvas {
  width: 1020px !important;
  min-width: 1020px !important;
}


/* ===== Original style block boundary ===== */


/* v6: dynamic middle column with a 1012px minimum and 40px outer card clearance */
#capabilityDashboardView {
  --capdash-middle-width: 1012px;
  --capdash-grid-width: 1564px;
}
#capabilityDashboardContent,
.capdash-header {
  width: var(--capdash-grid-width) !important;
  max-width: var(--capdash-grid-width) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.capdash-grid {
  grid-template-columns: 220px var(--capdash-middle-width) 300px !important;
  width: var(--capdash-grid-width) !important;
  max-width: var(--capdash-grid-width) !important;
}
.capdash-foundation,
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend,
.capdash-canvas {
  width: var(--capdash-middle-width) !important;
  min-width: var(--capdash-middle-width) !important;
}
.capdash-foundation {
  padding-left: 40px !important;
  padding-right: 40px !important;
}
.capdash-foundation-row {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  grid-template-columns: repeat(3, 220px) !important;
  column-gap: 60px !important;
  row-gap: 60px !important;
  justify-content: space-between !important;
}


/* ===== Original style block boundary ===== */


/* v7: use 60px horizontal and vertical spacing between capability cards in every view */
.capdash-foundation-row {
  column-gap: 60px !important;
  row-gap: 60px !important;
  justify-content: start !important;
}
.capdash-foundation {
  min-height: 350px !important;
}


/* ===== Original style block boundary ===== */


/* v8: 60px clearance below the lowest card and equal dynamic column heights */
.capdash-grid {
  align-items: stretch !important;
}
.capdash-repository-panel,
.capdash-side {
  min-height: 0 !important;
}
.capdash-foundation,
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend {
  box-sizing: border-box !important;
}
.capdash-canvas {
  box-sizing: border-box !important;
}


/* ===== Original style block boundary ===== */


/* v9: Foundation capabilities are integrated into each dependency view. */
.capdash-grid {
  grid-template-rows: auto !important;
  align-items: stretch !important;
}
.capdash-repository-panel { grid-column:1 !important; grid-row:1 !important; }
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend {
  grid-column:2 !important;
  grid-row:1 !important;
  min-height:0 !important;
}
.capdash-side { grid-column:3 !important; grid-row:1 !important; }
.capdash-canvas { min-height:0 !important; }
.capdash-node.foundation-node {
  background:#fffbeb !important;
  border-color:#f59e0b !important;
  box-shadow:0 0 0 2px rgba(245,158,11,.10),0 6px 14px rgba(15,23,42,.08) !important;
}
.capdash-node.foundation-node::before {
  content:'FOUNDATION';
  position:absolute;
  top:-10px;
  right:12px;
  padding:2px 7px;
  border-radius:999px;
  background:#f59e0b;
  color:#fff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.05em;
  z-index:2;
}


/* ===== Original style block boundary ===== */


/* v14: clearer relationship routing and stronger distinction between relation types */
.capdash-edge { stroke-linejoin:round; stroke-linecap:square; }
.capdash-edge.links { stroke:#94a3b8 !important; stroke-width:1.4 !important; }
.capdash-edge.support { stroke:#2563eb !important; stroke-width:1.8 !important; stroke-dasharray:7 5 !important; }
.capdash-view-workshop .capdash-canvas { overflow:visible !important; }


/* ===== Original style block boundary ===== */


.capdash-relation-controls{display:flex;align-items:center;gap:14px;margin-top:12px;flex-wrap:wrap}
.capdash-relation-toggle{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:700;color:#334155;cursor:pointer;user-select:none}
.capdash-relation-toggle input{width:16px;height:16px;margin:0;accent-color:#2563eb}
.capdash-relation-marker{font-family:Arial,sans-serif;font-size:9px;font-weight:700;fill:#475569;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round;pointer-events:none}
#capabilityDashboardView.relation-labels-hidden .capdash-relation-marker{display:none!important}
#capabilityDashboardView.relations-hidden .capdash-edge,
#capabilityDashboardView.relations-hidden .capdash-relation-marker{display:none!important}


/* ===== Original style block boundary ===== */


/* v16: 80px vertical spacing and clearer relation routing. */
.capdash-relation-marker {
  font-size: 9px !important;
  font-weight: 700;
  fill: #475569;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.capdash-edge { stroke-linecap: round; stroke-linejoin: round; }


/* ===== Original style block boundary ===== */


/* v22: stakeholder-friendly capability classification badges. */
.capdash-node.foundation-node {
  background:#fff !important;
  border-color:#94a3b8 !important;
  box-shadow:0 2px 5px rgba(15,23,42,.10) !important;
}
.capdash-node.foundation-node::before { display:none !important; content:none !important; }
.capdash-node.work-type-business,
.capdash-node.work-type-integration,
.capdash-node.work-type-dev { overflow:visible; }
.capdash-node.work-type-business::before,
.capdash-node.work-type-integration::before,
.capdash-node.work-type-dev::before {
  position:absolute;
  top:-10px;
  right:12px;
  padding:2px 7px;
  border-radius:999px;
  color:#fff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.05em;
  z-index:3;
}
.capdash-node.work-type-business::before { content:'BUSINESS'; background:#2e7d32; }
.capdash-node.work-type-integration::before { content:'INTEGRATION'; background:#6a1b9a; }
.capdash-node.work-type-dev::before { content:'DEV'; background:#1565c0; }
.capdash-node.work-type-business { border-color:#2e7d32 !important; }
.capdash-node.work-type-integration { border-color:#6a1b9a !important; }
.capdash-node.work-type-dev { border-color:#1565c0 !important; }


/* ===== Original style block boundary ===== */


/* v17: relation endpoints touch card borders; lanes always enter cards from the lane-facing side. */
.capdash-edge { overflow: visible; }
.capdash-relation-marker { dominant-baseline: central; }


/* ===== Original style block boundary ===== */


/* v19: the dashboard and middle column expand to contain the active view. */
#capabilityDashboardView {
  max-width: none !important;
}
.capdash-view-workshop,
.capdash-view-campaign,
.capdash-view-frontend,
.capdash-canvas {
  overflow: visible !important;
}


/* ===== Original style block boundary ===== */


/* v23: fictive capability used as a View 1 goal without underlying ClickUp tasks. */
.capdash-node[data-node-id="webshop-order"] .node-health span:nth-child(3) strong { color:#64748b; }


/* ===== Original style block boundary ===== */


/* v30: relationship hover retained; blocked status hover shows task, due date and dependencies. */
.capdash-node .status-pill { position:relative; color:#fff; border:1px solid transparent; }
.capdash-node .status-needs-discussion { background:#2aaea4; border-color:#218f87; }
.capdash-node .status-backlog { background:#64748b; border-color:#52657d; }
.capdash-node .status-planned { background:#64748b; border-color:#52657d; }
.capdash-node .status-in-progress { background:#1683d8; border-color:#0f70bc; }
.capdash-node .status-uat { background:#e69700; border-color:#c77f00; }
.capdash-node .status-blocked { background:#e32832; border-color:#c81f28; cursor:help; }
.capdash-node .status-done { background:#4dbb2a; border-color:#3d9d21; }
.capdash-node .status-cancelled { background:#df3943; border-color:#c82f38; }
.capdash-node .status-review { background:#7c3aed; border-color:#6d28d9; }
.capdash-node .status-not-set { background:#94a3b8; border-color:#7f8ea3; }

.capdash-hover { position:relative; cursor:help; }
.capdash-hover::after {
  content:attr(data-tooltip);
  position:absolute;
  left:50%; bottom:calc(100% + 9px);
  transform:translateX(-50%);
  min-width:190px; max-width:290px;
  padding:8px 10px;
  border-radius:7px;
  background:#0f172a; color:#fff;
  font-size:10px; line-height:1.4; font-weight:500;
  white-space:pre-line;
  box-shadow:0 5px 16px rgba(15,23,42,.25);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .12s ease;
  z-index:50;
}
.capdash-hover::before {
  content:''; position:absolute; left:50%; bottom:calc(100% + 3px);
  transform:translateX(-50%);
  border:6px solid transparent; border-top-color:#0f172a;
  opacity:0; visibility:hidden; pointer-events:none; z-index:51;
}
.capdash-hover:hover::after,.capdash-hover:hover::before,
.capdash-hover:focus-visible::after,.capdash-hover:focus-visible::before { opacity:1; visibility:visible; }

.capdash-node .node-impact { min-height:29px; }
.capdash-node .impact-hover-target {
  display:inline-flex; align-items:center; min-width:24px; min-height:18px;
  border-radius:4px; color:#64748b;
}
.capdash-node .impact-hover-target::after { left:0; transform:none; bottom:calc(100% + 8px); }
.capdash-node .impact-hover-target::before { left:11px; transform:none; }
.capdash-node .impact-hover-icon { font-weight:800; letter-spacing:1px; opacity:.75; }
.capdash-node .impact-hover-counts {
  display:inline-flex; align-items:center; gap:10px;
  font-weight:700; letter-spacing:.01em; color:#475569;
}
.capdash-node .impact-hover-counts span { white-space:nowrap; }
.capdash-node .health-hover::after { left:0; transform:none; }
.capdash-node .health-hover::before { left:12px; transform:none; }


/* ===== Original style block boundary ===== */


.capdash-view-frontend .capdash-canvas{position:relative;}
/* v50: View 3 uses the View 1 spacing and offsets the two foundation cards
   between the three cards above them. */
.capdash-view-frontend .capdash-node{margin:0!important;}
.capdash-view-frontend .capdash-edge.frontend-foundation-link{
  stroke:#64748b !important;
  stroke-width:1.4 !important;
  stroke-dasharray:2 5 !important;
  stroke-linecap:round !important;
}


/* ===== Original style block boundary ===== */


/* v55: combined, deduplicated Total View. Existing W/C/F badges remain the sole view-membership indicators. */
.capdash-view-total { display:none !important; }
.capdash-view-total.active { display:block !important; }
.capdash-view-total { grid-column:2 !important; grid-row:1 !important; min-height:0 !important; }
.capdash-view-total,
.capdash-view-total .capdash-canvas { overflow:visible !important; }
.capdash-panel-title.total { background:#eef2ff; color:#3730a3; }


/* ===== Original style block boundary ===== */


  /* Restore Show/Hide header behaviour. */
  #headerRestoreBtn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 7px 10px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  }

  body.header-hidden .toolbar {
    display: none !important;
  }

  body.header-hidden #headerRestoreBtn {
    display: inline-flex;
    align-items: center;
  }

  body.header-hidden #viewport {
    height: 100vh !important;
  }


/* ===== Original style block boundary ===== */


  /* Hide all dashboard status badges except Blocked when the option is disabled. */
  #capabilityDashboardView.status-badges-hidden .capdash-node .status-pill:not([data-status="blocked"]) {
    display: none !important;
  }
  #capabilityDashboardView.status-badges-hidden .capdash-node .status-line:has(.status-pill:not([data-status="blocked"])) {
    display: none !important;
  }


/* ===== Original style block boundary ===== */


  /* Total View now presents the three existing diagrams next to each other,
     rather than merging every relation into one combined graph. */
  .capdash-view-total .capdash-total-overview {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 18px 24px;
    overflow: visible;
  }
  .capdash-view-total .capdash-total-column {
    flex: 0 0 auto;
    border: 1px solid #d8e0eb;
    border-radius: 10px;
    background: #fff;
    overflow: visible;
  }
  .capdash-view-total .capdash-total-column-title {
    box-sizing: border-box;
    min-height: 64px;
    padding: 12px 16px;
    border-bottom: 1px solid #d8e0eb;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.25;
  }
  .capdash-view-total .capdash-total-column-title small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
  }
  .capdash-view-total .capdash-total-column .capdash-canvas {
    margin: 0;
    overflow: visible !important;
  }


/* ===== Original style block boundary ===== */


/* v69: Project Health Overview on the left; Capability Repository on the right. */
#capabilityDashboardView {
  --capdash-grid-width: 1564px;
}
.capdash-grid {
  grid-template-columns: 300px var(--capdash-middle-width, 1012px) 220px !important;
}
.capdash-side {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 300px !important;
}
.capdash-repository-panel {
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 220px !important;
}


/* ===== Original style block boundary ===== */


.capdash-node.work-type-business::before,
.capdash-node.work-type-integration::before,
.capdash-node.work-type-dev::before {
  display:none !important;
  content:none !important;
}
.capdash-node { overflow:visible !important; }
.capability-type-badges {
  position:absolute;
  top:-10px;
  display:flex;
  align-items:center;
  gap:5px;
  z-index:6;
  pointer-events:none;
}
.capability-type-badges.badge-side-left { left:12px; }
.capability-type-badges.badge-side-right { right:12px; }
.capability-type-badge {
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:2px 7px;
  border-radius:999px;
  color:#fff;
  font-size:9px;
  line-height:1;
  font-weight:800;
  letter-spacing:.05em;
  white-space:nowrap;
  box-shadow:0 1px 2px rgba(15,23,42,.16);
}
.capability-type-badge.badge-business { background:#2e7d32; }
.capability-type-badge.badge-integration { background:#6a1b9a; }
.capability-type-badge.badge-dev { background:#1565c0; }
.capdash-node.work-type-dev { border-color:#1565c0 !important; }
.capdash-node.work-type-integration:not(.work-type-dev) { border-color:#6a1b9a !important; }
.capdash-node.work-type-business:not(.work-type-dev):not(.work-type-integration) { border-color:#2e7d32 !important; }


/* ===== Original style block boundary ===== */


/* v71: all capability relationship lines are neutral lines without arrowheads. */
.capdash-edge,
#cardRelationsSvg path,
#edges path {
  marker-end: none !important;
  marker-start: none !important;
}

/* v75: DEV badge vertically centered on the left side */
.capability-type-badges.badge-side-left{
  top:50% !important;
  left:auto !important;
  right:-18px !important;
  transform:translateY(-50%) rotate(-90deg) !important;
  transform-origin:center center;
}
.capability-type-badges.badge-side-left .capability-type-badge{
  box-shadow:0 2px 5px rgba(15,23,42,.22);
}



/* ===== Original style block boundary ===== */


/* v77: Total Overview is one combined, deduplicated canvas. */
.capdash-view-total .capdash-canvas{
  position:relative;
  width:3540px !important;
  min-width:3540px !important;
  height:1880px !important;
  min-height:1880px !important;
  margin:0 !important;
  overflow:visible !important;
  background: var(--capdash-section-background,
    linear-gradient(to right,
      rgba(239,246,255,.55) 0,
      rgba(239,246,255,.55) 310px,
      transparent 310px,
      transparent 390px,
      rgba(248,250,252,.38) 390px,
      rgba(248,250,252,.38) 1750px,
      rgba(239,246,255,.55) 1750px,
      rgba(239,246,255,.55) 3540px));
}
.capdash-view-total .capdash-total-overview,
.capdash-view-total .capdash-total-column{
  display:none !important;
}
.capdash-view-total .capdash-canvas::before,
.capdash-view-total .capdash-canvas::after{
  content:none !important;
}
.capdash-total-section-title{
  position:absolute;
  top:14px;
  z-index:8;
  box-sizing:border-box;
  text-align:center;
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
  color:#334155;
  pointer-events:none;
}
.capdash-total-section-title.frontend{
  left:155px;
  width:auto;
  transform:translateX(-50%);
  color:#1e3a8a;
}
.capdash-total-section-title.campaign{
  left:1110px;
  width:auto;
  transform:translateX(-50%);
  white-space:nowrap;
}
.capdash-total-section-title.webshop{
  left:2450px;
  width:auto;
  transform:translateX(-50%);
  white-space:nowrap;
  color:#1e3a8a;
}
.capdash-view-total .capdash-edge.support{
  stroke:#2563eb !important;
  stroke-dasharray:7 5 !important;
}

/* v99: clearer Project Attention presentation */
.capdash-attention-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}
.capdash-attention-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  border: 1px solid transparent;
}
.capdash-attention-status.attention-excellent,
.capdash-attention-status.attention-healthy {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.capdash-attention-status.attention-needs {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}
.capdash-attention-status.attention-high {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}
.capdash-attention-status.attention-critical {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.capdash-attention-help {
  margin-top: 8px;
  color: #64748b;
  font-size: 10px;
}
.capdash-health .score:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 4px;
  border-radius: 6px;
}


/* v104: two equal-width columns inside the Tasks metric */
.capdash-tasks-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  width: 100%;
  min-width: 0;
}
.capdash-tasks-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}
.capdash-tasks-label,
.capdash-tasks-count {
  display: block;
}
.capdash-tasks-right {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
}
.capdash-open-task-modal {
  position: static !important;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0 0 1px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  opacity: .72;
  cursor: pointer;
  transform: none !important;
  transition: opacity .15s ease, color .15s ease, transform .15s ease;
}
.capdash-open-task-modal:hover {
  border: 0;
  background: transparent;
  color: #2563eb;
  opacity: 1;
  transform: scale(1.05) !important;
}
.capdash-open-task-modal:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  opacity: 1;
}
.capdash-open-task-modal img {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.task-card-modal[hidden] { display: none !important; }
.task-card-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 30px;
}
.task-card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.task-card-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 60px));
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .32);
}
.task-card-modal-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
}
.task-card-modal-header h2 {
  margin: 0;
  font-size: 17px;
  color: #0f172a;
}
.task-card-modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}
.task-card-modal-close:hover { background: #e2e8f0; }
.task-card-modal-content {
  overflow: auto;
  padding: 18px;
  background: #f8fafc;
}
.task-card-modal-content .card {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: auto !important;
  transition: none !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .12);
}
.task-card-modal-content .card.collapsed { width: 100% !important; }
.task-card-modal-content .task-body { display: block !important; }
body.task-card-modal-open { overflow: hidden; }


/* ===== V107 compact header layout ===== */
.capdash-collapsed-meta {
  display: none;
}

/* Keep the expanded header metadata together and remove unnecessary vertical space. */
.toolbar > .project-target-date,
.toolbar > .dataset-updated {
  align-self: flex-start;
}

body.header-hidden #headerRestoreBtn {
  top: 30px;
  left: 30px;
  min-width: 112px;
  justify-content: center;
}

body.header-hidden #capabilityDashboardView {
  padding-top: 12px !important;
}

body.header-hidden .capdash-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: grid !important;
  grid-template-columns: 220px minmax(760px, 1fr) 330px;
  column-gap: 18px;
  align-items: center !important;
  min-height: 94px;
  padding: 10px 20px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

body.header-hidden .capdash-header-copy {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

body.header-hidden .capdash-header-copy h1 {
  margin: 0 !important;
  font-size: 19px !important;
  line-height: 1.2;
  text-align: center;
}

body.header-hidden .capdash-header-copy p,
body.header-hidden .capdash-arrow-rule {
  display: none !important;
}

body.header-hidden .capdash-header .capdash-tabs {
  justify-content: center;
  margin: 8px 0 0 !important;
}

body.header-hidden .capdash-relation-controls {
  justify-content: center;
  margin-top: 7px !important;
}

body.header-hidden .capdash-collapsed-meta {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 12px;
}

body.header-hidden .capdash-meta-row {
  display: grid;
  grid-template-columns: 18px max-content 1fr;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

body.header-hidden .capdash-meta-row strong {
  justify-self: end;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  font-size: 12px;
}

body.header-hidden .capdash-meta-row:last-child strong {
  padding: 0;
  border: 0;
  background: transparent;
}

body.header-hidden .capdash-meta-icon {
  color: #334155;
  font-size: 16px;
  text-align: center;
}

@media (max-width: 1250px) {
  body.header-hidden .capdash-header {
    grid-template-columns: 150px minmax(620px, 1fr) 280px;
  }
  body.header-hidden #headerRestoreBtn {
    left: 18px;
    min-width: 104px;
  }
  body.header-hidden .capdash-collapsed-meta {
    font-size: 11px;
  }
}


/* ===== V108 header reordering ===== */
.toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "filters meta-date"
    "options meta-date"
    "actions meta-updated";
  column-gap: 28px !important;
  row-gap: 12px !important;
  align-items: start !important;
  padding: 16px 20px !important;
}

.toolbar .view-title {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
  pointer-events: none;
}

.toolbar .filters-panel {
  grid-area: filters;
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 22px !important;
  padding-right: 16px;
}

.toolbar .filter-options {
  grid-area: options;
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px 18px !important;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.toolbar .toolbar-buttons {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 9px !important;
}

.toolbar .project-target-date {
  grid-area: meta-date;
  align-self: end !important;
  display: grid !important;
  grid-template-columns: 22px max-content 1fr;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 0 8px 20px;
  border-left: 1px solid #e2e8f0;
}

.toolbar .project-target-date::before {
  content: "▣";
  color: #334155;
  font-size: 17px;
  text-align: center;
}

.toolbar .project-target-date label {
  white-space: nowrap;
  font-weight: 700;
}

.toolbar .project-target-date input {
  justify-self: end;
}

.toolbar .dataset-updated {
  grid-area: meta-updated;
  align-self: start !important;
  min-height: 32px;
  padding: 6px 0 6px 50px;
  border-left: 1px solid #e2e8f0;
  position: relative;
  white-space: nowrap;
  font-weight: 700;
}

.toolbar .dataset-updated::before {
  content: "◷";
  position: absolute;
  left: 22px;
  top: 4px;
  color: #334155;
  font-size: 17px;
}

.toolbar .card-relations-status {
  display: none !important;
}

body.capability-dashboard-mode .toolbar .view-title {
  display: none !important;
}

/* Compact dashboard header when the general header is hidden. */
body.header-hidden .capdash-header {
  grid-template-columns: 180px minmax(720px, 1fr) 350px !important;
  min-height: 88px !important;
  padding: 10px 22px !important;
}

body.header-hidden #headerRestoreBtn {
  top: 31px !important;
  left: 30px !important;
}

body.header-hidden .capdash-header-copy {
  grid-column: 2 !important;
  display: grid !important;
  grid-template-columns: 1fr;
  justify-items: center;
}

body.header-hidden .capdash-header-copy h1 {
  font-size: 18px !important;
}

body.header-hidden .capdash-collapsed-meta {
  grid-column: 3 !important;
  align-self: stretch;
  justify-content: center;
}

@media (max-width: 1500px) {
  .toolbar {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .toolbar .filters-panel {
    grid-template-columns: 1fr;
  }
  body.header-hidden .capdash-header {
    grid-template-columns: 145px minmax(620px, 1fr) 300px !important;
  }
}

/* ===== V109 compact dashboard header, connection legend and repository ===== */
.capdash-header {
  align-items: center !important;
  padding: 14px 20px !important;
}
.capdash-header-copy h1 { margin-bottom: 3px !important; }
.capdash-header-copy p { margin-bottom: 8px !important; }
.capdash-header .capdash-tabs {
  margin: 8px 0 6px !important;
}
.capdash-relation-controls {
  margin-top: 4px !important;
}
.capdash-line-meaning {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  align-self: flex-start;
  max-width: 410px;
  padding: 8px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.25;
}
.capdash-line-meaning > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.capdash-line-sample {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 2px solid #475569;
}
.capdash-line-sample.dashed {
  border-top-color: #2563eb;
  border-top-style: dashed;
}
body.header-hidden .capdash-line-meaning { display: none !important; }

/* Align project metadata as two consistent label/value rows. */
.toolbar .project-target-date,
.toolbar .dataset-updated {
  grid-template-columns: 22px 154px minmax(0, 1fr) !important;
}
.toolbar .dataset-updated {
  display: grid !important;
  grid-template-columns: 22px 154px minmax(0, 1fr) !important;
  gap: 8px;
  align-items: center;
  padding: 6px 0 6px 20px !important;
}
.toolbar .dataset-updated::before {
  position: static !important;
  grid-column: 1;
}

/* Repository is 75% of its previous 220px width. */
.capdash-grid {
  grid-template-columns: 300px var(--capdash-middle-width, 1012px) 165px !important;
}
.capdash-repository-panel {
  width: 165px !important;
  min-width: 165px !important;
  overflow: hidden;
  transition: width .18s ease, min-width .18s ease;
}
.capdash-repository-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-left: 9px !important;
  padding-right: 5px !important;
}
.capdash-repository-title > span {
  min-width: 0;
  font-size: 11px;
  white-space: nowrap;
}
.capdash-repository-toggle {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: #1d4ed8;
  font-size: 19px;
  line-height: 20px;
  cursor: pointer;
}
.capdash-repository-toggle:hover { background: #eff6ff; }
.capdash-repository { padding: 9px !important; }
.capdash-repository h3 { font-size: 11px !important; }
.capdash-repo-item {
  position: relative;
  padding: 7px 6px !important;
  border-left: 3px solid transparent;
  font-size: 10px !important;
  line-height: 1.25;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.capdash-repo-item.active-in-view {
  border-left-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}
.capdash-grid.repository-collapsed {
  grid-template-columns: 300px var(--capdash-middle-width, 1012px) 44px !important;
}
.capdash-grid.repository-collapsed .capdash-repository-panel {
  width: 44px !important;
  min-width: 44px !important;
}
.capdash-grid.repository-collapsed .capdash-repository-title {
  height: 100%;
  min-height: 180px;
  padding: 6px !important;
  flex-direction: column;
  justify-content: flex-start;
}
.capdash-grid.repository-collapsed .capdash-repository-title > span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 6px;
  overflow: visible;
}
.capdash-grid.repository-collapsed .capdash-repository { display: none; }

/* V110: Collapsible Project Health Overview. */
.capdash-side {
  width: 300px !important;
  min-width: 300px !important;
  overflow: hidden;
  transition: width .18s ease, min-width .18s ease;
}
.capdash-health-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-left: 10px !important;
  padding-right: 5px !important;
}
.capdash-health-title > span {
  min-width: 0;
  white-space: nowrap;
}
.capdash-health-toggle {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: #1d4ed8;
  font-size: 19px;
  line-height: 20px;
  cursor: pointer;
}
.capdash-health-toggle:hover { background: #eff6ff; }
.capdash-grid.health-collapsed {
  grid-template-columns: 44px var(--capdash-middle-width, 1012px) 165px !important;
}
.capdash-grid.health-collapsed.repository-collapsed {
  grid-template-columns: 44px var(--capdash-middle-width, 1012px) 44px !important;
}
.capdash-grid.health-collapsed .capdash-side {
  width: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
}
.capdash-grid.health-collapsed .capdash-health-title {
  height: 100%;
  min-height: 180px;
  padding: 6px !important;
  flex-direction: column;
  justify-content: flex-start;
}
.capdash-grid.health-collapsed .capdash-health-title > span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: 6px;
  overflow: visible;
}
.capdash-grid.health-collapsed .capdash-health-content { display: none; }


/* ===== V111 contained compact-header actions and responsive metadata ===== */
.capdash-collapsed-actions {
  display: none;
}

body.header-hidden #capabilityDashboardView {
  padding: 10px 12px 0 !important;
}

body.header-hidden .capdash-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 900 !important;
  display: grid !important;
  grid-template-columns: 220px minmax(520px, 1fr) minmax(320px, 370px) !important;
  grid-template-rows: minmax(92px, auto) !important;
  column-gap: 20px !important;
  align-items: stretch !important;
  width: calc(100vw - 24px) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  overflow: visible !important;
}

body.header-hidden .capdash-collapsed-actions {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body.header-hidden .capdash-header-copy {
  grid-column: 2 !important;
  grid-row: 1;
  min-width: 0;
  align-self: center;
}

body.header-hidden .capdash-collapsed-meta {
  grid-column: 3 !important;
  grid-row: 1;
  display: grid !important;
  grid-template-rows: repeat(2, minmax(32px, auto));
  align-content: center;
  gap: 8px !important;
  min-width: 0;
  padding-left: 18px !important;
  overflow: hidden;
}

body.header-hidden .capdash-meta-row {
  grid-template-columns: 18px minmax(130px, 1fr) max-content !important;
  width: 100%;
  min-width: 0;
  gap: 8px !important;
}

body.header-hidden .capdash-meta-row > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.header-hidden .capdash-meta-row strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.header-hidden .capdash-compact-date-input {
  justify-self: end;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  height: 30px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  box-sizing: border-box;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 600;
  line-height: 1;
}

body.header-hidden .capdash-compact-date-input:focus {
  outline: 2px solid rgba(37, 99, 235, .22);
  outline-offset: 1px;
  border-color: #2563eb;
}

/* The restore button now belongs to the left side of the compact header. */
body.header-hidden #headerRestoreBtn {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: auto;
  min-width: 112px !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Keep the collapsed explanation control inside the header. */
body.header-hidden .capdash-collapsed-actions .card-explanation-panel.collapsed {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  box-sizing: border-box;
  box-shadow: none !important;
}

body.header-hidden .capdash-collapsed-actions .card-explanation-panel.collapsed .card-explanation-header {
  min-height: 36px;
  padding: 5px 9px;
  box-sizing: border-box;
}

/* Opening Card explanation still produces an overlay, without affecting the grid. */
body.header-hidden .capdash-collapsed-actions .card-explanation-panel:not(.collapsed) {
  position: fixed !important;
  top: 14px !important;
  left: 14px !important;
  right: auto !important;
  z-index: 10000 !important;
  width: min(1120px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 28px) !important;
}

@media (max-width: 1180px) {
  body.header-hidden .capdash-header {
    grid-template-columns: 190px minmax(430px, 1fr) minmax(285px, 320px) !important;
    column-gap: 14px !important;
  }
  body.header-hidden .capdash-meta-row {
    grid-template-columns: 18px minmax(112px, 1fr) max-content !important;
    font-size: 11px !important;
  }
  body.header-hidden .capdash-tab {
    padding-left: 11px !important;
    padding-right: 11px !important;
  }
}

@media (max-width: 930px) {
  body.header-hidden .capdash-header {
    position: relative !important;
    grid-template-columns: 180px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body.header-hidden .capdash-collapsed-actions {
    grid-column: 1;
    grid-row: 1;
  }
  body.header-hidden .capdash-header-copy {
    grid-column: 2 !important;
    grid-row: 1;
  }
  body.header-hidden .capdash-collapsed-meta {
    grid-column: 1 / -1 !important;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    border-left: 0 !important;
    border-top: 1px solid #e2e8f0;
    padding: 9px 0 0 !important;
  }
}


/* ===== V115 repository layering, title and collapsed-toggle fixes ===== */
.capdash-repository-panel {
  position: relative !important;
  z-index: 20 !important;
  isolation: isolate;
  background: #ffffff !important;
  opacity: 1 !important;
}

.capdash-repository-title {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  column-gap: 6px;
  min-height: 48px;
  overflow: hidden;
}

.capdash-repository-title > span {
  display: block;
  min-width: 0;
  white-space: normal !important;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.15;
  text-align: left;
}

.capdash-repository-toggle {
  position: relative;
  z-index: 3;
  justify-self: end;
  pointer-events: auto !important;
}

.capdash-repository,
.capdash-repository-panel > * {
  position: relative;
  z-index: 1;
}

/* Keep the very wide Total View canvas below the repository column. */
.capdash-view-total,
.capdash-view-total .capdash-canvas,
.capdash-view-total svg {
  z-index: 1 !important;
}

.capdash-grid.repository-collapsed .capdash-repository-panel {
  overflow: visible !important;
}

.capdash-grid.repository-collapsed .capdash-repository-title {
  display: flex !important;
  position: relative;
  overflow: visible !important;
}

.capdash-grid.repository-collapsed .capdash-repository-title > span {
  pointer-events: none !important;
  position: relative;
  z-index: 1;
  white-space: nowrap !important;
}

.capdash-grid.repository-collapsed .capdash-repository-toggle {
  position: relative;
  z-index: 5;
  flex: 0 0 24px;
}

/* V115: linked ClickUp data source */
.capdash-clickup-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.capdash-clickup-link:hover,
.capdash-clickup-link:focus-visible {
  color: #2563eb;
  text-decoration: underline;
}
.capdash-clickup-link:visited { color: inherit; }


/* V116: dashboard metadata moved into Project Health Overview */
.capdash-dashboard-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 7px;
  font-size: 12px;
  line-height: 1.35;
}
.capdash-dashboard-meta .capdash-data-source,
.capdash-dashboard-meta .capdash-meta-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}
.capdash-dashboard-meta strong {
  text-align: right;
  white-space: nowrap;
}


/* V117: consolidate connection legend and refine dashboard metadata */
.capdash-line-meaning {
  max-width: 760px;
  justify-content: flex-start;
  gap: 7px 14px;
}
.capdash-line-sample.solid {
  border-top-width: 2px;
  border-top-style: solid;
  border-top-color: #475569;
}
.capdash-line-sample.thin {
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: #64748b;
}
.capdash-line-sample.dotted {
  border-top-width: 2px;
  border-top-style: dotted;
  border-top-color: #64748b;
}

.capdash-dashboard-meta {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.capdash-dashboard-meta .capdash-data-source,
.capdash-dashboard-meta .capdash-meta-detail {
  display: inline-flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  width: auto;
  max-width: 100%;
}
.capdash-dashboard-meta strong {
  color: #475569;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  text-align: center;
  white-space: nowrap;
}
.capdash-dashboard-meta .capdash-clickup-link {
  color: #475569;
}


/* ===== V118 four-row connection legend in the dashboard header ===== */
body:not(.header-hidden) .capdash-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 310px !important;
  column-gap: 28px !important;
  align-items: stretch !important;
}

body:not(.header-hidden) .capdash-header-copy {
  grid-column: 1;
  min-width: 0;
  align-self: start;
}

body:not(.header-hidden) .capdash-line-meaning {
  grid-column: 2;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  align-self: end !important;
  justify-self: center !important;
  width: 100%;
  max-width: 310px !important;
  box-sizing: border-box;
  gap: 7px !important;
  margin: 0 0 2px !important;
  padding: 10px 13px !important;
}

body:not(.header-hidden) .capdash-line-meaning > span {
  display: grid !important;
  grid-template-columns: 32px max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  width: 100%;
  min-width: 0;
  white-space: normal !important;
}

body:not(.header-hidden) .capdash-line-meaning > span strong {
  white-space: nowrap;
}

body:not(.header-hidden) .capdash-line-sample {
  width: 28px;
}

@media (max-width: 980px) {
  body:not(.header-hidden) .capdash-header {
    grid-template-columns: 1fr !important;
    row-gap: 16px !important;
  }

  body:not(.header-hidden) .capdash-line-meaning {
    grid-column: 1;
    justify-self: start !important;
    width: min(310px, 100%);
  }
}


/* V119: standalone Capability Dashboard page */
body.dashboard-only-page > .toolbar,
body.dashboard-only-page > #headerRestoreBtn,
body.dashboard-only-page > .card-explanation-panel {
  display: none !important;
}
body.dashboard-only-page #viewport {
  height: 100vh !important;
}
body.dashboard-only-page #capabilityDashboardView {
  top: 0 !important;
}
body.dashboard-only-page .capdash-collapsed-actions {
  display: none !important;
}
body.dashboard-only-page .capdash-collapsed-meta {
  display: flex !important;
}


/* ===== V119.5 dashboard-only inline Project Target Date ===== */
body.dashboard-only-page .capdash-relation-controls {
  flex-wrap: nowrap !important;
  white-space: nowrap;
}
body.dashboard-only-page .capdash-target-date-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  cursor: default;
}
body.dashboard-only-page .capdash-target-date-inline input[type="date"] {
  width: 112px;
  min-width: 112px;
  height: 28px;
  box-sizing: border-box;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 500;
}

/* V119.5 integration health */
.capdash-integration-status {
  font-weight: 600;
  cursor: help;
}
.capdash-integration-status.status-ok { color: #15803d; }
.capdash-integration-status.status-attention { color: #b45309; }
.capdash-integration-status.status-warning { color: #b91c1c; }
.capdash-integration-status.status-error { color: #64748b; }

.capdash-integration-status { font-weight: 600; cursor: help; }
.capdash-integration-status.status-ok,
.capdash-integration-status.status-success { color: #15803d; }
.capdash-integration-status.status-attention { color: #b45309; }
.capdash-integration-status.status-warning,
.capdash-integration-status.status-failed { color: #b91c1c; }
.capdash-integration-status.status-running { color: #2563eb; }
.capdash-integration-status.status-not-run,
.capdash-integration-status.status-unknown { color: #64748b; }

/* V119.8 ClickUp refresh control */
.capdash-data-refresh {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:9px;
  font-size:11px;
  color:#64748b;
}
.capdash-refresh-button {
  border:1px solid #cbd5e1;
  border-radius:7px;
  background:#fff;
  color:#334155;
  padding:5px 9px;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}
.capdash-refresh-button:hover:not(:disabled){background:#f8fafc;border-color:#94a3b8;}
.capdash-refresh-button:disabled{opacity:.55;cursor:not-allowed;}

.capdash-validation-section{margin-top:10px;padding-top:9px;border-top:1px solid #e2e8f0}
.capdash-validation-row{margin-bottom:6px}
.capdash-potential-capabilities[hidden]{display:none!important}
.capdash-potential-capabilities{margin-top:8px;text-align:left}
.capdash-potential-title{margin-bottom:5px;font-size:11px;font-weight:700;color:#475569}
.capdash-potential-list{display:flex;flex-direction:column;gap:3px}
.capdash-potential-item{display:grid;grid-template-columns:10px minmax(0,1fr) 14px;align-items:start;gap:4px;width:100%;padding:3px 4px;border-radius:5px;color:#334155;font-size:10.5px;line-height:1.25;text-decoration:none}
.capdash-potential-item:hover{background:#eff6ff;color:#1d4ed8;text-decoration:none}
.capdash-potential-bullet{color:#b45309;font-weight:700}
.capdash-potential-open{color:#64748b;text-align:right}

/* V119.13 Project Health options */
.capdash-health-options{margin:12px 0 4px;padding:10px 0;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;text-align:left}
.capdash-health-options label{display:flex;align-items:center;gap:7px;margin:6px 0;font-size:11px;font-weight:600;color:#334155;cursor:pointer}
.capdash-health-options input{margin:0;flex:0 0 auto}
.capdash-option-help{margin-top:7px;font-size:9.5px;line-height:1.35;color:#64748b}

/* V119.14 - Show status badges */
#capabilityDashboardView.status-badges-hidden .capdash-node .capability-type-badges {
  display: none !important;
}
#capabilityDashboardView.status-badges-hidden .capdash-node .status-pill:not([data-status="blocked"]) {
  display: none !important;
}
#capabilityDashboardView.status-badges-hidden .capdash-node .status-line:not(:has(.status-pill[data-status="blocked"])) {
  display: none !important;
}
/* Blocked is operationally significant and remains visible. */
#capabilityDashboardView.status-badges-hidden .capdash-node .status-pill[data-status="blocked"] {
  display: inline-flex !important;
}


/* V119.15 - make ignored calculation tasks explicit in the task-card modal */
.task-card-modal .task-row.calculation-ignored {
  background-image: linear-gradient(rgba(248,250,252,.42), rgba(248,250,252,.42));
}

.task-card-modal .task-row.calculation-ignored > .task-name,
.task-card-modal .task-row.calculation-ignored > .date,
.task-card-modal .task-row.calculation-ignored > .rag {
  opacity: .62;
}

.task-card-modal .task-row.calculation-ignored .task-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.task-card-modal .task-ignore-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: help;
  opacity: 1 !important;
}

.task-card-modal .task-row.calculation-ignored .task-ignore-badge {
  opacity: 1 !important;
}


/* V119.16 - persistent status badge visibility after dashboard rebuilds */
#capabilityDashboardView.status-badges-hidden .capdash-node .status-pill:not([data-status="blocked"]) {
  display: none !important;
}

#capabilityDashboardView.status-badges-hidden .capdash-node .status-line:not(:has(.status-pill[data-status="blocked"])) {
  display: none !important;
}

#capabilityDashboardView.status-badges-hidden .capdash-node .status-pill[data-status="blocked"] {
  display: inline-flex !important;
}


/* V119.17 - per-view capability visibility controls */
#capabilityDashboardView .capdash-node.capability-hidden {
  display: none !important;
}

.capdash-repo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.capdash-repo-heading h3 {
  margin: 0;
}

.capdash-repo-reset {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: #2563eb;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.capdash-repo-reset:disabled {
  color: #94a3b8;
  cursor: default;
}

.capdash-repo-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) 22px;
  align-items: center;
  gap: 3px;
}

.capdash-repo-label {
  min-width: 0;
}

.capdash-repo-visibility {
  display: none;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.capdash-repo-item.active-in-view .capdash-repo-visibility:not([hidden]) {
  display: inline-flex;
}

.capdash-repo-visibility:hover {
  background: #dbeafe;
}

.capdash-repo-item.hidden-in-view {
  opacity: .58;
}

.capdash-repo-item.hidden-in-view .capdash-repo-label {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.capdash-repo-item.hidden-in-view .capdash-repo-visibility {
  color: #64748b;
}


/* V120.2 - Critical Path management overlay */
#capabilityDashboardView .capdash-edge.critical-path-edge {
  /* Semantic marker only. The visible red emphasis is rendered by the
     dedicated critical-path-glow SVG path behind this relation. */
}

#capabilityDashboardView .capdash-node.critical-path-node {
  box-shadow:
    0 0 0 2px rgba(220,38,38,.75),
    0 0 8px rgba(220,38,38,.55),
    0 0 16px rgba(220,38,38,.22) !important;
}

.capdash-critical-summary[hidden] {
  display: none !important;
}

.capdash-critical-summary {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  text-align: left;
}

.capdash-critical-title {
  margin-bottom: 5px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.capdash-critical-metrics {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 10px;
}

.capdash-critical-metrics strong {
  color: #991b1b;
}

.capdash-critical-path-text {
  margin-top: 6px;
  color: #64748b;
  font-size: 9px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}


/* V120.3 - dedicated Critical Path relation glow */
#capabilityDashboardView .capdash-edge.critical-path-glow {
  fill: none !important;
  stroke: #dc2626 !important;
  stroke-width: 7px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .34;
  filter:
    drop-shadow(0 0 3px rgba(220,38,38,.80))
    drop-shadow(0 0 7px rgba(220,38,38,.48));
  vector-effect: non-scaling-stroke;
}

/* Preserve the underlying relation rhythm for support/uncertain relations. */
#capabilityDashboardView .capdash-edge.critical-path-glow.support {
  stroke-dasharray: 6 5;
}

#capabilityDashboardView .capdash-edge.critical-path-glow.uncertain {
  stroke-dasharray: 2 5;
}

/* Keep the actual relation line above the glow crisp and unchanged. */
#capabilityDashboardView .capdash-edge.critical-path-edge {
  position: relative;
}


/* V120.4 - predictive Project Health and readiness planning */
.capdash-predictive-kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0 10px;
}
.capdash-predictive-kpi > div {
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
}
.capdash-predictive-kpi strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
}
.capdash-forecast-panel {
  margin: 8px 0 10px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.capdash-forecast-title {
  margin-bottom: 7px;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.capdash-readiness-inputs {
  display: grid;
  gap: 5px;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid #e2e8f0;
}
.capdash-readiness-inputs label,
.capdash-forecast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 9px;
}
.capdash-readiness-inputs label span {
  white-space: nowrap;
}
.capdash-readiness-inputs input {
  width: 42px;
  height: 22px;
  padding: 1px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
  font-size: 10px;
  text-align: right;
}
.capdash-forecast-row {
  padding: 2px 0;
}
.capdash-forecast-row strong {
  color: #0f172a;
  font-size: 10px;
}
.capdash-forecast-variance {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid #e2e8f0;
}
.capdash-forecast-status {
  margin-top: 7px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.forecast-on-track { color: #15803d !important; }
.capdash-forecast-status.forecast-on-track { background: #dcfce7; }
.forecast-at-risk { color: #c2410c !important; }
.capdash-forecast-status.forecast-at-risk { background: #ffedd5; }
.forecast-off-track { color: #b91c1c !important; }
.capdash-forecast-status.forecast-off-track { background: #fee2e2; }
.forecast-not-set { color: #64748b !important; }
.capdash-forecast-status.forecast-not-set { background: #e2e8f0; }


/* V120.5 - virtual goal cards are management summary cards */
#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .node-health-goal-summary {
  grid-template-columns: 1fr 1fr;
  row-gap: 5px;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .goal-summary-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 9px;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .goal-summary-row strong {
  flex: 0 0 auto;
  color: #0f172a;
  font-size: 10px;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .goal-summary-variance strong.forecast-on-track {
  color: #15803d;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .goal-summary-variance strong.forecast-at-risk {
  color: #c2410c;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .goal-summary-variance strong.forecast-off-track {
  color: #b91c1c;
}


/* V120.6 - Project Target Date inside Project Forecast */
.capdash-target-date-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.capdash-target-date-forecast {
  padding-bottom: 6px;
  margin-bottom: 1px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  color: #334155 !important;
}

.capdash-target-date-forecast input[type="date"] {
  width: 112px;
  height: 24px;
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
  font-size: 9px;
  font-weight: 500;
}

/* Goal-card Schedule aligns to the right-hand edge of the health column. */
#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .node-health-goal-summary > .health-hover:nth-child(2) {
  text-align: right;
}

#capabilityDashboardView .capdash-node.goal[data-virtual="true"] .node-health-goal-summary > .health-hover:nth-child(2) strong {
  text-align: right;
}


/* V120.7 - explainable Project Attention */
.capdash-attention-breakdown {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #fed7aa;
  text-align: left;
}

.capdash-attention-contributor {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 4px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 9.5px;
  text-align: left;
  cursor: pointer;
}

.capdash-attention-contributor:hover {
  background: rgba(255,255,255,.72);
}

.capdash-attention-contributor.active {
  background: #fff;
  box-shadow: 0 0 0 1px #fdba74 inset;
}

.capdash-attention-contributor > span:last-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.capdash-attention-contributor strong,
.capdash-attention-contributor b {
  color: #0f172a;
}

.capdash-attention-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  padding: 6px 5px 0;
  border-top: 1px solid #fed7aa;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
}

.capdash-attention-total strong {
  color: #c2410c;
  font-size: 12px;
}

#capabilityDashboardView .capdash-node.attention-contributor-muted {
  opacity: .28;
  filter: saturate(.55);
}

#capabilityDashboardView .capdash-node.attention-contributor-match {
  z-index: 5;
  box-shadow:
    0 0 0 2px #f59e0b,
    0 0 10px rgba(245,158,11,.48) !important;
}

.capdash-attention-help {
  line-height: 1.35;
}


/* V120.8 - Risk Register management view */
.capdash-risk-register {
  margin: 8px 0 10px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
.capdash-risk-title-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.capdash-risk-title-row .capdash-forecast-title { margin-bottom:7px; }
.capdash-risk-title-row a {
  margin-bottom:7px;
  color:#2563eb;
  font-size:9px;
  font-weight:700;
  text-decoration:none;
}
.capdash-risk-kpis {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
}
.capdash-risk-kpis > div {
  position:relative;
  padding:6px;
  border:1px solid #e2e8f0;
  border-radius:6px;
  background:#f8fafc;
  color:#64748b;
  font-size:9px;
}
.capdash-risk-kpis strong {
  display:block;
  margin-top:2px;
  color:#0f172a;
  font-size:14px;
}
.capdash-risk-level {
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:4px;
  border-radius:50%;
  vertical-align:middle;
  background:#94a3b8;
}
.capdash-risk-level.risk-high { background:#dc2626; }
.capdash-risk-level.risk-medium { background:#f97316; }
.capdash-risk-level.risk-low { background:#eab308; }
.capdash-risk-context {
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-top:6px;
  color:#64748b;
  font-size:9px;
}
.capdash-risk-context strong { color:#0f172a; }
.capdash-risk-top-title {
  margin-top:9px;
  padding-top:7px;
  border-top:1px solid #e2e8f0;
  color:#475569;
  font-size:9px;
  font-weight:700;
}
.capdash-risk-top-list {
  display:flex;
  flex-direction:column;
  gap:3px;
  margin-top:4px;
}
.capdash-risk-item {
  display:grid;
  grid-template-columns:10px minmax(0,1fr) 22px;
  align-items:start;
  gap:4px;
  padding:4px 3px;
  border-radius:5px;
  color:#334155;
  font-size:9px;
  line-height:1.25;
  text-decoration:none;
}
.capdash-risk-item:hover { background:#eff6ff; }
.capdash-risk-item .capdash-risk-level { margin-top:2px; }
.capdash-risk-name {
  min-width:0;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.capdash-risk-item strong {
  color:#64748b;
  text-align:right;
  font-size:9px;
}
.capdash-risk-empty { color:#94a3b8;font-size:9px;padding:4px 0; }

.capdash-potential-item small {
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:9px;
  line-height:1.25;
}


/* V120.9 - Top Management Attention */
.capdash-management-attention {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}
.capdash-management-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.capdash-management-heading .capdash-forecast-title { margin-bottom:2px; }
.capdash-management-subtitle {
  color:#64748b;
  font-size:9px;
  line-height:1.25;
}
.capdash-management-total {
  min-width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#f1f5f9;
  color:#0f172a;
  font-size:15px;
}
.capdash-management-severity-summary {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
  color:#475569;
  font-size:9px;
}
.capdash-management-severity-summary span {
  display:inline-flex;
  align-items:center;
  gap:3px;
}
.capdash-management-severity-summary i,
.capdash-management-group h3 i,
.capdash-management-severity {
  width:7px;height:7px;border-radius:50%;display:inline-block;flex:0 0 auto;
}
.severity-critical { background:#dc2626 !important; }
.severity-attention { background:#f97316 !important; }
.severity-watch { background:#eab308 !important; }

.capdash-management-source-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin-top:8px;
}
.capdash-management-source-grid button {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:5px;
  padding:6px 7px;
  border:1px solid #e2e8f0;
  border-radius:6px;
  background:#f8fafc;
  color:#475569;
  font:inherit;
  font-size:9px;
  cursor:pointer;
}
.capdash-management-source-grid button:hover { background:#eff6ff;border-color:#bfdbfe; }
.capdash-management-source-grid button:last-child:nth-child(odd) { grid-column:1/-1; }
.capdash-management-source-grid strong { color:#0f172a;font-size:11px; }

.capdash-management-preview-title {
  margin-top:9px;
  padding-top:7px;
  border-top:1px solid #e2e8f0;
  color:#475569;
  font-size:9px;
  font-weight:700;
  text-transform:uppercase;
}
.capdash-management-preview { margin-top:3px; }
.capdash-management-item {
  display:grid;
  grid-template-columns:8px minmax(0,1fr) 14px;
  align-items:start;
  gap:5px;
  width:100%;
  box-sizing:border-box;
  padding:5px 4px;
  border:0;
  border-radius:5px;
  background:transparent;
  color:#334155;
  font:inherit;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}
.capdash-management-item:hover { background:#f8fafc; }
.capdash-management-severity { margin-top:4px; }
.capdash-management-item-content { min-width:0;display:block; }
.capdash-management-source {
  display:block;
  margin-bottom:1px;
  color:#64748b;
  font-size:8px;
  font-weight:800;
  text-transform:uppercase;
}
.capdash-management-item-content strong {
  display:block;
  color:#0f172a;
  font-size:9px;
  line-height:1.25;
  font-weight:700;
}
.capdash-management-item-content small {
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:8.5px;
  line-height:1.25;
}
.capdash-management-open { color:#64748b;font-size:10px;text-align:right; }
.capdash-management-show-all {
  width:100%;
  margin-top:6px;
  padding:5px;
  border:0;
  background:transparent;
  color:#2563eb;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}
.capdash-management-empty {
  padding:8px 2px;
  color:#94a3b8;
  font-size:9px;
}

/* Full management action centre */
.capdash-management-modal[hidden] { display:none !important; }
.capdash-management-modal {
  position:fixed;
  inset:0;
  z-index:2147483646;
  display:grid;
  place-items:center;
  padding:28px;
}
.capdash-management-modal-backdrop {
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.52);
  backdrop-filter:blur(2px);
}
.capdash-management-modal-dialog {
  position:relative;
  z-index:1;
  width:min(850px,92vw);
  max-height:86vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:14px;
  background:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.28);
}
.capdash-management-modal-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:16px 18px 12px;
  border-bottom:1px solid #e2e8f0;
}
.capdash-management-modal-head h2 {
  margin:0;
  color:#0f172a;
  font-size:18px;
}
.capdash-management-modal-head p {
  margin:3px 0 0;
  color:#64748b;
  font-size:11px;
}
.capdash-management-modal-head button {
  border:0;background:transparent;color:#64748b;font-size:24px;cursor:pointer;
}
.capdash-management-modal-filters {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:10px 18px;
  border-bottom:1px solid #e2e8f0;
  background:#f8fafc;
}
.capdash-management-modal-filters button {
  padding:5px 8px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#475569;
  font-size:10px;
  font-weight:600;
  cursor:pointer;
}
.capdash-management-modal-filters button.active {
  background:#dbeafe;
  border-color:#93c5fd;
  color:#1d4ed8;
}
.capdash-management-modal-body {
  overflow:auto;
  padding:12px 18px 18px;
}
.capdash-management-group { margin-bottom:14px; }
.capdash-management-group h3 {
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 5px;
  padding-bottom:5px;
  border-bottom:1px solid #e2e8f0;
  color:#334155;
  font-size:11px;
  text-transform:uppercase;
}
.capdash-management-group h3 span { color:#94a3b8;font-weight:600; }
.capdash-management-modal-body .capdash-management-item {
  grid-template-columns:9px minmax(0,1fr) 18px;
  padding:8px 6px;
  border-bottom:1px solid #f1f5f9;
}
.capdash-management-modal-body .capdash-management-item-content strong { font-size:11px; }
.capdash-management-modal-body .capdash-management-item-content small { font-size:9.5px; }
body.management-modal-open { overflow:hidden; }

#capabilityDashboardView .capdash-node.management-focus-node {
  box-shadow:0 0 0 3px #f59e0b,0 0 18px rgba(245,158,11,.58) !important;
}


/* V121.0 - automatic initial ClickUp refresh */
.initial-data-refresh[hidden] {
  display: none !important;
}

.initial-data-refresh {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(248,250,252,.78);
  backdrop-filter: blur(2px);
}

.initial-data-refresh-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(15,23,42,.16);
  color: #334155;
}

.initial-data-refresh-card > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.initial-data-refresh-card strong {
  color: #0f172a;
  font-size: 12px;
}

.initial-data-refresh-card span:not(.initial-data-refresh-spinner) {
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.initial-data-refresh-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: initialDataRefreshSpin .75s linear infinite;
}

.initial-data-refresh[data-state="success"] .initial-data-refresh-spinner {
  border: 0;
  animation: none;
}
.initial-data-refresh[data-state="success"] .initial-data-refresh-spinner::before {
  content: "✓";
  color: #15803d;
  font-size: 18px;
  font-weight: 800;
}
.initial-data-refresh[data-state="failed"] .initial-data-refresh-spinner {
  border: 0;
  animation: none;
}
.initial-data-refresh[data-state="failed"] .initial-data-refresh-spinner::before {
  content: "!";
  color: #b91c1c;
  font-size: 18px;
  font-weight: 800;
}

@keyframes initialDataRefreshSpin {
  to { transform: rotate(360deg); }
}


/* V121.2 - Task Modal grouping option */
.task-card-modal-content .task-body-raw-api {
  display: block !important;
}

.task-card-modal-content .task-raw-api-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-card-modal-content .task-body-raw-api .task-row {
  margin-top: 0;
}

/* Raw API mode intentionally has no status-group headers. */
.task-card-modal-content .task-body-raw-api .task-status-header {
  display: none !important;
}


/* V121.3 - Delivery Forecast timeline */
.capdash-forecast-timeline {
  display:grid;
  grid-template-columns:auto 1fr auto 1fr auto;
  align-items:center;
  gap:6px;
  margin:9px 0 7px;
  padding:8px 7px;
  border:1px solid #e2e8f0;
  border-radius:7px;
  background:#fff;
}
.capdash-forecast-stage {
  min-width:0;
  text-align:center;
}
.capdash-forecast-stage span {
  display:block;
  color:#64748b;
  font-size:8px;
  font-weight:700;
  text-transform:uppercase;
}
.capdash-forecast-stage strong {
  display:block;
  margin-top:2px;
  color:#0f172a;
  font-size:9px;
  white-space:nowrap;
}
.capdash-forecast-line {
  height:2px;
  min-width:12px;
  background:linear-gradient(90deg,#93c5fd,#2563eb);
  border-radius:999px;
}
.capdash-go-live-summary {
  margin-top:6px;
  padding-top:6px;
  border-top:1px solid #e2e8f0;
}


/* V121.4 - Project Health information hierarchy refactor */
.capdash-health-content{display:flex;flex-direction:column;gap:10px}
.capdash-health-section{margin:0}
.capdash-section-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:1px 0 6px;color:#475569;font-size:9px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.capdash-section-heading>strong{max-width:145px;overflow:hidden;color:#0f172a;font-size:11px;text-align:right;text-overflow:ellipsis;white-space:nowrap}
.capdash-health-compact{padding:9px 10px!important}
.capdash-attention-main{display:flex;align-items:center;justify-content:space-between;gap:10px}
.capdash-attention-main .capdash-attention-title{margin:0 0 4px;text-align:left;font-size:10px}
.capdash-attention-main .capdash-attention-status{display:inline-flex;margin:0;padding:3px 7px;font-size:8px}
.capdash-attention-score-wrap{display:flex;align-items:baseline;gap:3px}
.capdash-health-compact .score{margin:0;font-size:28px!important;line-height:1}
.capdash-attention-score-wrap>span{color:#64748b;font-size:8px;text-transform:uppercase}
.capdash-health-compact .capdash-attention-breakdown{margin-top:7px;padding-top:6px}
.capdash-health-compact .capdash-attention-contributor{padding:3px 4px;font-size:8.5px}
.capdash-health-compact .capdash-attention-total{padding-top:4px;font-size:9px}
.capdash-health-compact .capdash-attention-help{margin-top:5px;font-size:8px}
.capdash-status-kpi{margin-top:7px}
.capdash-status-kpi .capdash-kpi-wide{display:none!important}
.capdash-delivery-forecast-section{padding-top:9px;border-top:1px solid #e2e8f0}
.capdash-delivery-forecast-section .capdash-forecast-panel{margin:0}
.capdash-planning-assumptions-title{margin-top:3px;padding-top:6px;border-top:1px solid #e2e8f0;color:#94a3b8;font-size:8px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.capdash-forecast-context-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:5px;padding-top:5px;border-top:1px solid #e2e8f0;color:#64748b;font-size:9px}
.capdash-forecast-context-row strong{font-size:9px}
.capdash-go-live-summary .capdash-forecast-status{margin-top:5px}
.capdash-risk-register-compact{margin:0 0 1px}
.capdash-risk-overview{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.capdash-risk-overview>div{padding:7px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;color:#64748b;font-size:9px}
.capdash-risk-overview strong{display:block;margin-top:2px;color:#0f172a;font-size:14px}
.capdash-risk-level-summary{display:flex;flex-wrap:wrap;gap:5px 9px;margin-top:6px;color:#64748b;font-size:8.5px}
.capdash-risk-level-summary span{display:inline-flex;align-items:center;gap:2px}
.capdash-risk-level-summary strong{color:#0f172a}
.capdash-health-disclosure{margin:0;border:1px solid #e2e8f0;border-radius:7px;background:#f8fafc;overflow:hidden}
.capdash-health-disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;color:#475569;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;list-style:none}
.capdash-health-disclosure>summary::-webkit-details-marker{display:none}
.capdash-health-disclosure>summary::after{content:"›";color:#64748b;font-size:14px;line-height:1;transform:rotate(0deg);transition:transform .15s ease}
.capdash-health-disclosure[open]>summary::after{transform:rotate(90deg)}
.capdash-health-disclosure[open]>summary{border-bottom:1px solid #e2e8f0;background:#fff}
.capdash-view-options-disclosure .capdash-health-options{margin:0;padding:7px 9px 9px;border:0}
.capdash-data-disclosure .capdash-dashboard-meta{margin:0;padding:9px;border:0}
.capdash-data-disclosure .capdash-validation-section{margin-top:7px}


/* V121.5 - navigation tiles and consistent detail modals */
.capdash-management-source-grid a{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto 10px;
  align-items:center;
  gap:5px;
  padding:6px 7px;
  border:1px solid #e2e8f0;
  border-radius:6px;
  background:#f8fafc;
  color:#475569;
  font-size:9px;
  text-decoration:none;
}
.capdash-management-source-grid a:hover{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.capdash-management-source-grid a:last-child:nth-child(odd){grid-column:1/-1}
.capdash-management-source-grid a strong{color:#0f172a;font-size:11px}
.capdash-management-source-grid a i{color:#94a3b8;font-style:normal;text-align:right}

.capdash-risk-show-all,.capdash-validation-show-all{
  width:100%;margin-top:7px;padding:5px;border:0;border-radius:5px;background:transparent;
  color:#2563eb;font-size:9px;font-weight:700;cursor:pointer
}
.capdash-risk-show-all:hover,.capdash-validation-show-all:hover{background:#eff6ff}
.capdash-validation-inline-data{display:none!important}

.capdash-detail-modal[hidden]{display:none!important}
.capdash-detail-modal{
  position:fixed;inset:0;z-index:2147483646;display:grid;place-items:center;padding:28px
}
.capdash-detail-modal-backdrop{
  position:absolute;inset:0;background:rgba(15,23,42,.52);backdrop-filter:blur(2px)
}
.capdash-detail-modal-dialog{
  position:relative;z-index:1;width:min(850px,92vw);max-height:86vh;display:flex;
  flex-direction:column;overflow:hidden;border-radius:14px;background:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.28)
}
.capdash-detail-modal-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:16px 18px 12px;border-bottom:1px solid #e2e8f0
}
.capdash-detail-modal-head h2{margin:0;color:#0f172a;font-size:18px}
.capdash-detail-modal-head p{margin:3px 0 0;color:#64748b;font-size:11px}
.capdash-detail-modal-head button{border:0;background:transparent;color:#64748b;font-size:24px;cursor:pointer}
.capdash-detail-modal-actions{display:flex;align-items:center;gap:10px}
.capdash-detail-modal-actions a{color:#2563eb;font-size:10px;font-weight:700;text-decoration:none}
.capdash-detail-modal-summary{
  display:flex;flex-wrap:wrap;gap:7px 13px;padding:9px 18px;border-bottom:1px solid #e2e8f0;
  background:#f8fafc;color:#64748b;font-size:10px
}
.capdash-detail-modal-summary span{display:inline-flex;align-items:center;gap:4px}
.capdash-detail-modal-summary strong{color:#0f172a}
.capdash-detail-modal-body{overflow:auto;padding:12px 18px 18px}
.capdash-detail-list-item{
  display:grid;grid-template-columns:10px minmax(0,1fr) 18px;align-items:start;gap:7px;
  padding:9px 6px;border-bottom:1px solid #f1f5f9;color:#334155;text-decoration:none
}
.capdash-detail-list-item:hover{background:#f8fafc}
.capdash-detail-list-copy{min-width:0;display:block}
.capdash-detail-list-copy strong{display:block;color:#0f172a;font-size:11px;line-height:1.3}
.capdash-detail-list-copy small,.capdash-detail-list-copy em{
  display:block;margin-top:2px;color:#64748b;font-size:9px;line-height:1.3;font-style:normal
}
.capdash-detail-open{color:#64748b;font-size:11px;text-align:right}
.capdash-risk-modal-item>.capdash-risk-level{margin-top:4px}
.capdash-validation-modal-group{margin-bottom:15px}
.capdash-validation-modal-group h3{
  display:flex;align-items:center;gap:5px;margin:0 0 4px;padding-bottom:6px;
  border-bottom:1px solid #e2e8f0;color:#334155;font-size:11px;text-transform:uppercase
}
.capdash-validation-modal-group h3 span{color:#94a3b8}
.capdash-validation-dot{width:7px;height:7px;margin-top:4px;border-radius:50%;background:#f59e0b}
.capdash-validation-dot.error{background:#dc2626}
.capdash-detail-empty{padding:18px 4px;color:#94a3b8;font-size:11px;text-align:center}
body.capdash-detail-modal-open{overflow:hidden}


/* V121.7 - optional positioning grid inside capability canvases */
#capabilityDashboardView .capdash-canvas {
  position: relative;
}

#capabilityDashboardView .capdash-canvas.show-view-grid {
  background-image:
    linear-gradient(to right, rgba(148,163,184,.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,.16) 1px, transparent 1px),
    linear-gradient(to right, rgba(100,116,139,.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(100,116,139,.28) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px;
  background-position: 0 0;
}

/* V121.9 - non-intrusive X/Y coordinate overlay */
#capabilityDashboardView .capdash-view-panel {
  position: relative;
}

#capabilityDashboardView .capdash-grid-coordinate-layer {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  color: #64748b;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
}

#capabilityDashboardView .capdash-grid-origin,
#capabilityDashboardView .capdash-grid-x-label,
#capabilityDashboardView .capdash-grid-y-label {
  position: absolute;
  padding: 2px 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.82);
  white-space: nowrap;
}

#capabilityDashboardView .capdash-grid-origin {
  left: 3px;
  top: 3px;
}

#capabilityDashboardView .capdash-grid-x-label {
  top: 3px;
  transform: translateX(3px);
}

#capabilityDashboardView .capdash-grid-y-label {
  left: 3px;
  transform: translateY(3px);
}

/*
Important:
- no position/z-index overrides are applied to SVG relations
- no position/z-index overrides are applied to capability nodes
- no DOM nodes are inserted into the canvas
The grid can therefore not change card or relation positioning.
*/


/* V121.11 - dynamic equal-height dashboard columns */
#capabilityDashboardView .capdash-side,
#capabilityDashboardView .capdash-repository-panel,
#capabilityDashboardView .capdash-view-panel.active {
  box-sizing: border-box;
}

/*
The actual equal height remains controlled by syncDashboardColumnHeights().
Opening/closing Project Health disclosure sections now triggers that function,
so no fixed clipping height is left behind.
*/


/* V121.14 - View Grid pointer coordinates and layout-only refresh */
#capabilityDashboardView .capdash-grid-pointer-tooltip{
  position:absolute;
  z-index:20;
  display:none;
  padding:4px 6px;
  border:1px solid #cbd5e1;
  border-radius:5px;
  background:rgba(15,23,42,.92);
  color:#fff;
  font-size:9px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  pointer-events:none;
  box-shadow:0 2px 8px rgba(15,23,42,.18);
}
#capabilityDashboardView .capdash-grid-pointer-tooltip.visible{
  display:block;
}

#capabilityDashboardView .capdash-grid-layout-refresh{
  position:absolute;
  left:6px;
  top:6px;
  z-index:21;
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #94a3b8;
  border-radius:6px;
  background:rgba(255,255,255,.94);
  color:#334155;
  font-size:15px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  box-shadow:0 1px 5px rgba(15,23,42,.10);
}
#capabilityDashboardView .capdash-grid-layout-refresh:hover{
  background:#eff6ff;
  border-color:#93c5fd;
  color:#1d4ed8;
}
#capabilityDashboardView .capdash-grid-layout-refresh.is-refreshing{
  animation:capdashLayoutRefreshSpin .8s linear infinite;
}
#capabilityDashboardView .capdash-grid-layout-refresh.is-success{
  color:#15803d;
  border-color:#86efac;
}
#capabilityDashboardView .capdash-grid-layout-refresh[hidden]{
  display:none !important;
}

@keyframes capdashLayoutRefreshSpin{
  to{transform:rotate(360deg)}
}


/* V121.17 - live ClickUp loader progress */
.initial-data-refresh-progress{
  display:block;
  margin-top:4px;
  color:#64748b;
  font-size:12px;
  font-weight:600;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* V121.21 fixed capability card width */
:root{--cap-card-width:220px;}
.capability-card,.cap{width:220px!important;box-sizing:border-box;}


/* V121.22 - fixed dashboard capability width and visible classification badges */
#capabilityDashboardView .capdash-node{
  width:220px !important;
  min-width:220px !important;
  max-width:220px !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}

#capabilityDashboardView .capability-type-badges{
  display:flex !important;
  visibility:visible !important;
  opacity:1 !important;
  z-index:12 !important;
  pointer-events:none !important;
}

#capabilityDashboardView .capability-type-badge{
  display:inline-flex !important;
  visibility:visible !important;
  opacity:1 !important;
}

/* End-to-End right boundary: right-most card 3300 + 220 + 20 = 3540. */
#capabilityDashboardView .capdash-view-total .capdash-canvas{
  width:3540px !important;
  min-width:3540px !important;
}


/* V121.23 - End-to-End section alignment
   Campaign / Webshop boundary = X 1750.
   Webshop uses the same light-blue section treatment as Front-End 2.0. */


/* V121.24 - preserve End-to-End section backgrounds while View Grid is active.
   The first four layers are the grid. The final layer is the section background. */
#capabilityDashboardView .capdash-view-total .capdash-canvas.show-view-grid {
  background-image:
    linear-gradient(to right, rgba(148,163,184,.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,.16) 1px, transparent 1px),
    linear-gradient(to right, rgba(100,116,139,.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(100,116,139,.28) 1px, transparent 1px),
    var(--capdash-section-background);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px,
    100% 100%;
  background-position: 0 0;
  background-repeat:
    repeat,
    repeat,
    repeat,
    repeat,
    no-repeat;
}

/* Work-type/classification badges are independent of "Show status badges". */
#capabilityDashboardView.status-badges-hidden .capdash-node .capability-type-badges {
  display:flex !important;
  visibility:visible !important;
  opacity:1 !important;
}
#capabilityDashboardView.status-badges-hidden .capdash-node .capability-type-badge {
  display:inline-flex !important;
  visibility:visible !important;
  opacity:1 !important;
}


/* V121.25 - End-to-End titles and section backgrounds are driven by data/view-layout.json. */


/* V121.27 - relation-letter hover when View Grid is off */
#capabilityDashboardView .capdash-edge-hit{
  fill:none;
  stroke:transparent;
  stroke-width:12px;
  vector-effect:non-scaling-stroke;
  pointer-events:stroke;
  cursor:help;
}

#capabilityDashboardView .capdash-management-group.customer-all-group h3{
  color:#334155;
}
