:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f6fb;
  color: #1f2933;
  overflow: hidden;
}

button {
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.button {
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: #3b82f6;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.secondary {
  background: #eef2ff;
  color: #1f2937;
}

a.button.secondary {
  background: #eef2ff;
  color: #1f2937;
}

button.secondary.is-active,
a.button.secondary.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.6);
}

button.small {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
}

button.danger {
  background: #dc2626;
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

a.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 3rem;
}

.app-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d9deeb;
  gap: 1.5rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-display {
  font-size: 0.85rem;
  color: #666;
  padding: 0.25rem 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
}

.ec2-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  background: #f5f5f5;
  border-radius: 4px;
  cursor: help;
}

.ec2-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: pulse 2s ease-in-out infinite;
}

.ec2-status.running .status-dot {
  background: #10b981;
  animation: none;
}

.ec2-status.stopped .status-dot {
  background: #ef4444;
  animation: none;
}

.ec2-status.starting .status-dot {
  background: #f59e0b;
}

.ec2-status.stopping .status-dot {
  background: #f59e0b;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ec2-status .status-text {
  color: #666;
  font-weight: 500;
}

#runtime-data-link {
  font-weight: 700;
}

.panel-toggles {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #475569;
}

.panel-toggles input {
  margin-right: 0.35rem;
}

.workspace {
  flex: 1;
  padding: 1rem;
  display: grid;
  gap: 0;
  --resize-handle-width: 12px;
  grid-template-columns: minmax(260px, 320px) var(--resize-handle-width) minmax(0, 1fr) var(--resize-handle-width) minmax(320px, 420px);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  max-width: 100vw;
  overflow: hidden;
}

.panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d9deeb;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.panel.hidden {
  display: none;
}

.panel-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e9f5;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.resize-handle {
  position: relative;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.resize-handle::before {
  content: '';
  width: 2px;
  height: 70%;
  border-radius: 999px;
  background: #cbd5f5;
}

.resize-handle:hover,
.resize-handle:focus-visible {
  background: #eef2ff;
}

.resize-handle:hover::before,
.resize-handle:focus-visible::before {
  background: #94a3ff;
}

.resize-handle.hidden {
  display: none;
}

body.is-resizing,
body.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.mindmap-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.4rem;
  background: #f1f5ff;
  border-radius: 9999px;
  border: 1px solid #dbe3ff;
}

.mindmap-zoom-controls button.secondary {
  padding: 0.2rem 0.55rem;
  min-width: 0;
  line-height: 1;
}

.mindmap-zoom-display {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 3ch;
  text-align: center;
  color: #1f2937;
}

