.estimation-page {
  height: 100%;
}

.estimation-hero {
  margin: -2rem -1.5rem 0;
  padding: 4rem 1.5rem 3rem;
  background: radial-gradient(circle at top left, #2563eb, #0f172a 60%);
  color: #fff;
  border-radius: 0 0 1.5rem 1.5rem;
}

.estimation-hero-kicker {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: #bfdbfe;
}

.estimation-hero h1 {
  margin: 0 0 1rem;
  font-size: 3rem;
  line-height: 1.05;
}

.estimation-hero-copy {
  max-width: 52rem;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.estimation-intro {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 1fr);
}

.estimation-intro-note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 1.25rem;
}

.estimation-intro-note h3 {
  margin-top: 0;
}

.estimation-intro-note ul {
  margin: 0;
  padding-left: 1.1rem;
}

.estimation-app-root {
  min-height: 0;
  height: 100%;
}

.estimation-workbench {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.estimation-toolbar,
.estimation-summary-grid,
.estimation-layout {
  display: grid;
  gap: 1rem;
}

.estimation-toolbar {
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr);
  align-items: start;
}

.estimation-toolbar--workspace {
  padding: 1.2rem;
  border: 1px solid #dbeafe;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #eff6ff, #f8fafc 55%, #fff);
}

.estimation-toolbar-copy h2,
.estimation-panel-header h3 {
  margin: 0;
}

.estimation-toolbar-copy p,
.estimation-panel-subtitle,
.estimation-muted,
.estimation-risk-row p {
  color: #64748b;
}

.estimation-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.estimation-button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.estimation-button:hover {
  transform: translateY(-1px);
}

.estimation-button--secondary {
  background: #2563eb;
  color: #fff;
}

.estimation-button--ghost {
  background: #eff6ff;
  color: #1d4ed8;
}

.estimation-button--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.estimation-button--compact {
  padding: 0.45rem 0.7rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
}

.estimation-flash {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #a5f3fc;
}

.estimation-copy-toast {
  position: fixed;
  z-index: 20;
  bottom: 1.5rem;
  left: 50%;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.5rem);
}

.estimation-copy-toast.is-visible {
  animation: estimation-copy-toast-fade 1.8s ease forwards;
}

@keyframes estimation-copy-toast-fade {
  0%,
  70% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -0.35rem);
  }
}

.estimation-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.estimation-tabs {
  color: #0f172a;
}

.estimation-tab-group {
  display: inline-flex;
  align-self: stretch;
  gap: 0.25rem;
}

.estimation-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.8rem 1rem;
  background: transparent;
  color: #475569;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.estimation-tab.is-active {
  border-bottom-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
}

.estimation-tab-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  min-width: 0;
}

.estimation-tab-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 800;
}

.estimation-summary-card,
.estimation-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.04);
}

.estimation-summary-card {
  padding: 1rem 1.1rem;
}

.estimation-summary-card strong {
  display: block;
  margin-top: 0.4rem;
  color: #0f172a;
  font-size: 1.1rem;
}

.estimation-summary-label {
  color: #64748b;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.estimation-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
  align-items: start;
}

