/* ═══════════════════════════════════════════════ */
/*  PHASE PROGRESS                                 */
/* ═══════════════════════════════════════════════ */
.phase-bar {
  display: flex;
  gap: 4px;
  margin: 18px 0;
}

.phase-segment {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--phase-track);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.phase-segment-clickable {
  cursor: pointer;
}

.phase-segment-clickable:hover {
  height: 10px;
  margin-top: -2px;
  margin-bottom: -2px;
  box-shadow: 0 0 10px var(--accent-dim);
  background: color-mix(in srgb, var(--phase-fill) 60%, var(--phase-track));
}

.phase-segment.filled {
  background: var(--phase-fill);
  box-shadow: 0 0 8px var(--accent-dim);
}

.phase-segment.filled.phase-segment-clickable:hover {
  background: var(--phase-fill);
  box-shadow: 0 0 14px var(--accent-dim);
}

.phase-segment.current {
  background: var(--phase-fill);
  animation: phasePulse 2s ease-in-out infinite;
}

.phase-segment.current.phase-segment-clickable:hover {
  animation: none;
  background: var(--phase-fill);
  box-shadow: 0 0 14px var(--accent-dim);
}

@keyframes phasePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.phase-labels {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.phase-label {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  line-height: 1.3;
}

.phase-label.active { color: var(--accent); font-weight: 600; }

.phase-gate {
  position: relative;
}

.phase-gate::before {
  content: '\1F512';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
}

/* ═══════════════════════════════════════════════ */
/*  PHASE DROPDOWN                                 */
/* ═══════════════════════════════════════════════ */
.phase-dropdown-container {
  margin-bottom: 16px;
}

.phase-dropdown-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.phase-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.phase-select:hover {
  border-color: var(--border-active);
}

.phase-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.phase-select option {
  background: var(--bg-raised);
  color: var(--text-primary);
  padding: 8px;
}

/* ═══════════════════════════════════════════════ */
/*  PHASE HISTORY LOG                              */
/* ═══════════════════════════════════════════════ */
.phase-history {
  margin-top: 16px;
}

.phase-history-header {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.phase-history-log {
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.phase-history-entry {
  padding: 6px 12px;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-dim);
  margin-bottom: 4px;
  transition: var(--transition);
}

.phase-history-entry:first-child {
  border-left-color: var(--accent);
  color: var(--text-primary);
}

.phase-history-entry:hover {
  background: var(--bg-hover);
}

.phase-history-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
  padding: 8px 12px;
}

/* ═══════════════════════════════════════════════ */
/*  PHASE CONTROL                                  */
/* ═══════════════════════════════════════════════ */
.phase-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.phase-action {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
}

.phase-action-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.phase-action-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.phase-action .btn { width: 100%; justify-content: center; }

.phase-action.locked { opacity: 0.5; pointer-events: none; }