.outline-tree {
  padding: 0.5rem 1rem 1rem;
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.outline-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  border-left: 4px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.outline-item:hover {
  background: #f1f5ff;
}

.outline-item.selected {
  background: #e0e7ff;
}

.outline-item .title {
  flex: 1;
  font-size: 0.95rem;
}

.outline-item.status-draft {
  border-left-color: #94a3b8;
}

.outline-item.status-ready {
  border-left-color: #f59e0b;
}

.outline-item.status-approved {
  border-left-color: #0284c7;
}

.outline-item.status-in-progress {
  border-left-color: #22c55e;
}

.outline-item.status-blocked {
  border-left-color: #f87171;
}

.outline-item.status-done {
  border-left-color: #2f2f2f;
  background: #7f7f7f;
  color: #2f2f2f;
}

.outline-item.status-done .title {
  color: #2f2f2f;
}

.outline-item.status-done .caret-button {
  background: #666666;
  border-color: #2f2f2f;
  color: #2f2f2f;
}

.outline-item.status-done:hover {
  background: #6f6f6f;
  color: #2f2f2f;
}

.outline-item.status-done.selected {
  box-shadow: inset 0 0 0 2px rgba(47, 47, 47, 0.35);
  background: #6f6f6f;
  color: #2f2f2f;
}

.outline-item.status-done.health-warning,
.outline-item.status-done.health-critical {
  background: #7f7f7f !important;
  color: #2f2f2f;
}

.outline-item.status-done.health-warning:hover,
.outline-item.status-done.health-critical:hover {
  background: #6f6f6f !important;
}

.outline-item.health-warning .title {
  color: #b45309;
  font-weight: 600;
}

.outline-item.health-critical .title {
  color: #b91c1c;
  font-weight: 700;
}

.outline-item.classification-epic:not(.health-warning):not(.health-critical):not(.status-done) {
  background: #92400e;
  color: #ffffff;
}

.outline-item.classification-epic:not(.health-warning):not(.health-critical):not(.status-done) .title {
  color: #ffffff;
  font-weight: 600;
}

.outline-item.classification-epic:not(.health-warning):not(.health-critical):not(.status-done):hover {
  background: #7a350b;
  color: #ffffff;
}

.outline-item.classification-epic:not(.health-warning):not(.health-critical):not(.status-done).selected {
  background: #6b2f0a;
  color: #ffffff;
}

.caret-button {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid #cdd5f8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}

.caret-button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.mindmap-panel {
  min-width: 0;
}

.view-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem 0;
  border-bottom: 1px solid #e5e9f5;
  background: #f8f9ff;
}

.view-tab {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.view-tab:hover {
  background: #eef2ff;
  color: #1e293b;
}

.view-tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.view-tab.is-active {
  background: #ffffff;
  color: #1f2937;
  border-color: #d9deeb;
  border-bottom-color: #ffffff;
  box-shadow: 0 -1px 0 #ffffff;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view-content {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

.view-content.is-active {
  display: flex;
}

.mindmap-controls {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8f9ff;
  border-bottom: 1px solid #e2e8f0;
  align-items: center;
}

.mindmap-wrapper {
  flex: 1;
  position: relative;
  padding: 0 0.75rem 0.75rem;
  overflow: auto;
  height: 100%;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
  cursor: grab;
}

.mindmap-wrapper::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.mindmap-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 9999px;
}

.mindmap-wrapper.is-panning {
  cursor: grabbing;
}

body.is-mindmap-panning {
  user-select: none;
}

#mindmap-canvas {
  display: block;
  max-width: none;
  max-height: none;
  background: #fdfefe;
  border-radius: 12px;
  border: 1px solid #edf1ff;
}

.mindmap-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid #e5e9f5;
  font-size: 0.9rem;
  color: #475569;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  height: 100%;
  overflow-x: auto;
}

.kanban-column {
  flex: 1 1 25%;
  display: flex;
  flex-direction: column;
  background: #f8f9ff;
  border-radius: 8px;
  overflow: hidden;
}