.estimation-layout--results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.estimation-projection-overview-grid {
  display: grid;
  grid-template-columns: minmax(22rem, 0.8fr) minmax(38rem, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.estimation-projection-overview-grid > .estimation-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.estimation-projection-overview-grid > .estimation-panel {
  min-height: 0;
  padding: 0.85rem 1rem;
}

.estimation-projection-overview-grid .estimation-panel-header {
  margin-bottom: 0.65rem;
}

.estimation-projection-overview-grid .estimation-summary-card {
  padding: 0.75rem 0.9rem;
}

.estimation-projection-overview-grid .estimation-summary-card strong {
  margin-top: 0.25rem;
  font-size: 1rem;
}

.estimation-panel {
  padding: 1.2rem;
  min-width: 0;
}

.estimation-hierarchy-outline {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.estimation-hierarchy-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.estimation-hierarchy-heading h4 {
  margin: 0;
}

.estimation-hierarchy-heading span {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 800;
}

.estimation-hierarchy-tree > ol,
.estimation-hierarchy-tree ol {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  border-left: 1px solid #bfdbfe;
  list-style: none;
}

.estimation-hierarchy-tree > ol {
  padding-left: 0;
  border-left: 0;
}

.estimation-hierarchy-tree li {
  position: relative;
  margin: 0.35rem 0;
}

.estimation-hierarchy-tree li::before {
  position: absolute;
  top: 1rem;
  left: -1rem;
  width: 0.65rem;
  border-top: 1px solid #bfdbfe;
  content: '';
}

.estimation-hierarchy-tree > ol > li::before {
  display: none;
}

.estimation-hierarchy-item {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  color: #1e293b;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.estimation-hierarchy-item:hover,
.estimation-hierarchy-item.is-selected {
  background: #dbeafe;
  color: #1d4ed8;
}

.estimation-hierarchy-item small {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
}

.estimation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

.estimation-workspace-main,
.estimation-projections,
.estimation-model {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.estimation-app-body {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.estimation-panel--overview {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.estimation-panel--overview .estimation-summary-grid {
  grid-column: 1 / -1;
}

.estimation-overview-copy {
  display: grid;
  gap: 0.35rem;
}

.estimation-overview-copy h2,
.estimation-overview-copy p {
  margin: 0;
}

.estimation-overview-copy .estimation-hero-kicker {
  color: #2563eb;
}

.estimation-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-start;
}

.estimation-panel--canvas,
.estimation-panel--editor {
  min-height: 0;
}

.estimation-editor-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  gap: 1rem;
  align-items: stretch;
}

.estimation-editor-graph,
.estimation-editor-properties {
  min-width: 0;
}

.estimation-editor-properties {
  border-left: 1px solid #e2e8f0;
  padding-left: 1rem;
  overflow: auto;
}

.estimation-panel--inspector {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
}

.estimation-canvas-header {
  align-items: start;
}

.estimation-canvas-header > div {
  display: grid;
  gap: 0.35rem;
}

.estimation-graph-canvas {
  min-height: min(52vh, 38rem);
  border: 1px solid #cbd5e1;
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.12) 1px, transparent 0),
    linear-gradient(180deg, #f8fafc, #eef6ff);
  background-size: 24px 24px, auto;
  overflow: hidden;
}

.estimation-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.85rem;
  border-bottom: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.estimation-graph-toolbar span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.estimation-inspector-section {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.estimation-inspector-section h4 {
  margin: 0;
}

.estimation-panel > .estimation-inspector-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.estimation-help-pane {
  display: grid;
  grid-template-columns: minmax(14rem, 1.1fr) minmax(16rem, 1fr) auto;
  gap: 1rem;
  align-items: start;
  color: #475569;
}

.estimation-help-pane h3,
.estimation-help-pane p,
.estimation-help-pane ul {
  margin: 0;
}

.estimation-help-pane ul {
  padding-left: 1.1rem;
}

.estimation-panel-header {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.estimation-panel-subtitle {
  font-size: 0.92rem;
  text-align: right;
}

.estimation-heatmap-label {
  fill: #334155;
  font-size: 12px;
}

.estimation-heatmap-label.is-group {
  fill: #5b21b6;
  font-weight: 800;
}

.estimation-heatmap-row {
  fill: #f8fafc;
}

.estimation-heatmap-row.is-group {
  fill: #f5f3ff;
  stroke: #ddd6fe;
}

.estimation-heatmap-range {
  fill: rgba(37, 99, 235, 0.18);
}

.estimation-heatmap-range.is-group {
  fill: rgba(124, 58, 237, 0.2);
}

.estimation-heatmap-likely {
  fill: rgba(37, 99, 235, 0.45);
}

.estimation-heatmap-likely.is-group {
  fill: rgba(124, 58, 237, 0.48);
}

.estimation-heatmap-range.is-state-completed {
  fill: rgba(5, 150, 105, 0.3);
}

.estimation-heatmap-likely.is-state-completed {
  fill: #059669;
}

.estimation-heatmap-range.is-state-active {
  fill: rgba(37, 99, 235, 0.28);
}

.estimation-heatmap-likely.is-state-active {
  fill: #2563eb;
}

.estimation-heatmap-range.is-state-in-review {
  fill: rgba(217, 119, 6, 0.28);
}

.estimation-heatmap-likely.is-state-in-review {
  fill: #d97706;
}

.estimation-badge,
.estimation-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.estimation-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.estimation-chip--verification {
  background: #fee2e2;
  color: #b91c1c;
}

.estimation-chip--deployment {
  background: #ffedd5;
  color: #c2410c;
}

.estimation-chip--standard {
  background: #e2e8f0;
  color: #334155;
}

.estimation-details {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.estimation-details summary {
  cursor: pointer;
  padding: 0.9rem 1rem;
  font-weight: 700;
  background: #f8fafc;
}

.estimation-textarea,
.estimation-pre,
.estimation-field input,
.estimation-field select,
.estimation-task-table input,
.estimation-task-table select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  font: inherit;
  color: #0f172a;
  background: #fff;
}

.estimation-textarea,
.estimation-pre {
  min-height: 14rem;
  padding: 1rem;
  margin: 0;
  box-sizing: border-box;
}

.estimation-textarea {
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  resize: vertical;
}

.estimation-pre {
  white-space: pre-wrap;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  background: #fff;
}

.estimation-errors {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.estimation-errors p {
  margin: 0.2rem 0;
}

.estimation-mermaid-preview {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.estimation-mermaid-preview.is-connecting-dependency {
  touch-action: none;
}

.estimation-mermaid-preview--canvas {
  min-height: 24rem;
  margin: 1rem;
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.estimation-mermaid-preview svg {
  min-width: 100%;
}

.estimation-mermaid-node {
  cursor: pointer;
}

.estimation-mermaid-node:hover > *:first-child {
  stroke: #60a5fa !important;
  stroke-width: 2px !important;
}

.estimation-mermaid-node.is-upstream-dependency > *:first-child,
.estimation-mermaid-node.is-downstream-dependency > *:first-child {
  stroke-width: 3px !important;
}

.estimation-mermaid-node.is-upstream-dependency > *:first-child {
  stroke: #7c3aed !important;
}

.estimation-mermaid-node.is-downstream-dependency > *:first-child {
  stroke: #059669 !important;
}

.estimation-mermaid-node.is-upstream-dependency text,
.estimation-mermaid-node.is-downstream-dependency text {
  font-weight: 900 !important;
}

.estimation-mermaid-node.is-selected > *:first-child {
  stroke: #2563eb !important;
  stroke-width: 3px !important;
}

.estimation-mermaid-node.is-state-completed > *:first-child {
  fill: #ecfdf5 !important;
  stroke: #059669 !important;
}

.estimation-mermaid-node.is-state-active > *:first-child {
  fill: #eff6ff !important;
  stroke: #2563eb !important;
}

.estimation-mermaid-node.is-state-in-review > *:first-child {
  fill: #fffbeb !important;
  stroke: #d97706 !important;
}

.estimation-mermaid-node-badge {
  font-size: 16px;
  pointer-events: none;
}

.estimation-mermaid-edge {
  cursor: pointer;
  pointer-events: stroke;
  touch-action: manipulation;
}

.estimation-mermaid-edge-hit-target {
  stroke: transparent !important;
  stroke-width: 22px !important;
  fill: none !important;
  opacity: 0;
  pointer-events: stroke;
}

.estimation-mermaid-edge.is-upstream-dependency,
.estimation-mermaid-edge.is-downstream-dependency {
  stroke-width: 4px !important;
}

.estimation-mermaid-edge.is-upstream-dependency {
  stroke: #7c3aed !important;
}

.estimation-mermaid-edge.is-downstream-dependency {
  stroke: #059669 !important;
}

.estimation-mermaid-edge.is-selected {
  stroke: #dc2626 !important;
  stroke-width: 5px !important;
}

.estimation-node-action-overlay {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 0.35rem;
  transform: translateY(-50%);
  touch-action: none;
}

.estimation-node-action-handle {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.28);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.estimation-node-action-handle:active {
  cursor: grabbing;
}

.estimation-add-dependent-handle {
  background: #059669;
  cursor: pointer;
}

.estimation-connect-dependency-handle {
  background: #2563eb;
}

.estimation-connect-dependency-handle::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #fff;
}

.estimation-connect-dependency-handle:active::before {
  width: 0.65rem;
  height: 0.18rem;
  border-radius: 999px;
}

.estimation-dependency-drag-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.estimation-dependency-guide {
  stroke: #2563eb;
  stroke-width: 3px;
  stroke-dasharray: 8 6;
  visibility: hidden;
  pointer-events: none;
}

.estimation-dependency-guide[visibility="visible"] {
  visibility: visible;
}

marker[id^="estimation-overlay-arrow"] path {
  fill: #2563eb;
}

.estimation-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.estimation-controls-grid--inspector {
  grid-template-columns: 1fr;
}

.estimation-field,
.estimation-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  color: #334155;
}

.estimation-field input,
.estimation-field select,
.estimation-task-table input,
.estimation-task-table select {
  padding: 0.75rem 0.85rem;
  box-sizing: border-box;
}

.estimation-toggle {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.estimation-developers {
  display: grid;
  gap: 0.85rem;
}

.estimation-selected-task {
  padding: 1rem;
  border-radius: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.estimation-task-editor {
  display: grid;
  gap: 1rem;
}

.estimation-task-editor-heading,
.estimation-task-editor-actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.estimation-task-editor-heading h4,
.estimation-task-editor-heading p,
.estimation-task-editor-actions p {
  margin: 0;
}

.estimation-task-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.estimation-field--wide {
  grid-column: 1 / -1;
}

.estimation-connection-editor {
  gap: 1rem;
}

.estimation-connection-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.estimation-connection-flow > span {
  color: #2563eb;
  font-size: 1.4rem;
  font-weight: 900;
}

.estimation-connection-flow strong {
  display: block;
  margin-top: 0.25rem;
}

.estimation-selected-task-title {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.estimation-selected-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.estimation-chart {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.estimation-chart--interactive svg {
  cursor: crosshair;
}

.estimation-chart svg {
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border-radius: 0.9rem;
}

.estimation-axis {
  stroke: #94a3b8;
  stroke-width: 1;
}

.estimation-today-line {
  stroke: #dc2626;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.estimation-start-line {
  stroke: #475569;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.estimation-today-label {
  fill: #b91c1c;
  font-size: 11px;
  font-weight: 800;
}

.estimation-start-label {
  fill: #475569;
  font-size: 11px;
  font-weight: 800;
}

.estimation-hover-line {
  stroke: #0f172a;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  opacity: 0.7;
  pointer-events: none;
}

.estimation-chart-tooltip {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: min(18rem, calc(100% - 2rem));
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  z-index: 2;
}

.estimation-chart-tooltip[hidden] {
  display: none !important;
}

.estimation-chart-tooltip strong {
  font-size: 0.95rem;
}

.estimation-chart-tooltip span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.estimation-tooltip-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.estimation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.estimation-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #334155;
  font-size: 0.9rem;
}

.estimation-legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
}

.estimation-risk-table {
  display: grid;
  gap: 0.75rem;
}

.estimation-risk-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 8rem 8rem minmax(10rem, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
}

.estimation-risk-row strong,
.estimation-risk-row p {
  margin: 0;
}

.estimation-risk-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
  color: #64748b;
}

.estimation-risk-metric strong {
  color: #0f172a;
}

.estimation-risk-bar {
  background: #fee2e2;
  border-radius: 999px;
  overflow: hidden;
  height: 0.85rem;
}

.estimation-risk-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.estimation-task-table {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.estimation-task-table table {
  width: 100%;
  border-collapse: collapse;
}

.estimation-task-table th,
.estimation-task-table td {
  padding: 0.85rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.estimation-task-table thead th {
  border-top: 0;
  color: #475569;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.estimation-task-table tr.is-selected {
  background: #eff6ff;
}

.estimation-task-table tr.is-state-completed {
  background: #ecfdf5;
}

.estimation-task-table tr.is-state-active {
  background: #eff6ff;
}

.estimation-task-table tr.is-state-in-review {
  background: #fffbeb;
}

.estimation-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
}

.estimation-state-badge--active {
  background: #dbeafe;
  color: #1d4ed8;
}

.estimation-state-badge--in-review {
  background: #fef3c7;
  color: #b45309;
}

.estimation-state-badge--completed {
  background: #d1fae5;
  color: #047857;
}

.estimation-completion-note {
  margin: 0;
}

.estimation-task-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.estimation-task-meta {
  margin-top: 0.45rem;
}

.estimation-slider-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  min-width: 12rem;
  color: #64748b;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .estimation-hero {
    padding: 3rem 1rem 2.5rem;
  }

  .estimation-hero h1 {
    font-size: 2.2rem;
  }

  .estimation-intro {
    grid-template-columns: 1fr;
  }

  .estimation-toolbar,
  .estimation-layout,
  .estimation-layout--results,
  .estimation-projection-overview-grid,
  .estimation-workspace,
  .estimation-panel--overview,
  .estimation-editor-surface,
  .estimation-task-editor-grid,
  .estimation-connection-flow,
  .estimation-help-pane,
  .estimation-summary-grid,
  .estimation-controls-grid,
  .estimation-risk-row {
    grid-template-columns: 1fr;
  }

  .estimation-tabs {
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.65rem 0.5rem;
  }

  .estimation-app-body {
    padding-inline: 0.4rem;
  }

  .estimation-workspace-main,
  .estimation-projections,
  .estimation-model,
  .estimation-app-body {
    gap: 0.65rem;
  }

  .estimation-panel {
    padding: 0.85rem 0.65rem;
    border-radius: 0.85rem;
  }

  .estimation-task-table {
    overflow: visible;
  }

  .estimation-task-table table,
  .estimation-task-table thead,
  .estimation-task-table tbody,
  .estimation-task-table tr,
  .estimation-task-table th,
  .estimation-task-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .estimation-task-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .estimation-task-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .estimation-task-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #fff;
    overflow: hidden;
  }

  .estimation-task-table th,
  .estimation-task-table td {
    border-top: 0;
  }

  .estimation-task-table td {
    display: grid;
    grid-template-columns: minmax(6rem, 0.38fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.65rem;
    overflow-wrap: anywhere;
  }

  .estimation-task-table td + td {
    border-top: 1px solid #e2e8f0;
  }

  .estimation-task-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .estimation-task-table input,
  .estimation-task-table select,
  .estimation-slider-label {
    min-width: 0;
  }

  .estimation-tab-group {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .estimation-tab {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.45rem;
    white-space: nowrap;
    font-size: 0.92rem;
  }

  .estimation-tab-status {
    display: none;
  }

  .estimation-panel--inspector {
    position: static;
    max-height: none;
  }

  .estimation-editor-properties {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    padding-left: 0;
    padding-top: 1rem;
  }

  .estimation-panel--canvas {
    min-height: auto;
  }

  .estimation-mermaid-preview--canvas {
    min-height: 18rem;
    margin: 0.35rem;
    padding: 0.4rem;
    border-radius: 0.75rem;
  }

  .estimation-graph-canvas {
    border-radius: 0.85rem;
  }

  .estimation-graph-toolbar {
    padding: 0.5rem;
    gap: 0.35rem;
  }

  .estimation-graph-toolbar span {
    padding: 0.3rem 0.5rem;
  }

  .estimation-node-action-overlay {
    gap: 0.5rem;
  }

  .estimation-node-action-handle {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1rem;
  }

  .estimation-connect-dependency-handle::before {
    width: 0.6rem;
    height: 0.6rem;
  }

  .estimation-mermaid-edge-hit-target {
    stroke-width: 30px !important;
  }

  .estimation-toolbar-actions {
    justify-content: flex-start;
  }

  .estimation-task-editor-heading,
  .estimation-task-editor-actions {
    flex-direction: column;
  }

  .estimation-overview-actions {
    justify-content: flex-start;
  }

  .estimation-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .estimation-panel-subtitle {
    text-align: left;
  }
}