.kanban-column-header {
  padding: 0.75rem 1rem;
  background: #eef2ff;
  border-bottom: 2px solid #cbd5f5;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

.kanban-column-body {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kanban-card {
  background: #fff;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  padding: 0.75rem;
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.kanban-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.kanban-card-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.kanban-column-body.drag-over {
  background: #dbeafe;
  border: 2px dashed #3b82f6;
}

.heatmap-table {
  width: max-content;
  min-width: unset;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.heatmap-table th,
.heatmap-table td {
  border: 1px solid #e5e9f5;
  padding: 2px 4px;
  text-align: center;
}

.heatmap-table thead th {
  background: #f4f6ff;
  font-weight: 600;
}

.heatmap-table thead th:not(:first-child) {
  text-align: center;
}

.heatmap-table th {
  text-align: left;
  white-space: nowrap;
}

.heatmap-cell.empty {
  color: #94a3b8;
}

.heatmap-modal {
  display: inline-flex;
  flex-direction: column;
  gap: 0.75rem;
  width: max-content;
  max-width: 95vw;
  max-height: 80vh;
}

.heatmap-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.heatmap-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #1f2937;
}

.heatmap-table-wrapper {
  overflow: auto;
  max-width: 95vw;
}

.heatmap-modal table {
  max-height: 100%;
}

.heatmap-modal .placeholder {
  margin: 0;
}

.heatmap-note {
  font-size: 0.85rem;
  color: #475569;
}

.mindmap-edge {
  fill: none;
  stroke: #cbd5f5;
  stroke-width: 2;
}

.mindmap-dependency-edge {
  fill: none;
  stroke: rgba(71, 85, 105, 0.65);
  stroke-width: 2;
  stroke-dasharray: 8 6;
  pointer-events: stroke;
}

.mindmap-dependency-edge.is-blocker {
  stroke: #dc2626;
  stroke-dasharray: none;
  stroke-width: 2.6;
}

.mindmap-dependency-label {
  font-size: 0.7rem;
  fill: #dc2626;
  font-weight: 600;
  letter-spacing: 0.02em;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2px;
}

.mindmap-node rect {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 2;
  rx: 12;
  ry: 12;
  transition: fill 160ms ease, stroke 160ms ease;
}

.mindmap-node.status-draft rect {
  stroke: #94a3b8;
  fill: #f8fafc;
}

.mindmap-node.status-ready rect {
  stroke: #f59e0b;
  fill: #fef3c7;
}

.mindmap-node.status-in-progress rect {
  stroke: #16a34a;
  fill: #dcfce7;
}

.mindmap-node.status-blocked rect {
  stroke: #dc2626;
  fill: #fee2e2;
}

.mindmap-node.status-approved rect {
  stroke: #0284c7;
  fill: #e0f2fe;
}

.mindmap-node.status-done rect {
  stroke: #2f2f2f;
  fill: #7f7f7f;
}

.mindmap-node.status-done.health-warning rect,
.mindmap-node.status-done.health-critical rect {
  stroke: #2f2f2f !important;
  fill: #7f7f7f !important;
}

.mindmap-node.health-warning rect {
  stroke: #f97316;
  fill: #fff7ed;
}

.mindmap-node.health-critical rect {
  stroke: #dc2626;
  fill: #fee2e2;
}

.mindmap-node.selected rect {
  stroke: #16a34a;
  stroke-width: 3;
}

.mindmap-node foreignObject {
  pointer-events: auto;
}

.mindmap-node-body {
  width: 100%;
  height: 100%;
  padding: 14px 16px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.mindmap-node-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.mindmap-node-body.has-scroll .mindmap-node-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.mindmap-node-body.has-scroll .mindmap-node-scroll::-webkit-scrollbar {
  width: 8px;
}

.mindmap-node-body.has-scroll .mindmap-node-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 9999px;
}

.mindmap-node-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mindmap-node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.mindmap-node-header .story-title {
  flex: 1 1 auto;
}

.mindmap-node-actions {
  display: flex;
  flex-shrink: 0;
}

.mindmap-delete-button {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.mindmap-delete-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 2px;
}

.mindmap-node .story-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.35;
  transition: color 160ms ease;
  white-space: pre-wrap;
  word-break: break-word;
}

.mindmap-node.health-warning .story-title {
  color: #b45309;
}

.mindmap-node.health-critical .story-title {
  color: #b91c1c;
}

.mindmap-node .story-meta.story-classification {
  font-weight: 600;
}

.mindmap-node.classification-epic:not(.status-done) rect {
  stroke: #6b2f0a;
  fill: #92400e;
}

.mindmap-node.classification-epic:not(.health-warning):not(.health-critical):not(.status-done) .story-title {
  color: #ffffff;
}

.mindmap-node.classification-epic:not(.status-done) .story-meta.story-classification {
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mindmap-node.classification-epic:not(.status-done) .story-meta,
.mindmap-node.classification-epic:not(.status-done) .story-status {
  color: #fef3e7;
}

.mindmap-node .story-meta {
  font-size: 0.75rem;
  color: #334155;
  line-height: 1.4;
  transition: color 160ms ease;
  white-space: pre-wrap;
  word-break: break-word;
}

.mindmap-node .story-status.status-draft {
  color: #475569;
}

.mindmap-node .story-status.status-ready {
  color: #b45309;
}

.mindmap-node .story-status.status-in-progress {
  color: #15803d;
}

.mindmap-node .story-status.status-blocked {
  color: #dc2626;
}

.mindmap-node .story-status.status-approved {
  color: #0369a1;
}

.mindmap-node .story-status {
  transition: color 160ms ease;
}

.mindmap-node .story-status.status-done {
  color: #2f2f2f;
}

.mindmap-node.status-done .story-title,
.mindmap-node.status-done .story-meta,
.mindmap-node.status-done .story-status {
  color: #2f2f2f;
}

.mindmap-measure-root {
  position: absolute;
  top: -10000px;
  left: -10000px;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.mindmap-node-body--measure {
  position: absolute;
  top: 0;
  left: 0;
}

.status-guide {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.status-guide li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.status-guide strong {
  color: #1d4ed8;
}

.status-guide span {
  color: #475569;
  font-size: 0.85rem;
}

.status-value {
  display: inline-flex;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.status-draft {
  background: #e2e8f0;
  color: #1f2937;
}

.status-badge.status-ready {
  background: #fef3c7;
  color: #b45309;
}

.status-badge.status-in-progress {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.status-blocked {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge.status-approved {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge.status-done {
  background: #7f7f7f;
  color: #2f2f2f;
}

.status-description {
  margin: 0.35rem 0 0;
  color: #475569;
  font-size: 0.85rem;
}

.mindmap-node .toggle-bg {
  fill: #1d4ed8;
  cursor: pointer;
}

.mindmap-node .toggle-label {
  fill: #fff;
  font-size: 0.7rem;
  pointer-events: none;
}

.details-panel {
  min-width: 0;
}

.details-content {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.placeholder {
  padding: 1.5rem;
  text-align: center;
  color: #6b7280;
}

.story-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid #e5e9f5;
  background: #ffffff;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-actions button {
  flex: 0 0 auto;
}

.story-form.health-warning {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.story-form.health-critical {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.story-form .field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.story-form .form-toolbar {
  /* No longer needed - flexbox parent handles layout */
}

.story-form .full {
  /* No longer needed - flexbox parent handles layout */
}

.story-form table {
  border-collapse: collapse;
  width: 100%;
}

.story-form th,
.story-form td {
  border: 1px solid #e5e9f5;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  text-align: left;
}

.story-brief {
  width: 100%;
  border-collapse: collapse;
}

.story-brief th {
  width: 120px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
  padding: 0.35rem 0.75rem 0.35rem 0;
  vertical-align: top;
}

.story-brief td {
  padding: 0.35rem 0;
}

.story-brief .status-select {
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  font-size: 0.9rem;
  max-width: 220px;
}

.story-brief textarea {
  min-height: 3.25rem;
}

.story-text {
  padding: 0.45rem 0;
  font-size: 0.95rem;
  color: #1f2937;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}

/* Story ID styling */
.story-id {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #666;
  background-color: #f5f5f5;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.components-display {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #1f2937;
  white-space: normal;
}

.components-display.editable {
  color: #0f172a;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}

.components-display.empty {
  color: #64748b;
  font-style: italic;
}

.components-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.components-edit-btn {
  display: none;
}

.components-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #4b5563;
}

.component-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

.component-picker-hint {
  margin: 0;
  color: #475569;
  font-size: 0.85rem;
}

.component-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.component-picker-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.component-picker-option input {
  width: auto;
  margin: 0;
}

.component-picker-option span {
  font-size: 0.9rem;
  color: #0f172a;
}

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

.section-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.codewhisperer-section {
  border: 1px solid #e5e9f5;
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.codewhisperer-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.codewhisperer-task-card {
  border: 1px solid #dbe3ff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #f8faff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.codewhisperer-task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.codewhisperer-task-card-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.codewhisperer-confirmation {
  margin: 0;
  font-size: 0.85rem;
  color: #1f2937;
}

.codewhisperer-objective {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.5;
}

.codewhisperer-assignee {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.codewhisperer-assignee span {
  font-weight: 600;
  color: #374151;
}

.codewhisperer-assignee .assignee-input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.85rem;
}

.codewhisperer-confirmation span {
  font-weight: 600;
  margin-right: 0.35rem;
}

.codewhisperer-confirmation code {
  font-family: 'Source Code Pro', Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  background: #e0e7ff;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  color: #1e293b;
}

.codewhisperer-target-badge {
  background: #1d4ed8;
  color: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.codewhisperer-branch {
  margin: 0;
  font-size: 0.85rem;
  color: #1f2937;
}

.codewhisperer-branch span {
  font-weight: 600;
  margin-right: 0.35rem;
}

.codewhisperer-status-line {
  margin: 0;
  font-size: 0.9rem;
  color: #1f2937;
}

.codewhisperer-status-line.is-error {
  color: #b91c1c;
}

.codewhisperer-status-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.codewhisperer-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.codewhisperer-task-actions .button.secondary {
  padding: 0.35rem 0.75rem;
}

.codewhisperer-task-actions .link-button {
  font-size: 0.85rem;
}

.codewhisperer-task-actions .codewhisperer-remove {
  color: #dc2626;
}

.codewhisperer-task-actions .codewhisperer-remove:hover,
.codewhisperer-task-actions .codewhisperer-remove:focus {
  color: #991b1b;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.child-story-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.child-story-item {
  padding: 0.5rem;
  border-left: 3px solid #3b82f6;
  background: #f9fafb;
}

.child-story-title {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.child-story-title:hover {
  text-decoration: underline;
  color: #1e3a8a;
}

.child-story-title.done-story {
  color: #4b5563;
}

.dependencies-section {
  margin-top: 1.5rem;
}

.dependencies-section .dependency-overlay-toggle {
  min-width: 0;
}

.dependency-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.dependency-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dependency-group-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #1f2937;
}

.dependency-add-btn {
  min-width: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.1;
}

.dependency-list {
  gap: 0.6rem;
}

.dependency-table {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dependency-table:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.dependency-table:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dependency-table.is-blocker {
  border-left: 4px solid #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.dependency-relationship {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.dependency-relationship.is-blocker {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.dependency-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dependency-picker label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: #1f2937;
}

.dependency-picker select {
  appearance: none;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #fff, #f9fafb);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dependency-picker select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.story-meta-row td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.story-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.story-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.story-meta-item .story-point-input {
  max-width: 120px;
}

.story-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #5b6b83;
}

.story-meta-value {
  font-size: 0.95rem;
  color: #0f172a;
}

.story-classification-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #475569;
  color: #ffffff;
}

.story-classification-badge.is-epic {
  background: #92400e;
}

.story-classification-detail {
  margin-left: 0.45rem;
  font-size: 0.85rem;
  color: #475569;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #ffffff;
  min-width: 3.5rem;
  justify-content: center;
}

.health-pill.pass {
  background: #16a34a;
}

.health-pill.fail {
  background: #d97706;
}

.health-issue-count {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #dc2626;
  cursor: pointer;
  text-decoration: underline;
}

.health-issue-count:hover {
  color: #991b1b;
}

.health-issue-list {
  margin: 0.5rem 0 0;
  padding-left: 0;
  list-style: none;
}

.health-issue-list li {
  margin: 0.2rem 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
}

.link-button:hover,
.link-button:focus {
  color: #1e3a8a;
  outline: none;
}

.health-ok {
  margin: 0;
  font-size: 0.9rem;
  color: #047857;
}

.health-analysis-note {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

.health-subheading {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
}

.health-issue-list.heuristic-list {
  margin-top: 0.25rem;
}

.health-modal {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
}

.health-modal h4 {
  margin: 0;
  font-size: 0.95rem;
}

.health-modal p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.issue-origin {
  font-size: 0.85rem;
  color: #0f172a;
  font-weight: 600;
}

.issue-context {
  font-size: 0.85rem;
  color: #475569;
  font-style: italic;
}

.document-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 520px;
}

.document-intro {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.document-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-action {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.document-action p {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}

.document-result {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #dce2f7;
  background: #ffffff;
}

.document-result.hidden {
  display: none;
}

.document-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.document-result-header h3 {
  margin: 0;
  font-size: 1rem;
}

.document-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #4b5563;
}

.document-output {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'Fira Code', 'SFMono-Regular', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.vertical-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e9f5;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
}

.task-table {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-table:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.vertical-table.health-warning {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.vertical-table th,
.vertical-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  border-bottom: 1px solid #e5e9f5;
  text-align: left;
}

.vertical-table.health-warning th {
  background: #fff7ed;
  color: #9a3412;
}

.vertical-table.health-warning td {
  background: #fffaf3;
}

.vertical-table th {
  width: 8.5rem;
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
}

.vertical-table tr:last-child th,
.vertical-table tr:last-child td {
  border-bottom: none;
}

.vertical-table td {
  white-space: pre-line;
  word-break: break-word;
}

.vertical-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty-state {
  margin: 0;
  font-size: 0.92rem;
  color: #4b5563;
}

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

.table-list th,
.table-list td {
  border: 1px solid #e5e9f5;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  text-align: left;
}

.table-list tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table-list .actions {
  display: flex;
  gap: 0.5rem;
}

.form-hint {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 0;
}

.file-picker input[type='file'] {
  margin-top: 0.4rem;
}

.reference-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.reference-link:hover {
  text-decoration: underline;
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: min(520px, 90vw);
}

dialog[data-size='wide'] {
  max-width: min(960px, 96vw);
  width: min(960px, 96vw);
}

dialog[data-size='content'] {
  width: fit-content;
  max-width: 98vw;
}

dialog[data-size='content'] .modal-shell {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 98vw;
}

.modal-shell {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d9deeb;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.modal-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e9f5;
}

.modal-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 75vh;
  overflow: auto;
}

.acceptance-test-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.acceptance-test-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.child-story-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.child-story-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.child-story-form .story-options label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.child-story-form .story-options input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.acceptance-tests-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.acceptance-tests-section h4 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1rem;
}

.acceptance-test-item {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

.acceptance-test-item:last-child {
  margin-bottom: 0;
}

.acceptance-test-item h5 {
  margin: 0 0 0.5rem 0;
  color: #2c5aa0;
  font-size: 0.9rem;
}

.acceptance-test-item p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.acceptance-test-item label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.acceptance-test-item input,
.acceptance-test-item textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.85rem;
}

.acceptance-test-item .remove-test-btn {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.codewhisperer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: min(48rem, 90vw);
}

.codewhisperer-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.codewhisperer-form .field.full {
  grid-column: span 2;
}

.codewhisperer-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
}

.codewhisperer-form input,
.codewhisperer-form textarea {
  width: 100%;
}

.codewhisperer-form fieldset {
  border: 1px solid #dbe3ff;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  background: #f8faff;
}

.codewhisperer-form fieldset legend {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1f2937;
  margin-right: 1rem;
}

.codewhisperer-form fieldset label {
  font-weight: 500;
  font-size: 0.85rem;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.codewhisperer-form fieldset input[type='radio'] {
  width: auto;
}

.codewhisperer-form .field-error {
  margin: 0;
  font-size: 0.78rem;
  min-height: 1rem;
  color: #dc2626;
}

.codewhisperer-form .form-error-banner {
  grid-column: span 2;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
}

.codewhisperer-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #0f172a;
}

.codewhisperer-checkbox input[type='checkbox'] {
  width: auto;
}

.child-story-generator {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.child-story-generator-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.child-story-generator-actions .form-hint {
  margin: 0;
  flex: 1 1 220px;
}

.ai-draft-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d9deeb;
  border-radius: 8px;
  background: #eef2ff;
}

.ai-draft-controls[hidden] {
  display: none;
}

.ai-draft-status {
  margin: 0;
  font-size: 0.85rem;
  color: #1f2937;
}

.modal-footer {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid #e5e9f5;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Modal overlay for div-based modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay .modal-shell {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}

#modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #334155;
}

#toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-size: 0.95rem;
}

#toast.show {
  opacity: 1;
}

.error-banner {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 280px var(--resize-handle-width) minmax(0, 1fr) var(--resize-handle-width) 340px;
  }
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .resize-handle {
    display: none;
  }
  .panel {
    min-height: 300px;
  }
}
/* CodeWhisperer delegation warning */
.delegation-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 12px;
  margin-top: 8px;
  font-size: 0.9em;
}

.delegation-warning p {
  margin: 0 0 8px 0;
}

.delegation-warning ul {
  margin: 8px 0;
  padding-left: 20px;
}

.delegation-warning li {
  margin-bottom: 4px;
  color: #856404;
}

.delegation-warning em {
  color: #6c757d;
  font-style: italic;
}
.codewhisperer-pr-link {
  margin: 8px 0;
  font-size: 0.9em;
}

.codewhisperer-pr-link span {
  font-weight: 500;
  color: #666;
}

.codewhisperer-pr-link a {
  color: #0366d6;
  text-decoration: none;
  font-weight: 500;
}

.codewhisperer-pr-link a:hover {
  text-decoration: underline;
}
/* Gating Tests Styles */
#testResults {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  border-left: 2px solid #ccc;
  padding: 1rem;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

.test-suite {
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem;
}

.test-item {
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.test-item:last-child {
  border-bottom: none;
}

.test-status-pass { color: #28a745; }
.test-status-fail { color: #dc3545; }
.test-status-running { color: #ffc107; }
.test-status-pending { color: #6c757d; }
/* Run in Staging Workflow Styles */
.workflow-steps {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

.workflow-steps .step {
  margin: 8px 0;
  padding: 5px 0;
  font-size: 14px;
  color: #495057;
}

.workflow-steps .step code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
}

.pr-info {
  margin-bottom: 20px;
  padding: 15px;
  background: #e3f2fd;
  border-radius: 6px;
  border-left: 4px solid #2196f3;
}

.pr-info h4 {
  margin: 0 0 10px 0;
  color: #1976d2;
}

.pr-info p {
  margin: 5px 0;
  font-size: 14px;
}

.staging-output {
  margin-top: 20px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.staging-output h4 {
  margin: 0;
  padding: 10px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
  color: #495057;
}

.staging-output pre {
  margin: 0;
  padding: 15px;
  background: #000;
  color: #00ff00;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}
/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  position: relative;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  cursor: move;
  user-select: none;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}

.btn-primary {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #545b62;
}

/* Child Story Modal Textareas */
.child-story-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  resize: vertical;
  min-height: 2em;
}

.child-story-form textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}


/* Extra large modal for terminal */
#modal[data-size="large"] .modal-shell {
  max-width: 800px;
  width: 90vw;
}

#modal[data-size="xlarge"] .modal-shell {
  max-width: 98vw;
  width: 1800px;
}

#modal[data-size="xlarge"] .modal-body {
  max-height: 85vh;
}

#modal[data-size="fullscreen"] {
  max-width: none !important;
  width: 95vw !important;
  height: 95vh;
  resize: both;
  overflow: auto;
}

#modal[data-size="fullscreen"] .modal-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#modal[data-size="fullscreen"] .modal-body {
  flex: 1;
  width: 100%;
  overflow: hidden;
}

#modal[data-size="fullscreen"] #terminal-container {
  width: 100% !important;
}

#modal[data-size="fullscreen"] .staging-options {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#modal[data-size="fullscreen"] .staging-options h3 {
  margin: 0 0 0.5rem 0;
  flex-shrink: 0;
}

/* Bold and underline specific labels in Details panel */
.story-form .field-row > label,
.story-form .full > label {
  font-weight: bold;
  text-decoration: underline;
}
/* Kiro CLI button styling */
#kiro-cli-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  font-weight: bold;
}

#kiro-cli-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
}

/* Acceptance Test Draft Styles */
#draft-tests-container {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

#draft-tests-container h4 {
  margin: 0 0 1rem 0;
  color: #334155;
}

.draft-test-item {
  background: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.draft-test-item h5 {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
}

.draft-test-item p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #475569;
}

.draft-test-item button {
  margin-top: 0.5rem;
}


/* Filter modal styles */
.filter-form .checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8f9fa;
}

.filter-form .checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.filter-form .checkbox-list label:hover {
  background: #e2e8f0;
  border-radius: 4px;
}

.filter-form .checkbox-list input[type="checkbox"] {
  cursor: pointer;
}


/* RTM View Styles */
.rtm-toolbar {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  align-items: center;
}

.rtm-control {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

#rtm-search {
  flex: 1;
  max-width: 300px;
}

.rtm-matrix-container {
  overflow: auto;
  height: calc(100vh - 250px);
}

.rtm-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rtm-matrix thead {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.rtm-matrix th {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  background: #f8f9fa;
}

.rtm-matrix td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.rtm-col-id {
  width: 80px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 5;
}

.rtm-col-title {
  min-width: 250px;
  position: sticky;
  left: 80px;
  background: #fff;
  z-index: 5;
}

.rtm-col-tests {
  min-width: 300px;
  max-width: 500px;
  position: sticky;
  left: 330px;
  background: #fff;
  z-index: 5;
  padding: 0.5rem;
}

.rtm-test-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rtm-test-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.rtm-test-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  background: #f8fafc;
  transition: background 0.2s;
}

.rtm-test-header:hover {
  background: #f1f5f9;
}

.rtm-test-expand {
  font-size: 0.7rem;
  color: #64748b;
  user-select: none;
}

.rtm-test-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
}

.rtm-test-status {
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.rtm-test-status.status-draft {
  background: #f1f5f9;
  color: #64748b;
}

.rtm-test-status.status-ready {
  background: #dbeafe;
  color: #1e40af;
}

.rtm-test-status.status-pass {
  background: #d1fae5;
  color: #065f46;
}

.rtm-test-status.status-fail {
  background: #fee2e2;
  color: #991b1b;
}

.rtm-test-details {
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.rtm-test-section {
  margin-bottom: 0.75rem;
}

.rtm-test-section:last-child {
  margin-bottom: 0;
}

.rtm-test-section strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #475569;
}

.rtm-test-section ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.rtm-test-section li {
  margin-bottom: 0.25rem;
  color: #64748b;
}

.rtm-col-coverage {
  width: 80px;
  text-align: center;
}

.rtm-cell {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

.rtm-cell:hover {
  opacity: 0.8;
}

.rtm-cell-gap {
  background: #fee2e2;
  color: #991b1b;
}

.rtm-cell-covered {
  background: #d1fae5;
  color: #065f46;
}

.rtm-cell-pass {
  background: #d1fae5;
  color: #065f46;
}

.rtm-cell-fail {
  background: #fecaca;
  color: #991b1b;
}

.rtm-row-indent-1 {
  padding-left: 2rem;
}

.rtm-row-indent-2 {
  padding-left: 4rem;
}

.rtm-row-indent-3 {
  padding-left: 6rem;
}

.rtm-expand-icon {
  font-size: 0.8rem;
  color: #64748b;
  transition: transform 0.2s;
}

.rtm-expand-icon:hover {
  color: #1e293b;
}

.rtm-matrix tbody tr:hover {
  background: #f9fafb;
}

.rtm-matrix tbody tr.rtm-row-selected {
  background: #e0e7ff;
}

.rtm-matrix tbody tr.rtm-row-selected:hover {
  background: #d0d7ef;
}

.rtm-matrix tbody tr.rtm-row-selected .rtm-col-id,
.rtm-matrix tbody tr.rtm-row-selected .rtm-col-title,
.rtm-matrix tbody tr.rtm-row-selected .rtm-col-tests {
  background: #e0e7ff;
}

.rtm-matrix tbody tr.rtm-row-selected:hover .rtm-col-id,
.rtm-matrix tbody tr.rtm-row-selected:hover .rtm-col-title,
.rtm-matrix tbody tr.rtm-row-selected:hover .rtm-col-tests {
  background: #d0d7ef;
}


/* CI/CD Dashboard Styles */
.cicd-dashboard {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cicd-dashboard h2 {
  margin: 0 0 15px 0;
}

.cicd-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
}

.cicd-matrix-container {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.cicd-matrix {
  --cicd-col-test-width: 120px;
  --cicd-col-story-width: 110px;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.cicd-matrix thead {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
}

.cicd-matrix th {
  position: relative;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
}

.cicd-th-content {
  display: block;
  width: 100%;
  padding-right: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cicd-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  background: transparent;
}

.cicd-col-resizer::before {
  content: '';
  width: 2px;
  height: 70%;
  border-radius: 999px;
  background: transparent;
}

.cicd-col-resizer:hover,
.cicd-col-resizer:focus-visible,
.cicd-matrix th:hover .cicd-col-resizer {
  background: #eef2ff;
}

.cicd-col-resizer:hover::before,
.cicd-col-resizer:focus-visible::before,
.cicd-matrix th:hover .cicd-col-resizer::before {
  background: #94a3ff;
}

.cicd-col-test {
  width: var(--cicd-col-test-width);
  min-width: 80px;
  max-width: var(--cicd-col-test-width);
  position: sticky;
  left: 0;
  z-index: 5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
}

.cicd-col-story {
  width: var(--cicd-col-story-width);
  min-width: 80px;
  max-width: var(--cicd-col-story-width);
  position: sticky;
  left: var(--cicd-col-test-width);
  z-index: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
}

.cicd-col-title {
  width: 320px;
  min-width: 160px;
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
}

.cicd-matrix thead .cicd-col-test {
  z-index: 13;
}

.cicd-matrix thead .cicd-col-story {
  z-index: 12;
}

.cicd-matrix thead .cicd-col-test,
.cicd-matrix thead .cicd-col-story {
  left: auto;
}

.cicd-col-runs,
.cicd-col-run,
.cicd-run-col {
  text-align: center;
  min-width: 100px;
}

.cicd-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  box-sizing: border-box;
}

.cicd-matrix tbody tr:hover {
  background: #f9f9f9;
}

.cicd-matrix .cicd-col-story {
  font-weight: 600;
  color: #007bff;
  background: white;
}

.cicd-matrix .cicd-col-test {
  background: white;
}


.cicd-matrix td.cicd-col-story > a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cicd-col-run,
.cicd-run-col {
  position: relative;
  z-index: 1;
  text-align: center;
  min-width: 100px;
  border-left: 1px solid #eee;
  background: white;
}

.cicd-cell-pass {
  color: #28a745;
  font-weight: bold;
  font-size: 16px;
}

.cicd-cell-fail {
  color: #dc3545;
  font-weight: bold;
  font-size: 16px;
}

.cicd-cell-none {
  color: #ccc;
}

.cicd-legend {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
}

.cicd-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Project Selector */
.project-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
}

#project-dropdown {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  font-size: 14px;
  min-width: 200px;
}

.icon-btn {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 16px;
}

.icon-btn:hover {
  background: #f5f5f5;
}

/* Project Manager Modal */
.projects-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.projects-table th,
.projects-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.projects-table th {
  background: #f5f5f5;
  font-weight: 600;
}

.projects-table button {
  padding: 0.25rem 0.5rem;
  margin: 0 0.25rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 12px;
}

.projects-table button:hover {
  background: #f5f5f5;
}

.projects-table button.danger:hover {
  background: #fee;
  border-color: #fcc;
  color: #c00;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn-primary {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0056b3;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
